 |
Geometrize
1.0
An application for geometrizing images into geometric primitives
|
◆ LaunchWindowImpl() [1/2]
geometrize::dialog::LaunchWindow::LaunchWindowImpl::LaunchWindowImpl |
( |
LaunchWindow * |
pQ | ) |
|
|
inline |
36 q->setAttribute(Qt::WA_DeleteOnClose);
41 ui->runScriptButton->setHidden(
true);
59 connect(
ui->actionScript_Console, &QAction::toggled, [
this](
const bool checked) {
60 setConsoleVisibility(checked);
65 ui->templatesSearchEdit->addToCompletionList(QString::fromStdString(util::getTemplateManifest(templateFolder.toStdString()).getName()));
67 connect(
ui->templatesSearchEdit, &dialog::CompletionBox::textChanged, [
this](
const QString& text) {
68 ui->templateGrid->setItemFilter(text);
72 ui->templateGrid->loadTemplates();
◆ LaunchWindowImpl() [2/2]
geometrize::dialog::LaunchWindow::LaunchWindowImpl::LaunchWindowImpl |
( |
const LaunchWindowImpl & |
| ) |
|
|
delete |
◆ ~LaunchWindowImpl()
geometrize::dialog::LaunchWindow::LaunchWindowImpl::~LaunchWindowImpl |
( |
| ) |
|
|
default |
◆ getCommandHandlerName()
std::string geometrize::dialog::LaunchWindow::LaunchWindowImpl::getCommandHandlerName |
( |
| ) |
const |
|
inline |
162 return q->objectName().toStdString();
◆ getTopLevelLaunchWindows()
static std::vector<LaunchWindow*> geometrize::dialog::LaunchWindow::LaunchWindowImpl::getTopLevelLaunchWindows |
( |
| ) |
|
|
inlinestatic |
84 std::vector<LaunchWindow*> windows;
86 QWidgetList topLevelWidgets{QApplication::topLevelWidgets()};
87 for(QWidget* w : topLevelWidgets) {
89 windows.push_back(lw);
◆ handleCommand()
98 const QString s = QString::fromStdString(command.
getCommand());
99 if(s ==
"search_sample_images") {
100 ui->templatesSearchEdit->setText(QString::fromStdString(command.
getStringArg(
"search_term")));
104 if(s ==
"show_file_menu") {
105 ui->menuFile->exec(
q->mapToGlobal(
ui->menuBar->pos()));
107 if(s ==
"file_menu_clear_recent_items") {
110 if(s ==
"file_menu_open_global_preferences") {
113 if(s ==
"file_menu_load_global_preferences") {
116 if(s ==
"file_menu_save_global_preferences") {
119 if(s ==
"file_menu_exit") {
123 if(s ==
"show_view_menu") {
124 ui->menuView->exec(
q->mapToGlobal(
ui->menuBar->pos()));
126 if(s ==
"view_menu_toggle_script_console") {
127 ui->actionScript_Console->toggle();
129 if(s ==
"view_menu_show_script_console") {
130 ui->actionScript_Console->setChecked(
true);
132 if(s ==
"view_menu_hide_script_console") {
133 ui->actionScript_Console->setChecked(
false);
136 if(s ==
"show_help_menu") {
137 ui->menuHelp->popup(
q->mapToGlobal(
ui->menuBar->pos()));
139 if(s ==
"help_menu_show_tutorials") {
140 ui->actionTutorials->trigger();
142 if(s ==
"help_menu_show_support") {
143 ui->actionSupport->trigger();
145 if(s ==
"help_menu_show_about") {
146 ui->actionAbout->trigger();
149 if(s ==
"click_open_image") {
150 ui->openImageButton->click();
152 if(s ==
"click_open_link") {
153 ui->openLinkButton->click();
155 if(s ==
"click_open_task_queue") {
156 ui->openTaskQueueButton->click();
◆ loadConsoleHistory()
void geometrize::dialog::LaunchWindow::LaunchWindowImpl::loadConsoleHistory |
( |
| ) |
|
|
inline |
181 ui->consoleWidget->setHistory(history);
◆ loadGlobalSettingsTemplate()
void geometrize::dialog::LaunchWindow::LaunchWindowImpl::loadGlobalSettingsTemplate |
( |
| ) |
|
|
inline |
◆ onLanguageChange()
void geometrize::dialog::LaunchWindow::LaunchWindowImpl::onLanguageChange |
( |
| ) |
|
|
inline |
210 ui->retranslateUi(
q);
◆ operator=()
◆ populateUi()
void geometrize::dialog::LaunchWindow::LaunchWindowImpl::populateUi |
( |
| ) |
|
|
inlineprivate |
221 q->setWindowTitle(windowTitle);
223 const QString moreResourcesLabel{tr(
"Get more online",
"Text on a button the user presses to open a page containing more resources for using the app, such as extra images, information and help")};
224 ui->moreResourcesLink->setText(R
"(<a href=")" + constants::MORE_RESOURCES_URL + R"(" style="text-decoration:none;">)" + moreResourcesLabel + R"(</a>)");
226 const QString tutorialsLabel{tr(
"Video tutorials",
"Text on a button the user presses to open a page containing video tutorials explaining how to use the app")};
◆ saveConsoleHistory()
void geometrize::dialog::LaunchWindow::LaunchWindowImpl::saveConsoleHistory |
( |
| ) |
|
|
inline |
186 const std::vector<std::string> history{
ui->consoleWidget->getHistory()};
◆ saveGlobalSettingsTemplate()
void geometrize::dialog::LaunchWindow::LaunchWindowImpl::saveGlobalSettingsTemplate |
( |
| ) |
const |
|
inline |
◆ setCommandHandlerName()
void geometrize::dialog::LaunchWindow::LaunchWindowImpl::setCommandHandlerName |
( |
const std::string & |
name | ) |
|
|
inline |
167 q->setObjectName(QString::fromStdString(name));
◆ setConsoleVisibility()
void geometrize::dialog::LaunchWindow::LaunchWindowImpl::setConsoleVisibility |
( |
const bool |
visible | ) |
|
|
inline |
172 if(
ui->actionScript_Console->isChecked() != visible) {
173 ui->actionScript_Console->setChecked(visible);
175 ui->consoleWidget->setVisible(visible);
◆ setupLogo()
void geometrize::dialog::LaunchWindow::LaunchWindowImpl::setupLogo |
( |
| ) |
|
|
inlineprivate |
246 const QString logoPath{
":/logos/logo_small.png"};
249 ui->logoLabel->setPixmap(logoPath);
251 QImage image(logoPath);
252 image = image.convertToFormat(QImage::Format_RGBA8888);
255 geometrize::Bitmap initialBitmap{logoBitmap.getWidth(), logoBitmap.getHeight(), geometrize::rgba{0, 0, 0, 0}};
256 m_logoTask = std::make_unique<task::ImageTask>(logoBitmap, initialBitmap, Qt::QueuedConnection);
257 m_logoTask->getPreferences().setShapeTypes(geometrize::ShapeTypes::RECTANGLE);
258 m_logoTask->getPreferences().setShapeAlpha(255U);
263 const QPixmap pixmap{image::createPixmap(m_logoTask->getCurrent())};
264 ui->logoLabel->setPixmap(pixmap);
◆ updateLogoTaskProgress()
void geometrize::dialog::LaunchWindow::LaunchWindowImpl::updateLogoTaskProgress |
( |
| ) |
|
|
inlineprivate |
235 ui->logoLabel->setToolTip(
"");
239 const QString logoToolTip{tr(
"%1/%2 shapes",
"Text showing the number of shapes that have been created to replicate an image so far e.g. 230/300 shapes")
241 ui->logoLabel->setToolTip(logoToolTip);
◆ m_engine
std::unique_ptr<chaiscript::ChaiScript> geometrize::dialog::LaunchWindow::LaunchWindowImpl::m_engine |
|
private |
◆ m_logoTask
std::unique_ptr<task::ImageTask> geometrize::dialog::LaunchWindow::LaunchWindowImpl::m_logoTask |
|
private |
◆ m_logoTaskSteps
std::size_t geometrize::dialog::LaunchWindow::LaunchWindowImpl::m_logoTaskSteps {0} |
|
private |
◆ m_maxLogoTaskSteps
const std::size_t geometrize::dialog::LaunchWindow::LaunchWindowImpl::m_maxLogoTaskSteps {300ULL} |
|
private |
LaunchWindow* geometrize::dialog::LaunchWindow::LaunchWindowImpl::q |
|
private |
◆ ui
std::unique_ptr<Ui::LaunchWindow> geometrize::dialog::LaunchWindow::LaunchWindowImpl::ui |
|
private |
The documentation for this class was generated from the following file:
- /home/appveyor/projects/geometrize-docs/geometrize/geometrize/dialog/launchwindow.cpp
bool load(const std::string &filePath)
load Loads the global preferences from a file.
Definition: globalpreferences.cpp:448
LaunchWindow()
Definition: launchwindow.cpp:286
static const std::string launchConsoleHistoryFilename
The name of the console history settings file used by the console embedded in the launch window.
Definition: scriptconsole.h:33
const QString MORE_RESOURCES_URL
URL to a webpage providing additional templates, scripts and/or helpful links.
Definition: constants.h:14
void on_actionSave_Global_Preferences_triggered()
Definition: launchwindow.cpp:362
std::unique_ptr< Ui::LaunchWindow > ui
Definition: launchwindow.cpp:277
const std::size_t m_maxLogoTaskSteps
Definition: launchwindow.cpp:282
void updateLogoTaskProgress()
Definition: launchwindow.cpp:232
void on_actionClear_Recents_triggered()
Definition: launchwindow.cpp:367
QString getApplicationVersionString()
getApplicationVersionString Gets the application version as a string in VERSION.MAJOR....
Definition: versioninfo.cpp:13
const QString VIDEO_TUTORIAL_URL
The video tutorial webpage URL for the software.
Definition: constants.h:15
void on_actionGlobal_Preferences_triggered()
Definition: launchwindow.cpp:352
RecentItems & getRecentItems()
getRecentItems Gets a reference to the recent files list.
Definition: recentitems.cpp:206
Bitmap createBitmap(const QImage &image)
createBitmap Creates a bitmap data object from the given image.
Definition: imageloader.cpp:22
bool save(const std::string &filePath)
save Saves the global preferences to a file.
Definition: globalpreferences.cpp:453
static QString getApplicationName()
getApplicationName Gets the name of the application.
Definition: strings.cpp:9
std::string getStringArg(const std::string &key) const
Definition: command.cpp:20
void populateUi()
Definition: launchwindow.cpp:215
QPixmap createPixmap(const Bitmap &data)
createPixmap Creates a pixmap from the bitmap data object. Assumes RGBA8888 format.
Definition: imageloader.cpp:59
QString openSaveGlobalSettingsDialog(QWidget *parent)
Definition: uiactions.cpp:236
std::string getCommand() const
Definition: command.cpp:15
void loadConsoleHistory()
Definition: launchwindow.cpp:178
QString openLoadGlobalSettingsDialog(QWidget *parent)
Definition: uiactions.cpp:228
std::size_t m_logoTaskSteps
Definition: launchwindow.cpp:283
void writeStringVector(const std::vector< std::string > &vec, const std::string &filePath)
writeStringVector Writes the string vector to the given filepath as JSON. Will attempt to overwrite a...
Definition: serializationutil.cpp:37
void on_actionLoad_Global_Preferences_triggered()
Definition: launchwindow.cpp:357
std::unique_ptr< chaiscript::ChaiScript > m_engine
Definition: launchwindow.cpp:279
void signal_templateLoaded(QString, bool)
void setConsoleVisibility(const bool visible)
Definition: launchwindow.cpp:170
LaunchWindow * q
Definition: launchwindow.cpp:278
void on_actionExit_triggered()
Definition: launchwindow.cpp:372
std::string getAppDataLocation()
getAppDataLocation Returns a directory location where persistent application data can be stored.
Definition: util.cpp:319
geometrize::preferences::GlobalPreferences & getGlobalPreferences()
getGlobalPreferences Shorthand function that gets a reference to the shared global preferences object...
Definition: globalpreferences.cpp:32
void signal_modelDidStep(std::vector< geometrize::ShapeResult > shapes)
signal_modelDidStep Signal that is emitted immediately after the underlying image task model is stepp...
std::unique_ptr< task::ImageTask > m_logoTask
Definition: launchwindow.cpp:281
void setupLogo()
Definition: launchwindow.cpp:244
std::unique_ptr< chaiscript::ChaiScript > createLaunchWindowEngine()
createLaunchWindowEngine Creates a Chaiscript engine object for the launch window script console.
Definition: chaiscriptcreator.cpp:37
std::vector< std::string > readStringVector(const std::string &filePath)
readStringVector Reads the JSON file containing the vector of strings at the given filepath....
Definition: serializationutil.cpp:20