65#if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
69#ifdef ENGAUGE_JPEG2000
88#include <QApplication>
93#include <QDesktopServices>
95#include <QDomDocument>
98#include <QImageReader>
100#include <QKeySequence>
102#include <QMessageBox>
103#include <QMouseEvent>
104#include <QPrintDialog>
107#include <QPushButton>
109#include <QSignalMapper>
110#include <QTextStream>
111#if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
116#include <QToolButton>
118#include <QVBoxLayout>
120#include <QXmlStreamReader>
121#include <QXmlStreamWriter>
135static const char *ENGAUGE_FILENAME_DESCRIPTION =
"Engauge Document";
153 m_originalFileWasImported (
false),
154 m_isDocumentExported (
false),
162 m_digitizeStateContext (
nullptr),
163 m_transformationStateContext (
nullptr),
164 m_backgroundStateContext (
nullptr),
166 m_isGnuplot (isGnuplot),
169 m_timerRegressionErrorReport(
nullptr),
172 m_timerRegressionFileCmdScript(
nullptr),
173 m_guidelines (*
this),
180 <<
" curDir=" << QDir::currentPath().toLatin1().data();
182#if defined(OSX_DEBUG) || defined(OSX_RELEASE)
183 qApp->setApplicationName (
"Engauge Digitizer");
184 qApp->setOrganizationDomain (
"Mark Mitchell");
189 m_startupDirectory = QDir::currentPath();
207 QDir::setCurrent (m_startupDirectory);
210 m_regressionFile = exportRegressionFilenameFromInputFilename (
loadStartupFiles.first ());
211 slotLoadStartupFiles ();
216 m_regressionFile = exportRegressionFilenameFromInputFilename (
loadStartupFiles.first ());
217 slotLoadStartupFiles ();
218 handlerFileExtractImage ();
222 if (m_isErrorReportRegressionTest) {
227 startRegressionTestFileCmdScript();
242#if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
245 delete m_tutorialDlg;
246 delete m_cmdMediator;
247 delete m_cmdStackShadow;
248 delete m_digitizeStateContext;
249 delete m_transformationStateContext;
250 delete m_backgroundStateContext;
251 delete m_dlgSettingsAxesChecker;
252 delete m_dlgSettingsColorFilter;
253 delete m_dlgSettingsCoords;
254 delete m_dlgSettingsCurveList;
255 delete m_dlgSettingsCurveProperties;
256 delete m_dlgSettingsDigitizeCurve;
257 delete m_dlgSettingsExportFormat;
258 delete m_dlgSettingsGeneral;
259 delete m_dlgSettingsGridDisplay;
260 delete m_dlgSettingsGridRemoval;
261 delete m_dlgSettingsMainWindow;
262 delete m_dlgSettingsPointMatch;
263 delete m_dlgSettingsSegments;
264 delete m_fileCmdScript;
265 m_gridLines.
clear ();
266 m_guidelines.
clear ();
269void MainWindow::addDockWindow (QDockWidget *
dockWidget,
280 Qt::NoDockWidgetArea).toInt());
282 if (
area == Qt::NoDockWidgetArea) {
299void MainWindow::applyZoomFactorAfterLoad()
304 if (m_zoomMapFromInitial.contains (zoomFactorInitial)) {
305 zoomFactor = m_zoomMapFromInitial [zoomFactorInitial];
309 LOG4CPP_ERROR_S ((*
mainCat)) <<
"MainWindow::applyZoomFactorAfterLoad unexpected zoom factor " << zoomFactorInitial;
348 m_regressionFile = exportRegressionFilenameFromInputFilename (
fileName);
357 m_regressionFile = exportRegressionFilenameFromInputFilename (
fileName);
364 return m_cmdMediator;
367ZoomFactor MainWindow::currentZoomFactor ()
const
385 if (
event->type () == QEvent::KeyPress) {
405#if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
406void MainWindow::exportAllCoordinateSystemsAfterRegressionTests()
408 LOG4CPP_INFO_S ((*
mainCat)) <<
"MainWindow::exportAllCoordinateSystemsAfterRegressionTests curDir=" << QDir::currentPath().toLatin1().data();
416 .arg (m_regressionFile)
442 befores <<
".dig" <<
".gif" <<
".html" <<
".htm" <<
".jp2" <<
".jpg" <<
".pbm"
443 <<
".pdf" <<
".pgm" <<
".png" <<
".ppm" <<
".webp" <<
".xbm" <<
".xpm" <<
".xml";
447 QStringList::iterator
itr;
461 <<
" curDir=" << QDir::currentPath().toLatin1().data()
462 <<
" fileName=" <<
fileName.toLatin1().data();
465 if (
file.open(QIODevice::WriteOnly)) {
479 m_isDocumentExported =
true;
481 updateChecklistGuide ();
487 <<
" file=" <<
fileName.toLatin1().data()
488 <<
" curDir=" << QDir::currentPath().toLatin1().data();
489 QMessageBox::critical (
nullptr,
491 tr (
"Unable to export to file") +
" " +
fileName);
498 <<
" curDir=" << QDir::currentPath().toLatin1().data()
499 <<
" fileName=" <<
fileName.toLatin1().data();
502 if (
file.open(QIODevice::WriteOnly)) {
508 if (m_isErrorReportRegressionTest) {
510 .arg (exportRegressionFilenameFromInputFilename (m_regressionFile));
521 <<
" file=" <<
fileName.toLatin1().data()
522 <<
" curDir=" << QDir::currentPath().toLatin1().data();
523 QMessageBox::critical (
nullptr,
525 tr (
"Unable to extract image to file") +
" " +
fileName);
533 <<
" fileName=" <<
fileName.toLatin1 ().data ()
534 <<
" curDir=" << QDir::currentPath().toLatin1().data()
541 m_originalFileWasImported =
true;
556#ifdef ENGAUGE_JPEG2000
570 m_isErrorReportRegressionTest);
587 m_isErrorReportRegressionTest);
605 .arg (
tr (
"In OSX, files loaded at startup must be in the Downloads, Pictures or "
606 "Library/Containers/Digitizer/Data directories"));
615 msg += QObject::tr (
"The file appears to have characters from multiple language "
616 "alphabets, which does not work in the Windows command line");
619 QMessageBox::warning (
this,
637 ! m_actionViewCoordSystem->isChecked ()) {
640 m_actionViewCoordSystem->trigger ();
663void MainWindow::fileImportWithPrompts (ImportType
importType)
671 if (
importType != IMPORT_TYPE_IMAGE_REPLACE) {
687 str <<
";; All Files (*.*)";
705QString MainWindow::fileNameForExportOnly ()
const
710 if (m_isErrorReportRegressionTest) {
714 .arg (exportRegressionFilenameFromInputFilename (m_regressionFile));
729QString MainWindow::fileNameForExtractImageOnly ()
const
736 .arg (m_extractImageOnlyExtension);
741void MainWindow::filePaste (ImportType
importType)
751 m_originalFileWasImported =
true;
764 QImage image = QApplication::clipboard()->image();
772 QMessageBox::warning (
this,
806void MainWindow::ghostsCreate ()
813 for (
unsigned int index = 0; index < m_cmdMediator->
document().coordSystemCount(); index++) {
832void MainWindow::ghostsDestroy ()
860void MainWindow::guidelineAddXTEnqueue (
double xT)
866 m_cmdMediator->push (
cmd);
885void MainWindow::guidelineAddYREnqueue (
double yR)
891 m_cmdMediator->push (
cmd);
931 return (guidelinesVisibilityCanBeEnabled () &&
932 (m_actionViewGuidelinesEdit->isChecked() || m_actionViewGuidelinesLock->isChecked()));
935bool MainWindow::guidelinesVisibilityCanBeEnabled ()
const
946 return (!m_currentFile.isEmpty() &&
955 m_actionViewGuidelinesHide->setChecked (
true);
959 m_actionViewGuidelinesEdit->setChecked (
true);
963 m_actionViewGuidelinesLock->setChecked (
true);
977void MainWindow::handleGuidelineMode ()
980 m_actionViewGuidelinesLock->isChecked());
983void MainWindow::handlerFileExtractImage ()
987 if (m_isExtractImageOnly) {
1007void MainWindow::loadCoordSystemListFromCmdMediator ()
1011 m_cmbCoordSystem->clear();
1015 for (
unsigned int i = 0;
i < numberCoordSystem;
i++) {
1017 m_cmbCoordSystem->addItem (QString::number (
index1Based),
1022 m_cmbCoordSystem->setCurrentIndex (0);
1025 bool enable = (m_cmbCoordSystem->count() > 1);
1026 m_cmbCoordSystem->setEnabled (
enable);
1027 m_btnShowAll->setEnabled (
enable);
1028 m_btnPrintAll->setEnabled (
enable);
1031void MainWindow::loadCurveListFromCmdMediator ()
1035 m_cmbCurve->clear ();
1037 QStringList::iterator
itr;
1038 for (
itr = curvesGraphsNames.begin ();
itr != curvesGraphsNames.end ();
itr++) {
1052 QApplication::setOverrideCursor(Qt::WaitCursor);
1059 rebuildRecentFileListForCurrentFile(
fileName);
1062 delete m_cmdMediator;
1065 setupAfterLoadNewDocument (
fileName,
1067 IMPORT_TYPE_SIMPLE);
1070 m_actionDigitizeSelect->setChecked (
true);
1071 slotDigitizeSelect();
1075 m_originalFileWasImported =
false;
1080 QApplication::restoreOverrideCursor();
1084 QApplication::restoreOverrideCursor();
1087 QMessageBox::warning (
this,
1103 if (!
file.exists()) {
1107 QMessageBox::critical (
this,
1109 tr (
"File not found") +
": " +
fileInfo.absoluteFilePath());
1115 file.open(QIODevice::ReadOnly | QIODevice::Text);
1126 tr (
"Error report opened"),
1127 IMPORT_TYPE_SIMPLE);
1130 m_actionDigitizeSelect->setChecked (
true);
1131 slotDigitizeSelect();
1136void MainWindow::loadGuidelinesFromCmdMediator ()
1149 <<
" fileName=" <<
fileName.toLatin1 ().data ()
1153 if (
importType == IMPORT_TYPE_IMAGE_REPLACE) {
1154 success = loadImageReplacingImage (
fileName,
1158 success = loadImageNewDocument (
fileName,
1171 <<
" fileName=" <<
fileName.toLatin1 ().data ()
1176 QApplication::setOverrideCursor(Qt::WaitCursor);
1179 QApplication::restoreOverrideCursor();
1185 delete m_cmdMediator;
1189 tr (
"File imported"),
1195 if (m_actionHelpChecklistGuideWizard->isChecked () &&
1196 (m_fileCmdScript ==
nullptr)) {
1201 if (
wizard->exec() == QDialog::Accepted) {
1203 for (
CoordSystemIndex coordSystemIndex = 0; coordSystemIndex < m_cmdMediator->
document().coordSystemCount(); coordSystemIndex++) {
1207 wizard->curveNames(coordSystemIndex));
1211 wizard->populateCurvesGraphs (coordSystemIndex,
1217 m_actionViewChecklistGuide->setChecked (
true);
1220 loadCurveListFromCmdMediator();
1223 loadCoordSystemListFromCmdMediator();
1229 m_actionDigitizeAxis->setChecked (
true);
1233 slotDigitizeScale ();
1234 }
else if (modeGraph ()) {
1235 slotDigitizeAxis ();
1249 <<
" fileName=" <<
fileName.toLatin1 ().data ()
1263 tr (
"File imported"),
1277 if (!
file.open (QIODevice::ReadOnly)) {
1285void MainWindow::loadToolTips()
1287 if (m_actionViewToolTips->isChecked ()) {
1290 m_actionDigitizeSelect->setToolTip (m_actionDigitizeSelect->text());
1291 m_actionDigitizeAxis->setToolTip (m_actionDigitizeAxis->text());
1292 m_actionDigitizeScale->setToolTip (m_actionDigitizeScale->text());
1293 m_actionDigitizeCurve->setToolTip (m_actionDigitizeCurve->text());
1294 m_actionDigitizePointMatch->setToolTip (m_actionDigitizePointMatch->text());
1295 m_actionDigitizeColorPicker->setToolTip (m_actionDigitizeColorPicker->text());
1296 m_actionDigitizeSegment->setToolTip (m_actionDigitizeSegment->text());
1297 m_cmbBackground->setToolTip (
tr (
"Background image."));
1298 m_cmbCurve->setToolTip (
tr (
"Currently selected curve."));
1299 m_viewPointStyle->setToolTip (
tr (
"Point style for currently selected curve."));
1300 m_viewSegmentFilter->setToolTip (
tr (
"Segment Fill filter for currently selected curve."));
1305 m_actionDigitizeSelect->setToolTip (
"");
1306 m_actionDigitizeAxis->setToolTip (
"");
1307 m_actionDigitizeScale->setToolTip (
"");
1308 m_actionDigitizeCurve->setToolTip (
"");
1309 m_actionDigitizePointMatch->setToolTip (
"");
1310 m_actionDigitizeColorPicker->setToolTip (
"");
1311 m_actionDigitizeSegment->setToolTip (
"");
1312 m_cmbBackground->setToolTip (
"");
1313 m_cmbCurve->setToolTip (
"");
1314 m_viewPointStyle->setToolTip (
"");
1315 m_viewSegmentFilter->setToolTip (
"");
1320bool MainWindow::maybeSave()
1322 if (m_cmdMediator !=
nullptr) {
1324 QMessageBox::StandardButton
ret = QMessageBox::warning (
this,
1326 tr(
"The document has been modified.\n"
1327 "Do you want to save your changes?"),
1328 QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
1329 if (
ret == QMessageBox::Save) {
1330 return slotFileSave();
1331 }
else if (
ret == QMessageBox::Cancel) {
1343 .arg (
tr (
"Cannot read file"))
1347bool MainWindow::modeGraph ()
const
1349 bool success =
false;
1351 if (m_cmdMediator !=
nullptr) {
1360 bool success =
false;
1362 if (m_cmdMediator !=
nullptr) {
1371 return m_modelMainWindow;
1374void MainWindow::rebuildRecentFileListForCurrentFile(
const QString &
filePath)
1389 updateRecentFileList();
1396 if (m_actionZoomFill->isChecked ()) {
1400 QMainWindow::resizeEvent(
event);
1408 if (!
file.open(QFile::WriteOnly)) {
1409 QMessageBox::warning (
this,
1412 .
arg(
tr (
"Cannot write file"))
1418 rebuildRecentFileListForCurrentFile (
fileName);
1420 QApplication::setOverrideCursor (Qt::WaitCursor);
1422 writer.setAutoFormatting(
true);
1423 writer.writeStartDocument();
1424 writer.writeDTD(
"<!DOCTYPE engauge>");
1426 writer.writeEndDocument();
1427 QApplication::restoreOverrideCursor ();
1431 m_cmdMediator->setClean ();
1448 if ((m_cmdMediator !=
nullptr) && !m_isErrorReportRegressionTest) {
1456 if (
dlg.exec() == QDialog::Accepted) {
1461 "error_report.xml");
1466 fileError.open (QIODevice::WriteOnly | QIODevice::Text);
1476QString MainWindow::saveErrorReportFileAndExitXml (
const char *context,
1485 writer.setAutoFormatting(
true);
1493 writer.writeEndElement();
1498 while (!
reader.atEnd ()) {
1500 if (
reader.tokenType() != QXmlStreamReader::StartDocument &&
1501 reader.tokenType() != QXmlStreamReader::EndDocument &&
1502 reader.tokenType() != QXmlStreamReader::Invalid) {
1511 writer.writeEndElement();
1517 writer.writeEndElement();
1528 writer.writeEndElement();
1530 writer.writeEndElement();
1537 if (!m_originalFileWasImported) {
1587void MainWindow::saveStartingDocumentSnapshot()
1592 writer.setAutoFormatting (
true);
1611 m_cmbBackground->setCurrentIndex(index);
1618 return m_cmbCurve->currentText ();
1642 m_currentFileWithPathAndFileExtension =
fileName;
1644 updateWindowTitle ();
1651 if (
dir.exists ()) {
1653 bool success = QDir::setCurrent (
dir.absolutePath ());
1681 m_backgroundStateContext->
setPixmap (m_isGnuplot,
1691void MainWindow::settingsRead (
bool isReset)
1700 settingsReadEnvironment (
settings);
1708 QDir::currentPath ()).toString ());
1727#if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
1729 QSize (900, 600)).toSize();
1783 addDockWindow (m_dockChecklistGuide,
1787 Qt::RightDockWidgetArea);
1788 addDockWindow (m_dockFittingWindow,
1792 Qt::RightDockWidgetArea);
1793 addDockWindow (m_dockGeometryWindow,
1797 Qt::RightDockWidgetArea);
1840 QVariant (QDir::currentPath())).toString ());
1842 QVariant (QDir::currentPath())).toString ());
1845 updateSmallDialogs();
1850void MainWindow::settingsWrite ()
1863#if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
1867 if (m_dockChecklistGuide->isFloating()) {
1877 if (m_dockFittingWindow->isFloating()) {
1885 if (m_dockGeometryWindow->isFloating()) {
1929 <<
" file=" <<
fileName.toLatin1().data()
1940 m_digitizeStateContext->
resetOnLoad (m_cmdMediator);
1947 m_cmdMediator->
pixmap ());
1953 applyZoomFactorAfterLoad();
1979 loadCurveListFromCmdMediator ();
1980 loadCoordSystemListFromCmdMediator ();
1983 m_isDocumentExported =
false;
1993 m_cmbCurve->currentText ());
1996 applyZoomFactorAfterLoad();
2002 saveStartingDocumentSnapshot();
2006 loadGuidelinesFromCmdMediator ();
2007 handleGuidelineMode ();
2012bool MainWindow::setupAfterLoadReplacingImage (
const QString &
fileName,
2017 <<
" file=" <<
fileName.toLatin1().data()
2024 m_cmdMediator->clear();
2027 m_cmdMediator->
pixmap ());
2029 m_isDocumentExported =
false;
2033 applyZoomFactorAfterLoad();
2043 saveStartingDocumentSnapshot();
2053 <<
" files=" << m_loadStartupFiles.join (
",").toLatin1().data();
2055 QMainWindow::showEvent (
event);
2057 if (m_loadStartupFiles.count() > 0) {
2059 m_timerLoadStartupFiles =
new QTimer;
2060 m_timerLoadStartupFiles->setSingleShot (
true);
2062 m_timerLoadStartupFiles->start (0);
2072void MainWindow::slotBtnGuidelineBottomCartesian ()
2077 guidelineAddXTEnqueue (posGraph.x ());
2080void MainWindow::slotBtnGuidelineBottomPolar ()
2085 guidelineAddXTEnqueue (posGraph.x ());
2088void MainWindow::slotBtnGuidelineLeftCartesian ()
2093 guidelineAddYREnqueue (posGraph.y ());
2096void MainWindow::slotBtnGuidelineLeftPolar ()
2101 guidelineAddYREnqueue (posGraph.y ());
2104void MainWindow::slotBtnGuidelineRightCartesian ()
2109 guidelineAddYREnqueue (posGraph.y ());
2112void MainWindow::slotBtnGuidelineRightPolar ()
2117 guidelineAddYREnqueue (posGraph.y ());
2120void MainWindow::slotBtnGuidelineTopCartesian ()
2125 guidelineAddXTEnqueue (posGraph.x ());
2128void MainWindow::slotBtnGuidelineTopPolar ()
2133 guidelineAddXTEnqueue (posGraph.x ());
2136void MainWindow::slotBtnPrintAll ()
2144 if (
dlg.exec() == QDialog::Accepted) {
2153void MainWindow::slotBtnShowAllPressed ()
2161void MainWindow::slotBtnShowAllReleased ()
2169void MainWindow::slotCanRedoChanged (
bool canRedo)
2173 m_actionEditRedo->setEnabled (canRedo || m_cmdStackShadow->
canRedo());
2176void MainWindow::slotCanUndoChanged (
bool canUndo)
2180 m_actionEditUndo->setEnabled (
canUndo);
2183void MainWindow::slotChecklistClosed()
2187 m_actionViewChecklistGuide->setChecked (
false);
2190void MainWindow::slotCleanChanged(
bool clean)
2203 if (!m_actionViewBackgroundNone->isChecked()) {
2204 m_actionViewBackgroundNone->toggle();
2209 if (!m_actionViewBackgroundOriginal->isChecked ()) {
2210 m_actionViewBackgroundOriginal->toggle();
2215 if (!m_actionViewBackgroundFiltered->isChecked ()) {
2216 m_actionViewBackgroundFiltered->toggle();
2224void MainWindow::slotCmbCoordSystem(
int index)
2232 m_cmdMediator->push (
cmd);
2235void MainWindow::slotCmbCurve(
int )
2243 m_cmbCurve->currentText ());
2247 updateViewedCurves();
2249 updateFittingWindow();
2250 updateGeometryWindow();
2269void MainWindow::slotDigitizeAxis ()
2275 m_cmbCurve->setEnabled (
false);
2281void MainWindow::slotDigitizeColorPicker ()
2287 m_cmbCurve->setEnabled (
true);
2293void MainWindow::slotDigitizeCurve ()
2299 m_cmbCurve->setEnabled (
true);
2305void MainWindow::slotDigitizePointMatch ()
2311 m_cmbCurve->setEnabled (
true);
2317void MainWindow::slotDigitizeScale ()
2323 m_cmbCurve->setEnabled (
false);
2329void MainWindow::slotDigitizeSegment ()
2335 m_cmbCurve->setEnabled (
true);
2341void MainWindow::slotDigitizeSelect ()
2347 m_cmbCurve->setEnabled (
false);
2353void MainWindow::slotEditCopy ()
2366 m_dockFittingWindow->
doCopy ();
2371 m_dockGeometryWindow->
doCopy ();
2388void MainWindow::slotEditCut ()
2417void MainWindow::slotEditDelete ()
2452void MainWindow::slotEditMenu ()
2456 m_actionEditPasteAsNew->setEnabled (!QApplication::clipboard()->image().
isNull());
2457 m_actionEditPasteAsNewAdvanced->setEnabled (!QApplication::clipboard()->image().
isNull());
2460void MainWindow::slotEditPaste ()
2474 m_cmbCurve->currentText (),
2481void MainWindow::slotEditPasteAsNew ()
2485 filePaste (IMPORT_TYPE_SIMPLE);
2488void MainWindow::slotEditPasteAsNewAdvanced ()
2492 filePaste (IMPORT_TYPE_ADVANCED);
2495void MainWindow::slotFileClose()
2515 if (m_fittingCurve !=
nullptr) {
2516 m_scene->removeItem (m_fittingCurve);
2517 m_fittingCurve =
nullptr;
2524 m_backgroundStateContext->
close ();
2527 m_scene->setSceneRect (
QRectF (0, 0, 1, 1));
2530 m_dockFittingWindow->
clear ();
2533 m_dockGeometryWindow->
clear ();
2536 delete m_cmdMediator;
2539 m_cmdMediator =
nullptr;
2544 m_gridLines.
clear();
2545 m_guidelines.
clear();
2550void MainWindow::slotFileExport ()
2560 if (m_isExportOnly) {
2561 fileName = fileNameForExportOnly ();
2571 .arg (m_currentFile)
2595void MainWindow::slotFileImport ()
2599 fileImportWithPrompts (IMPORT_TYPE_SIMPLE);
2602void MainWindow::slotFileImportAdvanced ()
2606 fileImportWithPrompts (IMPORT_TYPE_ADVANCED);
2609void MainWindow::slotFileImportDraggedImage(
QImage image)
2616 IMPORT_TYPE_SIMPLE);
2619void MainWindow::slotFileImportDraggedImageUrl(
QUrl url)
2621 LOG4CPP_INFO_S ((*
mainCat)) <<
"MainWindow::slotFileImportDraggedImageUrl url=" <<
url.toString ().toLatin1 ().data ();
2635 IMPORT_TYPE_SIMPLE);
2638void MainWindow::slotFileImportImageReplace ()
2642 fileImportWithPrompts (IMPORT_TYPE_IMAGE_REPLACE);
2645void MainWindow::slotFileOpen()
2654 .arg (ENGAUGE_FILENAME_DESCRIPTION)
2659 tr(
"Open Document"),
2678void MainWindow::slotFilePrint()
2684 if (
dlg.exec() == QDialog::Accepted) {
2691bool MainWindow::slotFileSave()
2695 if (m_engaugeFile.isEmpty()) {
2696 return slotFileSaveAs();
2698 return saveDocumentFile (m_engaugeFile);
2702bool MainWindow::slotFileSaveAs()
2710 .arg (m_currentFile)
2714 if (!m_engaugeFile.isEmpty()) {
2719 .arg (ENGAUGE_FILENAME_DESCRIPTION)
2730 dlg.setFileMode (QFileDialog::AnyFile);
2733#if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
2735 dlg.setWindowModality(Qt::WindowModal);
2737 dlg.setAcceptMode(QFileDialog::AcceptSave);
2744 return saveDocumentFile(
files.at(0));
2750void MainWindow::slotFittingWindowClosed()
2754 m_actionViewFittingWindow->setChecked (
false);
2767 if (m_fittingCurve !=
nullptr) {
2768 m_scene->removeItem (m_fittingCurve);
2769 delete m_fittingCurve;
2778 m_fittingCurve->setVisible (m_actionViewFittingWindow->isChecked ());
2779 m_scene->addItem (m_fittingCurve);
2782void MainWindow::slotGeometryWindowClosed()
2786 m_actionViewGeometryWindow->setChecked (
false);
2811 m_cmdMediator->push (
cmd);
2814void MainWindow::slotHelpAbout()
2822void MainWindow::slotHelpTutorial()
2826 m_tutorialDlg->show ();
2827 m_tutorialDlg->exec ();
2830void MainWindow::slotKeyPress (Qt::Key
key,
2842void MainWindow::slotLoadStartupFiles ()
2849 m_loadStartupFiles.pop_front();
2860 IMPORT_TYPE_SIMPLE);
2864 if (m_loadStartupFiles.count() > 0) {
2868 QProcess::startDetached (QCoreApplication::applicationFilePath(),
2869 m_commandLineWithoutLoadStartupFiles + m_loadStartupFiles);
2873void MainWindow::slotMouseMove (
QPointF pos)
2878 if (m_cmdMediator !=
nullptr) {
2901void MainWindow::slotMousePress (
QPointF pos)
2911void MainWindow::slotMouseRelease (
QPointF pos)
2915 if (pos.x() < 0 || pos.y() < 0) {
2929void MainWindow::slotRecentFileAction ()
2941void MainWindow::slotRecentFileClear ()
2951 updateRecentFileList();
2954void MainWindow::slotRedoTextChanged (
const QString &
text)
2959 if (!
text.isEmpty ()) {
2965void MainWindow::slotSettingsAxesChecker ()
2969 m_dlgSettingsAxesChecker->
load (*m_cmdMediator);
2970 m_dlgSettingsAxesChecker->show ();
2973void MainWindow::slotSettingsColorFilter ()
2977 m_dlgSettingsColorFilter->
load (*m_cmdMediator);
2978 m_dlgSettingsColorFilter->show ();
2981void MainWindow::slotSettingsCoords ()
2985 m_dlgSettingsCoords->
load (*m_cmdMediator);
2986 m_dlgSettingsCoords->show ();
2989void MainWindow::slotSettingsCurveList ()
2993 m_dlgSettingsCurveList->
load (*m_cmdMediator);
2994 m_dlgSettingsCurveList->show ();
2997void MainWindow::slotSettingsCurveProperties ()
3001 m_dlgSettingsCurveProperties->
load (*m_cmdMediator);
3003 m_dlgSettingsCurveProperties->show ();
3006void MainWindow::slotSettingsDigitizeCurve ()
3010 m_dlgSettingsDigitizeCurve->
load (*m_cmdMediator);
3011 m_dlgSettingsDigitizeCurve->show ();
3014void MainWindow::slotSettingsExportFormat ()
3019 m_dlgSettingsExportFormat->
load (*m_cmdMediator);
3020 m_dlgSettingsExportFormat->show ();
3027void MainWindow::slotSettingsGeneral ()
3031 m_dlgSettingsGeneral->
load (*m_cmdMediator);
3032 m_dlgSettingsGeneral->show ();
3035void MainWindow::slotSettingsGridDisplay()
3039 m_dlgSettingsGridDisplay->
load (*m_cmdMediator);
3040 m_dlgSettingsGridDisplay->show ();
3043void MainWindow::slotSettingsGridRemoval ()
3047 m_dlgSettingsGridRemoval->
load (*m_cmdMediator);
3048 m_dlgSettingsGridRemoval->show ();
3051void MainWindow::slotSettingsPointMatch ()
3055 m_dlgSettingsPointMatch->
load (*m_cmdMediator);
3056 m_dlgSettingsPointMatch->show ();
3059void MainWindow::slotSettingsSegments ()
3063 m_dlgSettingsSegments->
load (*m_cmdMediator);
3064 m_dlgSettingsSegments->show ();
3067void MainWindow::slotTableStatusChange ()
3076void MainWindow::slotSettingsMainWindow ()
3082 m_dlgSettingsMainWindow->show ();
3085void MainWindow::slotTimeoutRegressionErrorReport ()
3088 <<
" cmdStackIndex=" << m_cmdMediator->index()
3089 <<
" cmdStackCount=" << m_cmdMediator->count();
3091 if (m_cmdStackShadow->
canRedo()) {
3094 QDir::setCurrent (m_startupDirectory);
3099 QDir::setCurrent (m_startupDirectory);
3103#if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
3104 exportAllCoordinateSystemsAfterRegressionTests ();
3108 m_cmdMediator->setClean();
3114void MainWindow::slotTimeoutRegressionFileCmdScript ()
3118 if (m_fileCmdScript->
canRedo()) {
3121 QDir::setCurrent (m_startupDirectory);
3123 m_fileCmdScript->
redo(*
this);
3126 QDir::setCurrent (m_startupDirectory);
3131 if (m_cmdMediator !=
nullptr) {
3133#if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
3134 exportAllCoordinateSystemsAfterRegressionTests ();
3138 m_cmdMediator->setClean();
3148void MainWindow::slotUndoTextChanged (
const QString &
text)
3153 if (!
text.isEmpty ()) {
3159void MainWindow::slotViewGridLines ()
3173 if (
action == m_actionViewBackgroundNone) {
3176 }
else if (
action == m_actionViewBackgroundOriginal) {
3179 }
else if (
action == m_actionViewBackgroundFiltered) {
3195void MainWindow::slotViewGroupCurves(
QAction * )
3199 updateViewedCurves ();
3202void MainWindow::slotViewGroupGuidelines (
QAction * )
3209 if (m_actionViewGuidelinesHide->isChecked ()) {
3211 }
else if (m_actionViewGuidelinesEdit->isChecked ()) {
3223 m_cmdMediator->push (
cmd);
3226 handleGuidelineMode ();
3236 if (
action == m_actionStatusNever) {
3238 }
else if (
action == m_actionStatusTemporary) {
3245void MainWindow::slotViewToolBarBackground ()
3249 if (m_actionViewBackground->isChecked ()) {
3250 m_toolBackground->show();
3252 m_toolBackground->hide();
3256void MainWindow::slotViewToolBarChecklistGuide ()
3260 if (m_actionViewChecklistGuide->isChecked ()) {
3261 m_dockChecklistGuide->show();
3263 m_dockChecklistGuide->hide();
3267void MainWindow::slotViewToolBarCoordSystem ()
3271 if (m_actionViewCoordSystem->isChecked ()) {
3272 m_toolCoordSystem->show();
3274 m_toolCoordSystem->hide();
3278void MainWindow::slotViewToolBarDigitize ()
3282 if (m_actionViewDigitize->isChecked ()) {
3283 m_toolDigitize->show();
3285 m_toolDigitize->hide();
3289void MainWindow::slotViewToolBarFittingWindow()
3293 if (m_actionViewFittingWindow->isChecked()) {
3294 m_dockFittingWindow->show ();
3295 if (m_fittingCurve !=
nullptr) {
3296 m_fittingCurve->setVisible (
true);
3299 m_dockFittingWindow->hide ();
3300 if (m_fittingCurve !=
nullptr) {
3301 m_fittingCurve->setVisible (
false);
3306void MainWindow::slotViewToolBarGeometryWindow ()
3310 if (m_actionViewGeometryWindow->isChecked ()) {
3311 m_dockGeometryWindow->show();
3313 m_dockGeometryWindow->hide();
3317void MainWindow::slotViewToolBarSettingsViews ()
3321 if (m_actionViewSettingsViews->isChecked ()) {
3322 m_toolSettingsViews->show();
3324 m_toolSettingsViews->hide();
3328void MainWindow::slotViewToolTips ()
3335void MainWindow::slotViewZoom (
int zoom)
3341 m_zoomMapToAction [
zoomFactor]->setChecked (
true);
3350 m_backgroundStateContext->
fitInView (*m_view);
3364void MainWindow::slotViewZoomFactorInt (
int zoom)
3371void MainWindow::slotViewZoomIn ()
3377 m_view->transform ().m11 (),
3378 m_view->transform ().m22 (),
3379 m_actionZoomFill->isChecked ());
3384void MainWindow::slotViewZoomInFromWheelEvent ()
3392 m_view->setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
3397 m_view->setTransformationAnchor(QGraphicsView::NoAnchor);
3401void MainWindow::slotViewZoomOut ()
3408 m_view->transform ().m11 (),
3409 m_view->transform ().m22 (),
3410 m_actionZoomFill->isChecked ());
3414void MainWindow::slotViewZoomOutFromWheelEvent ()
3422 m_view->setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
3427 m_view->setTransformationAnchor(QGraphicsView::NoAnchor);
3455 filenameCsv =
"../test/drag_and_drop_http.csv_actual_1";
3461 .arg (exportRegressionFilenameFromInputFilename (
filenameDrop))
3466 file.open (QIODevice::WriteOnly);
3468 str <<
siz.width() <<
"x" <<
siz.height() <<
"\n";
3488 m_timerRegressionErrorReport =
new QTimer();
3489 m_timerRegressionErrorReport->setSingleShot(
false);
3495void MainWindow::startRegressionTestFileCmdScript()
3499 m_timerRegressionFileCmdScript =
new QTimer();
3500 m_timerRegressionFileCmdScript->setSingleShot(
false);
3508 return m_transformation;
3524 updateAfterCommandStatusBarCoords ();
3526 updateHighlightOpacity ();
3532 updateChecklistGuide ();
3533 updateFittingWindow ();
3534 updateGeometryWindow();
3539 writeCheckpointToLogFile ();
3546 m_view->setFocus ();
3549void MainWindow::updateAfterCommandStatusBarCoords ()
3560 updateTransformationAndItsDependencies();
3593 slotMouseMove (posScreen);
3603void MainWindow::updateChecklistGuide ()
3607 m_dockChecklistGuide->
update (*m_cmdMediator,
3608 m_isDocumentExported);
3611void MainWindow::updateControls ()
3614 <<
" selectedItems=" << m_scene->selectedItems().count();
3616 m_cmbBackground->setEnabled (!m_currentFile.isEmpty ());
3618 m_actionImportImageReplace->setEnabled (m_cmdMediator !=
nullptr);
3619#if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
3620 m_menuFileOpenRecent->setEnabled ((m_actionRecentFiles.count () > 0) &&
3621 (m_actionRecentFiles.at(0)->isVisible ()));
3623 m_actionClose->setEnabled (!m_currentFile.isEmpty ());
3624 m_actionSave->setEnabled (!m_currentFile.isEmpty ());
3625 m_actionSaveAs->setEnabled (!m_currentFile.isEmpty ());
3626 m_actionExport->setEnabled (!m_currentFile.isEmpty ());
3627 m_actionPrint->setEnabled (!m_currentFile.isEmpty ());
3629 if (m_cmdMediator ==
nullptr) {
3630 m_actionEditUndo->setEnabled (
false);
3631 m_actionEditRedo->setEnabled (
false);
3633 m_actionEditUndo->setEnabled (m_cmdMediator->canUndo ());
3634 m_actionEditRedo->setEnabled (m_cmdMediator->canRedo () || m_cmdStackShadow->
canRedo ());
3642 m_scene->selectedItems().count () > 0);
3646 m_actionEditPaste->setEnabled (m_digitizeStateContext->
canPaste (m_transformation,
3650 m_scene->selectedItems().count () > 0);
3653 m_actionDigitizeAxis->setEnabled (modeGraph ());
3654 m_actionDigitizeScale->setEnabled (
modeMap ());
3655 m_actionDigitizeCurve ->setEnabled (!m_currentFile.isEmpty ());
3656 m_actionDigitizePointMatch->setEnabled (!m_currentFile.isEmpty ());
3657 m_actionDigitizeColorPicker->setEnabled (!m_currentFile.isEmpty ());
3658 m_actionDigitizeSegment->setEnabled (!m_currentFile.isEmpty ());
3659 m_actionDigitizeSelect->setEnabled (!m_currentFile.isEmpty ());
3661 m_actionViewGridLines->setEnabled (
true);
3663 m_actionViewGridLines->setEnabled (
false);
3664 m_actionViewGridLines->setChecked (
false);
3666 m_actionViewBackground->setEnabled (!m_currentFile.isEmpty());
3667 m_actionViewChecklistGuide->setEnabled (!m_dockChecklistGuide->
browserIsEmpty());
3668 m_actionViewDigitize->setEnabled (!m_currentFile.isEmpty ());
3672 bool editable = (m_actionViewGuidelinesEdit->isChecked ());
3675 m_actionViewGuidelinesHide->setEnabled (
true);
3676 m_actionViewGuidelinesEdit->setEnabled (
selectable);
3677 m_actionViewGuidelinesLock->setEnabled (
true);
3688 m_btnGuidelineBottomCartesian->setEnabled (m_btnGuidelineBottomCartesian->isVisible() &&
selectable);
3689 m_btnGuidelineBottomPolar->setEnabled (m_btnGuidelineBottomPolar->isVisible() &&
selectable);
3690 m_btnGuidelineLeftCartesian->setEnabled (m_btnGuidelineLeftCartesian->isVisible() &&
selectable);
3691 m_btnGuidelineLeftPolar->setEnabled (m_btnGuidelineLeftPolar->isVisible() &&
selectable);
3692 m_btnGuidelineRightCartesian->setEnabled (m_btnGuidelineRightCartesian->isVisible() &&
selectable);
3693 m_btnGuidelineRightPolar->setEnabled (m_btnGuidelineRightPolar->isVisible() &&
selectable);
3694 m_btnGuidelineTopCartesian->setEnabled (m_btnGuidelineTopCartesian->isVisible() &&
selectable);
3695 m_btnGuidelineTopPolar->setEnabled (m_btnGuidelineTopPolar->isVisible() &&
selectable);
3699 m_actionViewGuidelinesHide->setEnabled (
false);
3700 m_actionViewGuidelinesEdit->setEnabled (
false);
3701 m_actionViewGuidelinesLock->setEnabled (
false);
3703 m_btnGuidelineBottomCartesian->setVisible (
false);
3704 m_btnGuidelineBottomPolar->setVisible (
false);
3705 m_btnGuidelineLeftCartesian->setVisible (
false);
3706 m_btnGuidelineLeftPolar->setVisible (
false);
3707 m_btnGuidelineRightCartesian->setVisible (
false);
3708 m_btnGuidelineRightPolar->setVisible (
false);
3709 m_btnGuidelineTopCartesian->setVisible (
false);
3710 m_btnGuidelineTopPolar->setVisible (
false);
3712 m_btnGuidelineBottomCartesian->setEnabled (
false);
3713 m_btnGuidelineBottomPolar->setEnabled (
false);
3714 m_btnGuidelineLeftCartesian->setEnabled (
false);
3715 m_btnGuidelineLeftPolar->setEnabled (
false);
3716 m_btnGuidelineRightCartesian->setEnabled (
false);
3717 m_btnGuidelineRightPolar->setEnabled (
false);
3718 m_btnGuidelineTopCartesian->setEnabled (
false);
3719 m_btnGuidelineTopPolar->setEnabled (
false);
3721 m_actionViewSettingsViews->setEnabled (!m_currentFile.isEmpty ());
3723 m_actionSettingsCoords->setEnabled (!m_currentFile.isEmpty ());
3724 m_actionSettingsCurveList->setEnabled (!m_currentFile.isEmpty ());
3725 m_actionSettingsCurveProperties->setEnabled (!m_currentFile.isEmpty ());
3726 m_actionSettingsDigitizeCurve->setEnabled (!m_currentFile.isEmpty ());
3727 m_actionSettingsExport->setEnabled (!m_currentFile.isEmpty ());
3728 m_actionSettingsColorFilter->setEnabled (!m_currentFile.isEmpty ());
3729 m_actionSettingsAxesChecker->setEnabled (!m_currentFile.isEmpty ());
3730 m_actionSettingsGridDisplay->setEnabled (!m_currentFile.isEmpty () && m_transformation.
transformIsDefined());
3731 m_actionSettingsGridRemoval->setEnabled (!m_currentFile.isEmpty ());
3732 m_actionSettingsPointMatch->setEnabled (!m_currentFile.isEmpty ());
3733 m_actionSettingsSegments->setEnabled (!m_currentFile.isEmpty ());
3734 m_actionSettingsGeneral->setEnabled (!m_currentFile.isEmpty ());
3736 m_groupBackground->setEnabled (!m_currentFile.isEmpty ());
3737 m_groupCurves->setEnabled (!m_currentFile.isEmpty ());
3739 m_groupZoom->setEnabled (!m_currentFile.isEmpty ());
3741 m_actionZoomIn->setEnabled (!m_currentFile.isEmpty ());
3742 m_actionZoomOut->setEnabled (!m_currentFile.isEmpty ());
3750 if ((
CoordSystemIndex) m_cmbCoordSystem->currentIndex() != coordSystemIndex) {
3751 m_cmbCoordSystem->setCurrentIndex (coordSystemIndex);
3757 loadCurveListFromCmdMediator ();
3759 updateTransformationAndItsDependencies();
3761 loadGuidelinesFromCmdMediator();
3776 m_actionDigitizeAxis->setChecked(
true);
3781 m_actionDigitizeColorPicker->setChecked(
true);
3782 slotDigitizeColorPicker();
3786 m_actionDigitizeCurve->setChecked(
true);
3787 slotDigitizeCurve();
3794 m_actionDigitizePointMatch->setChecked(
true);
3795 slotDigitizePointMatch();
3799 m_actionDigitizeScale->setChecked(
true);
3800 slotDigitizeScale();
3804 m_actionDigitizeSegment->setChecked(
true);
3805 slotDigitizeSegment();
3809 m_actionDigitizeSelect->setChecked(
true);
3810 slotDigitizeSelect();
3819void MainWindow::updateFittingWindow ()
3823 if (m_cmdMediator !=
nullptr &&
3824 m_cmbCurve !=
nullptr) {
3827 m_dockFittingWindow->
update (*m_cmdMediator,
3829 m_cmbCurve->currentText (),
3834void MainWindow::updateGeometryWindow ()
3838 if (m_cmdMediator !=
nullptr &&
3839 m_cmbCurve !=
nullptr) {
3842 m_dockGeometryWindow->
update (*m_cmdMediator,
3844 m_cmbCurve->currentText (),
3857void MainWindow::updateGridLines ()
3862 m_gridLines.
clear ();
3873 m_gridLines.
setVisible (m_actionViewGridLines->isChecked());
3876void MainWindow::updateHighlightOpacity ()
3878 if (m_cmdMediator !=
nullptr) {
3884 m_dockGeometryWindow,
3889void MainWindow::updateRecentFileList()
3893#if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
3909 m_actionRecentFiles.at (
i)->setVisible (
true);
3914 m_actionRecentFiles.at (
i)->setVisible (
false);
3929 m_cmbCurve->currentText());
3935 m_cmbCurve->currentText());
3948 m_cmbCurve->currentText());
3965 loadCurveListFromCmdMediator();
3984 modelDigitizeCurve);
4016void MainWindow::updateSettingsMainWindow()
4023 m_actionZoomIn->setShortcut (
tr (
""));
4024 m_actionZoomOut->setShortcut (
tr (
""));
4028 m_actionZoomIn->setShortcut (
tr (
"+"));
4029 m_actionZoomOut->setShortcut (
tr (
"-"));
4033 if ((m_scene !=
nullptr) &&
4034 (m_cmdMediator !=
nullptr)) {
4038 updateHighlightOpacity();
4039 updateWindowTitle();
4040 updateFittingWindow();
4041 updateGeometryWindow();
4068void MainWindow::updateSmallDialogs ()
4085void MainWindow::updateTransformationAndItsDependencies()
4087 m_transformation.
update (!m_currentFile.isEmpty (),
4096 m_cmbCurve->currentText ());
4105void MainWindow::updateViewedCurves ()
4109 if (m_actionViewCurvesAll->isChecked ()) {
4113 }
else if (m_actionViewCurvesSelected->isChecked ()) {
4117 }
else if (m_actionViewCurvesNone->isChecked ()) {
4138 if (activeCurve.isEmpty ()) {
4151 m_cmdMediator->
pixmap ());
4156void MainWindow::updateWindowTitle ()
4163 .arg (
tr (
"Engauge Digitizer"))
4167 if (!m_currentFileWithPathAndFileExtension.isEmpty()) {
4207void MainWindow::writeCheckpointToLogFile ()
4225 <<
"--------------DOCUMENT CHECKPOINT START----------" <<
"\n"
4227 <<
"---------------DOCUMENT CHECKPOINT END-----------" <<
"\n"
4228 <<
"----------------SCENE CHECKPOINT START-----------" <<
"\n"
4230 <<
"-----------------SCENE CHECKPOINT END------------" ;
BackgroundImage
Background selection.
@ BACKGROUND_IMAGE_ORIGINAL
@ BACKGROUND_IMAGE_FILTERED
unsigned int CoordSystemIndex
Zero-based index for identifying CoordSystem instantiations.
DigitizeState
Set of possible states of Digitize toolbar.
@ DIGITIZE_STATE_POINT_MATCH
@ DIGITIZE_STATE_COLOR_PICKER
const int INNER_RADIUS_MIN
@ DOCUMENT_AXES_POINTS_REQUIRED_2
const QString DOCUMENT_SERIALIZE_ERROR
const QString DOCUMENT_SERIALIZE_APPLICATION
const QString DOCUMENT_SERIALIZE_ERROR_CONTEXT
const QString DOCUMENT_SERIALIZE_OPERATING_SYSTEM_WORD_SIZE
const QString DOCUMENT_SERIALIZE_FILE
const QString DOCUMENT_SERIALIZE_ERROR_COMMENT
const QString DOCUMENT_SERIALIZE_IMAGE
const QString DOCUMENT_SERIALIZE_IMAGE_HEIGHT
const QString DOCUMENT_SERIALIZE_ERROR_LINE
const QString DOCUMENT_SERIALIZE_IMAGE_WIDTH
const QString DOCUMENT_SERIALIZE_ERROR_FILE
const QString DOCUMENT_SERIALIZE_DOCUMENT
const QString DOCUMENT_SERIALIZE_OPERATING_SYSTEM_ENDIAN
const QString DOCUMENT_SERIALIZE_APPLICATION_VERSION_NUMBER
const QString DOCUMENT_SERIALIZE_FILE_IMPORTED
const QString DOCUMENT_SERIALIZE_OPERATING_SYSTEM
const QString DOCUMENT_SERIALIZE_ERROR_REPORT
const QString DOCUMENT_SERIALIZE_BOOL_TRUE
const QString DOCUMENT_SERIALIZE_BOOL_FALSE
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT.
#define ENGAUGE_CHECK_PTR(ptr)
Drop in replacement for Q_CHECK_PTR.
QString EndianToString(QSysInfo::Endian endian)
QVector< double > FittingCurveCoefficients
Coefficients x0, x1, ... in y = a0 + a1 * x + a2 * x^2 + ...
const double DEFAULT_HIGHLIGHT_OPACITY
const int DEFAULT_MAXIMUM_GRID_LINES
Default for maximum number of grid lines.
GuidelineState
Set of possible Guideline states. See class Guideline for more information.
GuidelineViewState
Set of possible Guideline view states.
@ GUIDELINE_VIEW_STATE_HIDE
@ GUIDELINE_VIEW_STATE_EDIT
@ NUM_GUIDELINE_VIEW_STATES
@ GUIDELINE_VIEW_STATE_LOCK
const ImportCropping DEFAULT_IMPORT_CROPPING
log4cpp::Category * mainCat
const QString INDENTATION_PAST_TIMESTAMP
MainTitleBarFormat
Format format in MainWindow title bar.
@ MAIN_TITLE_BAR_FORMAT_NO_PATH
@ MAIN_TITLE_BAR_FORMAT_PATH
Filename without path.
const bool DEFAULT_SMALL_DIALOGS
const int DEFAULT_MAXIMUM_EXPORTED_POINTS_PER_CURVE
const bool DEFAULT_IMAGE_REPLACE_RENAMES_DOCUMENT
const int DEFAULT_SIGNIFICANT_DIGITS
const bool DEFAULT_DRAG_DROP_EXPORT
const int REGRESSION_INTERVAL
const unsigned int MAX_RECENT_FILE_LIST_SIZE
const QString ENGAUGE_FILENAME_EXTENSION("dig")
const QString EMPTY_FILENAME("")
const unsigned int MAX_RECENT_FILE_LIST_SIZE
NonPdfReturn
Return values from load operation.
@ NON_PDF_RETURN_CANCELED
int DEFAULT_IMPORT_PDF_RESOLUTION
PdfReturn
Return values from load operation.
const QString SETTINGS_ZOOM_FACTOR
const QString SETTINGS_SMALL_DIALOGS
const QString SETTINGS_IMPORT_PDF_RESOLUTION
const QString SETTINGS_ENGAUGE
const QString SETTINGS_CHECKLIST_GUIDE_DOCK_AREA
const QString SETTINGS_FITTING_WINDOW_DOCK_AREA
const QString SETTINGS_MAIN_TITLE_BAR_FORMAT
const QString SETTINGS_MAIN_DIRECTORY_EXPORT_SAVE
const QString SETTINGS_MAXIMUM_GRID_LINES
const QString SETTINGS_IMAGE_REPLACE_RENAMES_DOCUMENT
const QString SETTINGS_MAIN_DIRECTORY_IMPORT_LOAD
const QString SETTINGS_GROUP_ENVIRONMENT
const QString SETTINGS_HELP_SIZE
const QString SETTINGS_HIGHLIGHT_OPACITY
const QString SETTINGS_CHECKLIST_GUIDE_DOCK_GEOMETRY
const QString SETTINGS_LOCALE_LANGUAGE
const QString SETTINGS_SIZE
const QString SETTINGS_IMPORT_CROPPING
const QString SETTINGS_RECENT_FILE_LIST
const QString SETTINGS_HELP_POS
const QString SETTINGS_VIEW_COORD_SYSTEM_TOOLBAR
const QString SETTINGS_VIEW_DIGITIZE_TOOLBAR
const QString SETTINGS_ZOOM_FACTOR_INITIAL
const QString SETTINGS_SIGNIFICANT_DIGITS
const QString SETTINGS_VIEW_BACKGROUND_TOOLBAR
const QString SETTINGS_VIEW_SETTINGS_VIEWS_TOOLBAR
const QString SETTINGS_MAXIMUM_EXPORTED_POINTS_PER_CURVE
const QString SETTINGS_CHECKLIST_GUIDE_WIZARD
const QString SETTINGS_DRAG_DROP_EXPORT
const QString SETTINGS_VIEW_STATUS_BAR
const QString SETTINGS_ZOOM_CONTROL
const QString SETTINGS_GROUP_MAIN_WINDOW
const QString SETTINGS_VIEW_TOOL_TIPS
const QString SETTINGS_BACKGROUND_IMAGE
const QString SETTINGS_GEOMETRY_WINDOW_DOCK_GEOMETRY
const QString SETTINGS_POS
const QString SETTINGS_DIGITIZER
const QString SETTINGS_CURRENT_DIRECTORY
const QString SETTINGS_FITTING_WINDOW_DOCK_GEOMETRY
const QString SETTINGS_LOCALE_COUNTRY
const QString SETTINGS_GEOMETRY_WINDOW_DOCK_AREA
@ STATUS_BAR_MODE_TEMPORARY
QString engaugeWindowTitle()
Text for title bars of dialogs.
const char * VERSION_NUMBER
@ ZOOM_CONTROL_MENU_WHEEL_PLUSMINUS
@ ZOOM_CONTROL_MENU_WHEEL
const ZoomFactorInitial DEFAULT_ZOOM_FACTOR_INITIAL
ZoomFactor
Zoom factors ordered by zoom level so next one above/below is the next zoom level.
void setPixmap(bool isGnuplot, const Transformation &transformation, const DocumentModelGridRemoval &modelGridRemoval, const DocumentModelColorFilter &modelColorFilter, const QPixmap &pixmapOriginal, const QString &curveSelected)
Update the images of all states, rather than just the current state.
void setBackgroundImage(BackgroundImage backgroundImage)
Transition to the specified state. This method is used by classes outside of the state machine to tri...
QImage imageForCurveState() const
Image for the Curve state, even if the current state is different.
void fitInView(GraphicsView &view)
Zoom so background fills the window.
void updateColorFilter(bool isGnuplot, const Transformation &transformation, const DocumentModelGridRemoval &modelGridRemoval, const DocumentModelColorFilter &colorFilter, const QString &curveSelected)
Apply color filter settings.
void close()
Open Document is being closed so remove the background.
void setCurveSelected(bool isGnuplot, const Transformation &transformation, const DocumentModelGridRemoval &modelGridRemoval, const DocumentModelColorFilter &modelColorFilter, const QString &curveSelected)
Update the selected curve.
Wizard for setting up the checklist guide.
bool browserIsEmpty() const
When browser is empty, it is pointless to show it.
void setTemplateHtml(const QString &html, const QStringList &curveNames)
Populate the browser with template html.
void update(const CmdMediator &cmdMediator, bool documentIsExported)
Update using current CmdMediator/Document state.
Wrapper around QUndoCommand. This simplifies the more complicated feature set of QUndoCommand.
Command for adding one or more graph points. This is for Segment Fill mode.
Command for copying all selected Points to the clipboard.
Command for cutting all selected Points.
Command for deleting all selected Points.
Command for adding one X/T Guideline value.
Command for adding one Y/R Guideline value.
Command for changing the View / Guidelines state.
Command for changing the currently selected CoordSystem.
bool canRedo() const
Return true if there is a command available.
void slotRedo()
Move next command from list to CmdMediator. Noop if there are no more commands.
void loadCommands(MainWindow &mainWindow, Document &document, QXmlStreamReader &reader)
Load commands from serialized xml.
Color filter parameters for one curve. For a class, this is handled the same as LineStyle and PointSt...
Facade class that wraps around all of the create classes for MainWindow.
void create(MainWindow &mw)
Create QAction facade.
PointStyle pointStyle() const
Get method for PointStyle.
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
CurveStyle curveStyle(const QString &curveName) const
CurveStyle in specified curve.
Container for all graph curves. The axes point curve is external to this class.
void resetOnLoad(CmdMediator *cmdMediator)
Resetting makes re-initializes for documents after the first.
void handleMouseRelease(CmdMediator *cmdMediator, QPointF pos)
See DigitizeStateAbstractBase::handleMouseRelease.
bool canPaste(const Transformation &transformation, const QSize &viewSize) const
Return true if there is good data in the clipboard for pasting, and that operation is compatible with...
void handleMouseMove(CmdMediator *cmdMediator, QPointF pos)
See DigitizeStateAbstractBase::handleMouseMove.
void requestImmediateStateTransition(CmdMediator *cmdMediator, DigitizeState digitizeState)
Perform immediate state transition. Called from outside state machine.
void updateModelDigitizeCurve(CmdMediator *cmdMediator, const DocumentModelDigitizeCurve &modelDigitizeCurve)
Update the digitize curve settings.
void handleContextMenuEventGraph(CmdMediator *cmdMediator, const QStringList &pointIdentifiers)
See DigitizeStateAbstractBase::handleContextMenuEventGraph.
void handleMousePress(CmdMediator *cmdMediator, QPointF pos)
See DigitizeStateAbstractBase::handleMousePress.
void appendNewCmd(CmdMediator *cmdMediator, QUndoCommand *cmd)
Append just-created QUndoCommand to command stack. This is called from DigitizeStateAbstractBase subc...
void setImageIsLoaded(CmdMediator *cmdMediator, bool imageIsLoaded)
Set the image so QGraphicsView cursor and drag mode are accessible.
QString activeCurve() const
Curve name for active Curve. This can include AXIS_CURVE_NAME, and empty string.
void handleKeyPress(CmdMediator *cmdMediator, Qt::Key key, bool atLeastOneSelectedItem)
See DigitizeStateAbstractBase::handleKeyPress.
void updateModelSegments(const DocumentModelSegments &modelSegments)
Update the segments given the new settings.
bool guidelinesAreSelectable() const
Enable/disable guidelines according to state.
void updateAfterPointAddition()
Update the graphics attributes.
void handleCurveChange(CmdMediator *cmdMediator)
See DigitizeStateAbstractBase::handleCurveChange.
void handleContextMenuEventAxis(CmdMediator *cmdMediator, const QString &pointIdentifier)
See DigitizeStateAbstractBase::handleContextMenuEventAxis.
About Engauge dialog. This provides a hidden shortcut for triggering ENGAUGE_ASSERT.
Dialog for saving error report for later transmission to the developers.
Dialog for setting the advanced parameters in a newly imported Document.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
void load(CmdMediator &cmdMediator)
Load settings from Document.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
void setCurveName(const QString &curveName)
Load information for the specified curve name. When called externally, the load method must have been...
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
void loadMainWindowModel(CmdMediator &cmdMediator, const MainWindowModel &modelMainWindow)
Replaced load method since the main window settings are independent of document, unlike other DlgSett...
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
Model for DlgSettingsAxesChecker and CmdSettingsAxesChecker.
Model for DlgSettingsColorFilter and CmdSettingsColorFilter.
const ColorFilterSettings colorFilterSettings(const QString &curveName) const
Get method for copying one color filter. Cannot return just a reference or else there is a warning ab...
Model for DlgSettingsCoords and CmdSettingsCoords.
CoordsType coordsType() const
Get method for coordinates type.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
Model for DlgSettingsGeneral and CmdSettingsGeneral.
Model for DlgSettingsGridDisplay and CmdSettingsGridDisplay.
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval. The settings are unstable until the user...
Model for DlgSettingsPointMatch and CmdSettingsPointMatch.
Model for DlgSettingsSegments and CmdSettingsSegments.
void check(MainWindow &mainWindow, const Document &document) const
Check document state.
unsigned int coordSystemCount() const
Number of CoordSystem.
void setModelGridRemoval(const DocumentModelGridRemoval &modelGridRemoval)
Set method for DocumentModelGridRemoval.
void setCoordSystemIndex(CoordSystemIndex coordSystemIndex)
Set the index of current active CoordSystem.
void setModelGuidelines(const DocumentModelGuidelines &modelGuidelines)
Set method for DocumentModelGuidelines.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
CoordSystemIndex coordSystemIndex() const
Index of current active CoordSystem.
QStringList curvesGraphsNames() const
See CurvesGraphs::curvesGraphsNames.
void setModelPointMatch(const DocumentModelPointMatch &modelPointMatch)
Set method for DocumentModelPointMatch.
void setModelCurveStyles(const CurveStyles &modelCurveStyles)
Set method for CurveStyles.
void setModelGridDisplay(const DocumentModelGridDisplay &modelGridDisplay)
Set method for DocumentModelGridDisplay.
void addCoordSystems(unsigned int numberCoordSystemToAdd)
Add some number (0 or more) of additional coordinate systems.
void setModelColorFilter(const DocumentModelColorFilter &modelColorFilter)
Set method for DocumentModelColorFilter.
void setModelDigitizeCurve(const DocumentModelDigitizeCurve &modelDigitizeCurve)
Set method for DocumentModelDigitizeCurve.
void saveXml(QXmlStreamWriter &writer) const
Save document to xml.
DocumentModelAxesChecker modelAxesChecker() const
Get method for DocumentModelAxesChecker.
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
DocumentModelColorFilter modelColorFilter() const
Get method for DocumentModelColorFilter.
void setCurvesGraphs(const CurvesGraphs &curvesGraphs)
Let CmdAbstract classes overwrite CurvesGraphs.
CurveStyles modelCurveStyles() const
Get method for CurveStyles.
void setModelCoords(const DocumentModelCoords &modelCoords)
Set method for DocumentModelCoords.
void setModelAxesChecker(const DocumentModelAxesChecker &modelAxesChecker)
Set method for DocumentModelAxesChecker.
DocumentAxesPointsRequired documentAxesPointsRequired() const
Get method for DocumentAxesPointsRequired.
void setModelSegments(const DocumentModelSegments &modelSegments)
Set method for DocumentModelSegments.
DocumentModelGuidelines modelGuidelines() const
Get method for DocumentModelGuidelines.
void setModelGeneral(const DocumentModelGeneral &modelGeneral)
Set method for DocumentModelGeneral.
void setModelExport(const DocumentModelExportFormat &modelExport)
Set method for DocumentModelExportFormat.
DocumentModelGridRemoval modelGridRemoval() const
Get method for DocumentModelGridRemoval.
DocumentModelGridDisplay modelGridDisplay() const
Get method for DocumentModelGridDisplay.
DocumentModelExportFormat modelExport() const
Get method for DocumentModelExportFormat.
void setPixmap(const QImage &image)
Set method for the background pixmap.
Utility class for adjusting export settings given filename extension.
Class for exporting during regression, when the Transformation has not yet been defined.
Strategy class for exporting to a file. This strategy is external to the Document class so that class...
File that manages a command stack for regression testing of file import/open/export/close.
bool canRedo() const
Returns true if there is at least one command on the stack.
void redo(MainWindow &mainWindow)
Apply the next command. Requires non-empty stack.
Curve that overlays the current scene so the regression-fitted curve is visible.
virtual void clear()
Clear stale information.
virtual void doCopy()
Copy the current selection to the clipboard.
virtual void update(const CmdMediator &cmdMediator, const MainWindowModel &modelMainWindow, const QString &curveSelected, const Transformation &transformation)
Populate the table with the specified Curve.
virtual void update(const CmdMediator &cmdMediator, const MainWindowModel &modelMainWindow, const QString &curveSelected, const Transformation &transformation)
Populate the table with the specified Curve.
virtual void clear()
Clear stale information.
virtual void doCopy()
Copy the current selection to the clipboard.
Class for showing points and lines for all coordinate systems simultaneously, even though the code no...
unsigned int coordSystemIndexToBeRestored() const
Coordinate system index that was active before the ghosts.
void createGhosts(QGraphicsScene &scene)
Create ghosts from the path/rect/polygon lists.
void captureGraphicsItems(QGraphicsScene &scene)
Take a snapshot of the graphics items.
void destroyGhosts(QGraphicsScene &scene)
Destory ghosts. Called at end of algorithm.
Add point and line handling to generic QGraphicsScene.
void updateGraphicsLinesToMatchGraphicsPoints(const CurveStyles &modelCurveStyles, const Transformation &transformation)
A mouse move has just occurred so move the selected points, since they were dragged.
void resetOnLoad()
Reset, when loading a document after the first, to same state that first document was at when loaded.
void updateAfterCommand(CmdMediator &cmdMediator, double highlightOpacity, GeometryWindow *geometryWindow, const Transformation &transformation)
Update the Points and their Curves after executing a command.
void showCurves(bool show, bool showAll=false, const QString &curveName="")
Show or hide all Curves (if showAll is true) or just the selected Curve (if showAll is false);.
void resetPositionHasChangedFlags()
Reset positionHasChanged flag for all items. Typically this is done as part of mousePressEvent.
void printStream(QString indentation, QTextStream &str)
Debugging method that supports print method of this class and printStream method of some other class(...
void updateCurveStyles(const CurveStyles &modelCurveStyles)
Update curve styles after settings changed.
QGraphicsView class with event handling added. Typically the events are sent to the active digitizing...
Factory class for generating the points, composed of QGraphicsItem objects, along a GridLine.
void setVisible(bool visible)
Make all grid lines visible or hidden.
void clear()
Deallocate and remove all grid lines.
Determine if inputs that were collected after a Guideline drag should result in a Cmd to move or Cmd ...
Calculate offset from edge for new Guidelines.
QPointF top(const QGraphicsView &view, const Transformation &transformation) const
Compute offset from top side and returns point in graph coordinates.
QPointF right(const QGraphicsView &view, const Transformation &transformation) const
Compute offset from right side and returns point in graph coordinates.
QPointF bottom(const QGraphicsView &view, const Transformation &transformation) const
Compute offset from bottom side and returns point in graph coordinates.
QPointF left(const QGraphicsView &view, const Transformation &transformation) const
Compute offset from left side and returns point in graph coordinates.
GuidelineViewState state() const
Current state for serializing.
void handleStateChange(GuidelineViewState state)
Handle user or code generated change in selected guideline view mode.
This class contains all Guideline objects.
void createGuidelineY(const QString &identifier, double y)
Factory method for creating a new GUIDELINE_STATE_DEPLOYED_CONSTANT_Y_ACTIVE.
void createGuidelineR(const QString &identifier, double r)
Factory method for creating a new GUIDELINE_STATE_DEPLOYED_CONSTANT_R_ACTIVE.
void createReplacementGuideline(const QString &identifierReplaced, double newValue, GuidelineState guidelineStateForReplacement)
Factory method for creating a new replacement Guideline, which replaces one handle and one visible Gu...
void setModelGuidelines(CoordsType coordsType, const DocumentModelGuidelines &modelGuidelines)
Load Guidelines from Document.
void clear()
Remove guidelines since the current Document is about to be closed.
void createGuidelineT(const QString &identifier, double t)
Factory method for creating a new GUIDELINE_STATE_DEPLOYED_CONSTANT_T_ACTIVE.
void moveGuidelineYR(const QString &identifier, double valueAfter)
Move an Y/R guideline from one value to another. Closest value wins.
void handleGuidelineMode(bool visible, bool locked)
User toggled guideline mode.
void removeGuideline(const QString &identifier)
Remove an X/T or Y/R guideline.
DocumentModelGuidelines modelGuidelines() const
Return complete set of guidelines information for Document.
void updateWithLatestTransformation()
Update transformation. This is called after a command has been executed.
void moveGuidelineXT(const QString &identifier, double valueAfter)
Move an X/T guideline from one value to another. Closest value wins.
void initialize(GraphicsScene &scene)
Initialize Guideline factory.
void createGuidelineX(const QString &identifier, double x)
Factory method for creating a new GUIDELINE_STATE_DEPLOYED_CONSTANT_X_ACTIVE.
void handleActiveChange(bool active)
DigitizeState change so active status may (or may not) be toggled.
void updateColor()
Force a color update.
Provides list of file extensions for import.
QStringList fileExtensionsWithAsterisks() const
File extensions for use in file dialogs.
Wrapper around OpenJPEG library, in C, for opening jpeg2000 files.
bool load(const QString &filename, QImage &image) const
Load image from jpeg2000 file.
Returns information about files.
void startLoadImage(const QUrl &url)
Start the asynchronous loading of an image from the specified url.
static void bindToMainWindow(MainWindow *mainWindow)
Bind to MainWindow so this class can access the command stack.
Persist the directory between successive Import/Open operations, or successive Export/Save operations...
void setDirectoryExportSaveFromSavedPath(const QString &path)
Set the current Export/Save directory at startup to path from previous execution.
void setDirectoryExportSaveFromFilename(const QString &fileName)
Save the current Export/Save directory, after user has accepted the Export/Save dialog.
Model for DlgSettingsMainWindow.
void setSmallDialogs(bool smallDialogs)
Set method for small dialogs flag.
QLocale locale() const
Get method for locale.
void setImageReplaceRenamesDocument(bool imageReplaceRenamesDocument)
Set method for image replace renames document.
bool dragDropExport() const
Get method for drag and drop export.
bool imageReplaceRenamesDocument() const
Get method for image replaces renames document.
ZoomFactorInitial zoomFactorInitial() const
Get method for initial zoom factor.
void setImportCropping(ImportCropping importCropping)
Set method for import cropping.
void setMaximumExportedPointsPerCurve(int maximumExportedPointsPerCurve)
Set method for maximum number of exported points per curve.
ImportCropping importCropping() const
Get method for import cropping.
bool smallDialogs() const
Get method for small dialogs flag.
void setMainTitleBarFormat(MainTitleBarFormat mainTitleBarFormat)
Set method for MainWindow titlebar filename format.
void setDragDropExport(bool dragDropExport)
Set method for drag and drop export.
double highlightOpacity() const
Get method for highlight opacity.
void setZoomControl(ZoomControl zoomControl)
Set method for zoom control.
void setMaximumGridLines(int maximumGridLines)
Set method for maximum number of grid lines.
ZoomControl zoomControl() const
Get method for zoom control.
void setPdfResolution(int resolution)
Set method for resolution of imported PDF files, in dots per inch.
int maximumGridLines() const
Get method for maximum number of grid lines.
void setZoomFactorInitial(ZoomFactorInitial zoomFactorInitial)
Set method for initial zoom factor.
MainTitleBarFormat mainTitleBarFormat() const
Get method for MainWindow titlebar filename format.
void setHighlightOpacity(double highlightOpacity)
Set method for highlight opacity.
int maximumExportedPointsPerCurve() const
Get method for maximum number of exported points per curve.
void setLocale(QLocale::Language language, QLocale::Country country)
Set method for locale given attributes.
int pdfResolution() const
Get method for resolution of imported PDF files, in dots per inch.
void setSignificantDigits(int significantDigits)
Set method for significant digits.
void saveErrorReportFileAndExit(const char *comment, const char *file, int line, const char *context)
Save error report and exit.
void updateSettingsGridRemoval(const DocumentModelGridRemoval &modelGridRemoval)
Update with new grid removal properties.
void showTemporaryMessage(const QString &temporaryMessage)
Show temporary message in status bar.
CmdMediator * cmdMediator()
Accessor for commands to process the Document.
void sendGong()
Send signal to unit test framework indicating all commands have finished executing.
void guidelineRemove(const QString &identifier)
Remove a X/T or Y/R Guideline.
void updateSettingsGridDisplay(const DocumentModelGridDisplay &modelGridDisplay)
Update with new grid display properties.
virtual bool eventFilter(QObject *, QEvent *)
Catch secret keypresses.
void updateSettingsAxesChecker(const DocumentModelAxesChecker &modelAxesChecker)
Update with new axes indicator properties.
virtual void showEvent(QShowEvent *)
Processing performed after gui becomes available.
void updateSettingsDigitizeCurve(const DocumentModelDigitizeCurve &modelDigitizeCurve)
Update with new curve digitization styles.
bool isGnuplot() const
Get method for gnuplot flag.
void guidelineViewState(GuidelineViewState state) const
Guideline view state in View menu.
void updateSettingsCurveStyles(const CurveStyles &modelCurveStyles)
Update with new curve styles.
bool transformIsDefined() const
Return true if all three axis points have been defined.
MainWindowModel modelMainWindow() const
Get method for main window model.
bool guidelinesAreVisible() const
True/false if guidelines are visible. Selectability is handled elsewhere.
void cmdFileOpen(const QString &fileName)
Open file. This is called from a file script command.
void updateSettingsCurveList(const CurvesGraphs &curvesGraphs)
Update with new curves.
void updateAfterCommand()
See GraphicsScene::updateAfterCommand.
void updateSettingsExportFormat(const DocumentModelExportFormat &modelExport)
Update with new export properties.
void guidelineMoveXT(const QString &identifier, double xTAfter)
Move a X/T Guideline.
void updateSettingsSegments(const DocumentModelSegments &modelSegments)
Update with new segments properties.
BackgroundImage selectOriginal(BackgroundImage backgroundImage)
Make original background visible, for DigitizeStateColorPicker.
void cmdFileExport(const QString &fileName)
Export file. This is called from a file script command.
void updateViewsOfSettings(const QString &activeCurve)
Update curve-specific view of settings. Private version gets active curve name from DigitizeStateCont...
void updateSettingsMainWindow(const MainWindowModel &modelMainWindow)
Update with new main window properties.
void cmdFileClose()
Close file. This is called from a file script command.
void updateDigitizeStateIfSoftwareTriggered(DigitizeState digitizeState)
After software-triggered state transition, this method manually triggers the action as if user had cl...
bool modeMap() const
True if document scale is set using a scale bar, otherwise using axis points.
void guidelineAddYR(const QString &identifier, double yR)
Add a Y/R Guideline.
void signalDropRegression(QString)
Send drag and drop regression test url.
void updateSettingsGeneral(const DocumentModelGeneral &modelGeneral)
Update with new general properties.
void signalZoom(int)
Send zoom selection, picked from menu or keystroke, to StatusBar.
void guidelineMoveYR(const QString &identifier, double yRAfter)
Move a Y/R Guideline.
void updateSettingsPointMatch(const DocumentModelPointMatch &modelPointMatch)
Update with new point match properties.
MainWindow(const QString &errorReportFile, const QString &fileCmdScriptFile, bool isDropRegression, bool isRegressionTest, bool isGnuplot, bool isReset, bool isExportOnly, bool isExtractImageOnly, const QString &extractImageOnlyExtension, const QStringList &loadStartupFiles, const QStringList &commandLineWithoutLoadStartupFiles, QWidget *parent=nullptr)
Single constructor.
void cmdFileImport(const QString &fileName)
Import file. This is called from a file script command.
void updateGraphicsLinesToMatchGraphicsPoints()
Update the graphics lines so they follow the graphics points, after a drag, addition,...
void handleGuidelinesActiveChange(bool active)
Handle Guidelines active status toggle.
void signalGong()
Send wakeup signal to unit test framework when all other commands have finished executing.
QImage imageFiltered() const
Background image that has been filtered for the current curve. This asserts if a curve-specific image...
QString selectedGraphCurve() const
Curve name that is currently selected in m_cmbCurve.
GraphicsScene & scene()
Scene container for the QImage and QGraphicsItems.
void updateAfterMouseRelease()
Call MainWindow::updateControls (which is private) after the very specific case - a mouse press/relea...
void resizeEvent(QResizeEvent *event)
Intercept resize event so graphics scene can be appropriately resized when in Fill mode.
void guidelineAddXT(const QString &identifier, double xT)
Add a X/T Guideline.
Transformation transformation() const
Return read-only copy of transformation.
void updateSettingsColorFilter(const DocumentModelColorFilter &modelColorFilter)
Update with new color filter properties.
void updateCoordSystem(CoordSystemIndex coordSystemIndex)
Select a different CoordSystem.
void updateSettingsCoords(const DocumentModelCoords &modelCoords)
Update with new coordinate properties.
GraphicsView & view()
View for the QImage and QGraphicsItems, without const.
Import of point data from clipboard.
void retrievePoints(const Transformation &transformation, QList< QPoint > &points, QList< double > &ordinals) const
Retrieve points from clipboard.
Wrapper around the QImage class for read and importing non-PDF files.
NonPdfReturn load(const QString &fileName, QImage &image, ImportCropping importCropping, bool isErrorReportRegressionTest) const
Try to load the specified file. Success is indicated in the function return value.
Wrapper around the Poppler library.
PdfReturn load(const QString &fileName, QImage &image, int resolution, ImportCropping importCropping, bool isErrorReportRegressionTest) const
Try to load the specified file. Success is indicated in the function return value.
Details for a specific Point.
static void setIdentifierIndex(unsigned int identifierIndex)
Reset the current index while performing a Redo.
Given a set of point identifiers, if a map is in effect (with its two axis endpoints) then both axis ...
void wakeUp()
Enable all widgets in the status bar. This is called just after a Document becomes active.
void setStatusBarMode(StatusBarMode statusBarMode)
Set the status bar visibility mode.
StatusBarMode statusBarMode() const
Current mode for status bar visibility. This is tracked locally so this class knows when to hide/show...
void showTemporaryMessage(const QString &message)
Show temporary message in status bar. After a short interval the message will disappear.
void setCoordinates(const QString &coordsScreen, const QString &coordsGraph, const QString &resolutionGraph)
Populate the coordinates fields. Unavailable values are empty. Html-encoding to highlight with colors...
void triggerStateTransition(bool isGnuplot, TransformationState transformationState, CmdMediator &cmdMediator, const Transformation &transformation, const QString &selectedGraphCurve)
Trigger a state transition to be performed immediately.
void resetOnLoad()
Reset, when loading a document after the first, to same state that first document was at when loaded.
void updateAxesChecker(CmdMediator &cmdMediator, const Transformation &transformation)
Apply the new DocumentModelAxesChecker.
void unsetPointStyle()
Apply no PointStyle.
void setPointStyle(const PointStyle &pointStyle)
Apply the PointStyle of the currently selected curve.
void setEnabled(bool enabled)
Show the style with semi-transparency or full-transparency to indicate if associated Curve is active ...
void unsetColorFilterSettings()
Apply no color filter.
void setColorFilterSettings(const ColorFilterSettings &colorFilterSettings, const QPixmap &pixmap)
Apply the color filter of the currently selected curve. The pixmap is included so the background colo...
void setEnabled(bool enabled)
Show the style with semi-transparency or full-transparency to indicate if associated Curve is active ...
void getTableStatus(bool &tableIsActive, bool &tableIsCopyable) const
Give table status so MainWindow can determine if table can be copied.
Perform calculations to determine the next zoom setting given the current zoom setting,...
double mapToFactor(ZoomFactor zoomFactor) const
Return the floating precision zoom factor given the enum value.
ZoomFactor zoomOut(ZoomFactor currentZoomFactor, double m11, double m22, bool actionZoomFillIsChecked) const
Zoom out.
ZoomFactor zoomIn(ZoomFactor currentZoomFactor, double m11, double m22, bool actionZoomFillIsChecked) const
Zoom in.
Priority::Value getPriority() const
Returns unused priority.
#define LOG4CPP_INFO_S(logger)
#define LOG4CPP_DEBUG_S(logger)
#define LOG4CPP_ERROR_S(logger)