Geometrize  1.0
An application for geometrizing images into geometric primitives
Functions
geometrize::searchpaths Namespace Reference

Functions

std::string getApplicationDirectoryPath ()
 getApplicationDirectoryPath Gets the directory that contains the application executable. More...
 
std::vector< std::string > getScriptSearchPaths ()
 getScriptSearchPaths Gets the directory paths that the program will search for scripts. These may include resources (":/resourcedir/"), relative ("../../templates"), or absolute directory paths ("C:/Users/admin/Desktop"). More...
 
std::vector< std::string > getTemplateSearchPaths ()
 getTemplateSearchpaths Gets the directory paths that the program will search for project file templates. These may include resources (":/resourcedir/"), relative ("../../templates"), or absolute directory paths ("C:/Users/admin/Desktop"). More...
 
std::string getDefaultTaskSettingsFilename ()
 getTaskSettingsFilename Gets the default name of a task settings file that is manually saved by the user, or a task settings file bundled with a project file template. More...
 
std::string getAutosaveTaskSettingsFilename (const std::string &hashOfFirstTargetImage)
 getAutomaticTaskSettingsFilename Gets the name of a task settings file to be autosaved (e.g. when the task window is closed). More...
 
std::vector< std::string > getAutosaveTaskSettingsSearchPaths ()
 getAutosaveTaskSettingsSearchPaths Gets the directory paths that the program will search for autosaved task settings files. The list of directory paths returned is sorted from high to low priority and it should never be empty. More...
 

Function Documentation

◆ getApplicationDirectoryPath()

std::string geometrize::searchpaths::getApplicationDirectoryPath ( )

getApplicationDirectoryPath Gets the directory that contains the application executable.

Returns
The directory path that contains the application executable.
17 {
18  return QCoreApplication::applicationDirPath().toStdString();
19 }
Here is the caller graph for this function:

◆ getAutosaveTaskSettingsFilename()

std::string geometrize::searchpaths::getAutosaveTaskSettingsFilename ( const std::string &  hashOfFirstTargetImage)

getAutomaticTaskSettingsFilename Gets the name of a task settings file to be autosaved (e.g. when the task window is closed).

Parameters
hashOfFirstTargetImageA string containing a hash of the first target image the task was set up to use. NOTE - this hash changes based on the target image, so modifying the "resize image" settings in the application will cause this to change.
Returns
The name of the autosave task settings file, including the file extension
37 {
38  return "image_task_settings_" + hashOfFirstTargetImage + ".json";
39 }
Here is the caller graph for this function:

◆ getAutosaveTaskSettingsSearchPaths()

std::vector< std::string > geometrize::searchpaths::getAutosaveTaskSettingsSearchPaths ( )

getAutosaveTaskSettingsSearchPaths Gets the directory paths that the program will search for autosaved task settings files. The list of directory paths returned is sorted from high to low priority and it should never be empty.

Returns
The vector of autosave task settings search paths.
42 {
43  const QStringList locs = QStandardPaths::standardLocations(QStandardPaths::AppConfigLocation);
44  std::vector<std::string> stdLocs;
45  for(const auto& loc : locs) {
46  stdLocs.push_back(loc.toStdString());
47  }
48  return stdLocs;
49 }
Here is the caller graph for this function:

◆ getDefaultTaskSettingsFilename()

std::string geometrize::searchpaths::getDefaultTaskSettingsFilename ( )

getTaskSettingsFilename Gets the default name of a task settings file that is manually saved by the user, or a task settings file bundled with a project file template.

Returns
The default filename of a task settings file, including the file extension.
32 {
33  return "settings.json";
34 }
Here is the caller graph for this function:

◆ getScriptSearchPaths()

std::vector< std::string > geometrize::searchpaths::getScriptSearchPaths ( )

getScriptSearchPaths Gets the directory paths that the program will search for scripts. These may include resources (":/resourcedir/"), relative ("../../templates"), or absolute directory paths ("C:/Users/admin/Desktop").

Returns
The vector of script search paths.
22 {
23  return { "/../../scripts", "/scripts" };
24 }
Here is the caller graph for this function:

◆ getTemplateSearchPaths()

std::vector< std::string > geometrize::searchpaths::getTemplateSearchPaths ( )

getTemplateSearchpaths Gets the directory paths that the program will search for project file templates. These may include resources (":/resourcedir/"), relative ("../../templates"), or absolute directory paths ("C:/Users/admin/Desktop").

Returns
The vector of template search paths.
27 {
28  return { ":/templates/templates", "/../../templates", "/templates" };
29 }
Here is the caller graph for this function: