Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Functions
geometrize::common::ui Namespace Reference

Functions

const QScreen * getFirstScreenContainingCursor ()
 
void centerWidgetOnScreen (QWidget &widget, const QScreen &screen)
 
void openLaunchWindow ()
 
bool isLaunchWindowOpen ()
 
void bringLaunchWindowToFront ()
 
void openTaskQueueWindow ()
 
void openWelcomePage ()
 
void openAboutPage (QWidget *parent)
 
void openGlobalPreferences (QWidget *parent)
 
QString openGenericFolderPickerDialog (QWidget *parent)
 
QString openImagePathPickerDialog (QWidget *parent)
 
QString openSaveImagePathPickerDialog (QWidget *parent)
 
QString openSaveSVGPathPickerDialog (QWidget *parent)
 
QString openSaveRasterizedSVGPathPickerDialog (QWidget *parent)
 
QString openSaveRasterizedSVGsPathPickerDialog (QWidget *parent)
 
QString openSaveGeometryDataPathPickerDialog (QWidget *parent)
 
QString openSaveGIFPathPickerDialog (QWidget *parent)
 
QString openSaveCanvasPathPickerDialog (QWidget *parent)
 
QString openSaveWebGLPathPickerDialog (QWidget *parent)
 
QUrl openGetUrlDialog (QWidget *parent)
 
QString openGetScriptDialog (QWidget *parent)
 
QString openSelectScriptDialog (QWidget *parent)
 
void openTechnicalSupport ()
 
void openOnlineTutorials ()
 
void openMoreResourcesPage ()
 
QString openLoadImageTaskSettingsDialog (QWidget *parent)
 
QString openSaveImageTaskSettingsDialog (QWidget *parent)
 
QString openLoadGlobalSettingsDialog (QWidget *parent)
 
QString openSaveGlobalSettingsDialog (QWidget *parent)
 
QString openTargetImagePickerDialog (QWidget *parent)
 

Function Documentation

void geometrize::common::ui::bringLaunchWindowToFront ( )
57 {
58  std::vector<dialog::LaunchWindow*> launchWindows{dialog::LaunchWindow::getTopLevelLaunchWindows()};
59 
60  if(launchWindows.empty()) {
61  return;
62  }
63 
64  dialog::LaunchWindow* firstLauncher{launchWindows.front()};
65  firstLauncher->setWindowState(firstLauncher->windowState() & ~Qt::WindowMinimized);
66  firstLauncher->show();
67  firstLauncher->raise();
68  QApplication::setActiveWindow(firstLauncher);
69 }

Here is the call graph for this function:

Here is the caller graph for this function:

void geometrize::common::ui::centerWidgetOnScreen ( QWidget &  widget,
const QScreen &  screen 
)
38 {
39  widget.setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, widget.size(), screen.availableGeometry()));
40 }

Here is the caller graph for this function:

const QScreen * geometrize::common::ui::getFirstScreenContainingCursor ( )
31 {
32  const QPoint globalCursorPos = QCursor::pos();
33  const QScreen* mouseScreen = QGuiApplication::screenAt(globalCursorPos);
34  return mouseScreen;
35 }

Here is the caller graph for this function:

bool geometrize::common::ui::isLaunchWindowOpen ( )
52 {
53  return dialog::LaunchWindow::getTopLevelLaunchWindows().size() > 0;
54 }

Here is the call graph for this function:

Here is the caller graph for this function:

void geometrize::common::ui::openAboutPage ( QWidget *  parent)
87 {
88  dialog::AboutDialog dialog(parent);
89  dialog.exec();
90 }

Here is the caller graph for this function:

QString geometrize::common::ui::openGenericFolderPickerDialog ( QWidget *  parent)
99 {
100  return QFileDialog::getExistingDirectory(parent, QWidget::tr("Select Folder", "Title on a dialog that allows the user to select a folder"));
101 }
QString geometrize::common::ui::openGetScriptDialog ( QWidget *  parent)
183 {
184  dialog::RunScriptDialog dialog(parent);
185  dialog.exec();
186  return dialog.getScriptFilepath();
187 }

Here is the call graph for this function:

Here is the caller graph for this function:

QUrl geometrize::common::ui::openGetUrlDialog ( QWidget *  parent)
174 {
175  dialog::OpenUrlDialog dialog(parent);
176  if(dialog.exec() == QDialog::Accepted) {
177  return dialog.getUrl();
178  }
179  return QUrl();
180 }

Here is the call graph for this function:

Here is the caller graph for this function:

void geometrize::common::ui::openGlobalPreferences ( QWidget *  parent)
93 {
94  dialog::GlobalPreferencesDialog preferencesDialog(parent);
95  preferencesDialog.exec();
96 }

Here is the caller graph for this function:

QString geometrize::common::ui::openImagePathPickerDialog ( QWidget *  parent)
104 {
105  return QFileDialog::getOpenFileName(parent,
106  QWidget::tr("Open Image", "Title on a dialog that allows the user to open an image file"),
107  "",
108  QWidget::tr("Image Files (*.jpg *.jpeg *.png *.bmp)", "List of supported image file formats. The text in the parentheses must not be changed"));
109 }

Here is the caller graph for this function:

void geometrize::common::ui::openLaunchWindow ( )
43 {
44  dialog::LaunchWindow* launcher{new dialog::LaunchWindow()};
45  launcher->show();
46  if(const auto mouseScreen = geometrize::common::ui::getFirstScreenContainingCursor()) {
47  geometrize::common::ui::centerWidgetOnScreen(*launcher, *mouseScreen);
48  }
49 }
void centerWidgetOnScreen(QWidget &widget, const QScreen &screen)
Definition: uiactions.cpp:37
const QScreen * getFirstScreenContainingCursor()
Definition: uiactions.cpp:30

Here is the call graph for this function:

Here is the caller graph for this function:

QString geometrize::common::ui::openLoadGlobalSettingsDialog ( QWidget *  parent)
229 {
230  return QFileDialog::getOpenFileName(parent,
231  QWidget::tr("Load Settings", "Title on a dialog that allows the user to select a settings file"),
232  "",
233  QWidget::tr("JSON Settings File (*.json)", "List of supported settings file formats. The text in the parentheses must not be changed"));
234 }

Here is the caller graph for this function:

QString geometrize::common::ui::openLoadImageTaskSettingsDialog ( QWidget *  parent)
213 {
214  return QFileDialog::getOpenFileName(parent,
215  QWidget::tr("Load Settings", "Title on a dialog that allows the user to select a settings file"),
216  "",
217  QWidget::tr("JSON Settings File (*.json)", "List of supported settings file formats. The text in the parentheses must not be changed"));
218 }

Here is the caller graph for this function:

void geometrize::common::ui::openMoreResourcesPage ( )
208 {
209  QDesktopServices::openUrl(QUrl(geometrize::constants::MORE_RESOURCES_URL));
210 }
const QString MORE_RESOURCES_URL
URL to a webpage providing additional templates, scripts and/or helpful links.
Definition: constants.h:14
void geometrize::common::ui::openOnlineTutorials ( )
203 {
204  QDesktopServices::openUrl(QUrl(geometrize::constants::VIDEO_TUTORIAL_URL));
205 }
const QString VIDEO_TUTORIAL_URL
The video tutorial webpage URL for the software.
Definition: constants.h:15

Here is the caller graph for this function:

QString geometrize::common::ui::openSaveCanvasPathPickerDialog ( QWidget *  parent)
158 {
159  return QFileDialog::getSaveFileName(parent,
160  QWidget::tr("Save HTML5 Webpage", "Title on a dialog that allows the user to save a HTML5-based webpage"),
161  "",
162  QWidget::tr("HTML Webpage (*.html)", "List of supported webpage formats. The text in the parentheses must not be changed"));
163 }

Here is the caller graph for this function:

QString geometrize::common::ui::openSaveGeometryDataPathPickerDialog ( QWidget *  parent)
142 {
143  return QFileDialog::getSaveFileName(parent,
144  QWidget::tr("Save Geometry Data", "Title on a dialog that allows the user to save geometric primitive data"),
145  "",
146  QWidget::tr("JSON Data (*.json);;Text Array (*.txt)", "List of supported data file formats. Semicolons and text in the parentheses must not be changed"));
147 }

Here is the caller graph for this function:

QString geometrize::common::ui::openSaveGIFPathPickerDialog ( QWidget *  parent)
150 {
151  return QFileDialog::getSaveFileName(parent,
152  QWidget::tr("Save Animated GIF", "Title on a dialog that allows the user to save an animated GIF file"),
153  "",
154  QWidget::tr("GIF Animation (*.gif)", "List of supported GIF file formats. The text in the parentheses must not be changed"));
155 }

Here is the caller graph for this function:

QString geometrize::common::ui::openSaveGlobalSettingsDialog ( QWidget *  parent)
237 {
238  return QFileDialog::getSaveFileName(parent,
239  QWidget::tr("Save Settings", "Title on a dialog that allows the user to save a settings file"),
240  "",
241  QWidget::tr("JSON Settings File (*.json)", "List of supported settings file formats. The text in the parentheses must not be changed"));
242 }

Here is the caller graph for this function:

QString geometrize::common::ui::openSaveImagePathPickerDialog ( QWidget *  parent)
112 {
113  return QFileDialog::getSaveFileName(parent,
114  QWidget::tr("Save Image", "Title on a dialog that allows the user to save an image file"),
115  "",
116  QWidget::tr("JPEG Image (*.jpg *.jpeg);;PNG Image (*.png);;BMP Image (*.bmp);;PPM Image (*.ppm)", "List of supported image file formats. Semicolons and text in the parentheses must not be changed"));
117 }
QString geometrize::common::ui::openSaveImageTaskSettingsDialog ( QWidget *  parent)
221 {
222  return QFileDialog::getSaveFileName(parent,
223  QWidget::tr("Save Settings", "Title on a dialog that allows the user to save a settings file"),
224  "",
225  QWidget::tr("JSON Settings File (*.json)", "List of supported settings file formats. The text in the parentheses must not be changed"));
226 }

Here is the caller graph for this function:

QString geometrize::common::ui::openSaveRasterizedSVGPathPickerDialog ( QWidget *  parent)
128 {
129  return QFileDialog::getSaveFileName(parent,
130  QWidget::tr("Save Image", "Title on a dialog that allows the user to save an image file"),
131  "",
132  QWidget::tr("Image Files (*.jpg *.jpeg *.png *.bmp)", "List of supported image file formats. The text in the parentheses must not be changed"));
133 }

Here is the caller graph for this function:

QString geometrize::common::ui::openSaveRasterizedSVGsPathPickerDialog ( QWidget *  parent)
136 {
137  return QFileDialog::getExistingDirectory(parent,
138  QWidget::tr("Save Images", "Title on a dialog that allows the user to save image files"));
139 }

Here is the caller graph for this function:

QString geometrize::common::ui::openSaveSVGPathPickerDialog ( QWidget *  parent)
120 {
121  return QFileDialog::getSaveFileName(parent,
122  QWidget::tr("Save SVG Image", "Title on a dialog that allows the user to save an SVG (scalable vector graphics) image file"),
123  "",
124  QWidget::tr("SVG Image (*.svg)", "List of supported vector-based image formats. The text in the parentheses must not be changed"));
125 }

Here is the caller graph for this function:

QString geometrize::common::ui::openSaveWebGLPathPickerDialog ( QWidget *  parent)
166 {
167  return QFileDialog::getSaveFileName(parent,
168  QWidget::tr("Save WebGL Webpage", "Title on a dialog that allows the user to save a WebGL-based webpage"),
169  "",
170  QWidget::tr("HTML Webpage (*.html)", "List of supported webpage formats. The text in the parentheses must not be changed"));
171 }

Here is the caller graph for this function:

QString geometrize::common::ui::openSelectScriptDialog ( QWidget *  parent)
190 {
191  return QFileDialog::getOpenFileName(parent,
192  QWidget::tr("Select Script", "Title on a dialog that allows the user to select a script file"),
193  "",
194  QWidget::tr("ChaiScript Files (*.chai)", "List of supported script file formats. The text in the parentheses must not be changed"));
195 }

Here is the caller graph for this function:

QString geometrize::common::ui::openTargetImagePickerDialog ( QWidget *  parent)
245 {
246  return QFileDialog::getOpenFileName(parent,
247  QWidget::tr("Select Image", "Title on a dialog that allows the user to select an image file"),
248  "",
249  QWidget::tr("Image Files (*.jpg *.jpeg *.png *.bmp)", "List of supported image file formats. The text in the parentheses must not be changed"));
250 }
void geometrize::common::ui::openTaskQueueWindow ( )
72 {
73  auto taskQueueWindow = new dialog::TaskQueueWindow();
74  taskQueueWindow->show();
75 }

Here is the caller graph for this function:

void geometrize::common::ui::openTechnicalSupport ( )
198 {
199  QDesktopServices::openUrl(QUrl(geometrize::constants::TECHNICAL_SUPPORT_URL));
200 }
const QString TECHNICAL_SUPPORT_URL
The technical support webpage URL for the software.
Definition: constants.h:13

Here is the caller graph for this function:

void geometrize::common::ui::openWelcomePage ( )
78 {
79  dialog::WelcomeWindow* window = new dialog::WelcomeWindow();
80  window->show();
81  if(const auto mouseScreen = geometrize::common::ui::getFirstScreenContainingCursor()) {
82  geometrize::common::ui::centerWidgetOnScreen(*window, *mouseScreen);
83  }
84 }
void centerWidgetOnScreen(QWidget &widget, const QScreen &screen)
Definition: uiactions.cpp:37
const QScreen * getFirstScreenContainingCursor()
Definition: uiactions.cpp:30

Here is the call graph for this function: