![]() |
Fréchet View
1.6.0
A Tool for Exploring Fréchet Distance Algorithms
|
the application singleton
Manages all central concerns of the Qt application
FrechetViewApplication is responsible for setting up the GUI, opening files, starting and stopping algorithms, managing data structures, and some more...
Usually such a class would be derived from QGuiApplication. We have chosen another approach, with QApplication being a separate object. This allows to run FrechetViewApplication either with a GUI, or head-less as a command-line application.
Definition at line 43 of file frechetviewapplication.h.
#include <frechetviewapplication.h>
Inherits QObject.
Public Types | |
enum | Algorithm { ALGORITHM_CURVE =0, ALGORITHM_POLYGON =1, ALGORITHM_K_FRECHET =2 } |
we have three Fréchet Distance algorithms More... | |
enum | TriState { NO, YES, DEFAULT } |
GPU support (for headless mode only) More... | |
Public Slots | |
void | open (bool firstTime=false) |
initialises the GUI More... | |
void | open (QString filePath) |
initialises the GUI and opens a file More... | |
static FrechetViewApplication * | instance () |
void | quit () |
quit the application, closing all resources and windows More... | |
void | windowClosed (QMainWindow *) |
called when the main window is closed by the user More... | |
Grid::ptr | getGrid () |
FreeSpace::ptr | getFreeSpace () |
FSPath::ptr | getFSPath () |
kAlgorithm::ptr | getKAlgorithm () |
poly::Algorithm::ptr | getPolyAlgorithm () |
Curve & | getP () |
Curve & | getQ () |
void | resetAlgorithms () |
stops running algorithm(s) More... | |
void | showAboutDialog () |
opens the "About" dialog More... | |
void | createDesktopEntry () |
creates an application icon on the users desktop More... | |
void | editInputFile () |
opens the input file in an editor More... | |
void | startStopDecidePolygon () |
starts, or stops the decision algorithm for simple polygons More... | |
void | startStopOptimiseCurve () |
starts, or stops the optimisation algorithm for curves More... | |
void | startStopApproximateCurve () |
starts, or stops the approximation algorithm for curves More... | |
void | startStopOptimisePolygon () |
starts, or stops the optimisation algorithm for simple polygons More... | |
void | startStopApproximatePolygon () |
starts, or stops the approximation algorithm for simple polygons More... | |
void | startKBruteForce () |
starts the brute-force k-Frechet algorithm More... | |
void | cancelBackgroundJob () |
stops long-running algorithm (if necessary) More... | |
Signals | |
void | fileOpened (QString file) |
raised when a new file is opened. Triggers changes in all parts of the GUI. More... | |
void | algorithmChanged (int algo) |
raised when another algorithm is selected. Triggers changes in all parts of the GUI. More... | |
Public Member Functions | |
FrechetViewApplication (QString exec_path, bool withGui) | |
default constructor More... | |
~FrechetViewApplication () | |
desctructor; closes all resources and windows More... | |
void | init (QString file) |
initialise the GUI application and open a file (optional) More... | |
int | commandLineInterface (QString inputFile, Algorithm algo, bool topo, double accuracy, double epsilon) throw (std::exception) |
run the command line interface More... | |
Algorithm | currentAlgorithm () const |
bool | currentAlgorithm (Algorithm alg) const |
test current algorithm More... | |
void | setCurrentAlgorithm (Algorithm alg) |
change current algorithm More... | |
WorkerJobHandle * | backgroundJob () |
Protected Attributes | |
FileHistory | history |
Open Recent file history. More... | |
size_t | currentId |
reference to current File More... | |
InputReader | reader |
reads files from disk More... | |
DataPath | path |
pointer to input data within an xml file More... | |
QFileSystemWatcher * | fileWatch |
Curve | P |
first input curve More... | |
Curve | Q |
Grid::ptr | grid |
manages the free-space grid More... | |
FreeSpace::ptr | freeSpace |
the free-space diagram More... | |
Algorithm | _currentAlgorithm |
selects current Algorithm More... | |
FSPath::ptr | fspath |
the feasible path (if available) More... | |
k::kAlgorithm::ptr | kAlgorithm |
the k-Frechet algorithm (if available) More... | |
poly::Algorithm::ptr | polyAlgorithm |
the algorithm for simple polygons and curves (if available) More... | |
WorkerJobHandle | bgJob |
double | epsMax |
maximum value for epsilon More... | |
MainWindow * | window |
the main window More... | |
Static Protected Attributes | |
static FrechetViewApplication * | frechetViewApp = nullptr |
singleton instance More... | |
Private Member Functions | |
void | saveFileSettings (QSettings &settings, size_t histId) |
save file specific settings to preferences More... | |
void | restoreFileSettings (QSettings &settings, size_t histId) |
read file specific settings from preferences More... | |
bool | showFirstTimeHint () |
show a short hint when the application is opened for the very first time More... | |
bool | setupCurves (bool topo=false) |
set up geometric data structures, like triangulations etc. More... | |
void | startStopDecidePolygon (double epsilon) |
start or stop decision algorithm for simple polygons More... | |
void | startStopOptimiseCurve (double approx) |
start or stop algorithm for curves More... | |
void | startStopOptimisePolygon (double approx) |
start or stop algorithm for simple polygons More... | |
void | installLinuxDesktopIcons (QSettings &) |
create a desktop icon on a Linux system (or try at least..) More... | |
void | installLinuxDesktopEntries (QSettings &) |
create a desktop file on a Linux system (or try at least..) More... | |
QString | linuxDesktopFile () |
find location of desktpo file More... | |
bool | populateBookmarks () |
for presentation mode only More... | |
void | cli_setup (QString inputFile, Algorithm algo) |
prepare the application for command line mode More... | |
int | cli_decideKFrechet (double epsilon) |
run the k-Frechet brute-force algorithm in headless mode More... | |
Static Private Member Functions | |
static void | copyContents (QByteArray contents, QString path) |
copy data to a file on disk More... | |
static void | copyFile (QString src, QString dest) |
copy files on disk More... | |
Private Attributes | |
QString | execPath |
path to executable file More... | |
we have three Fréchet Distance algorithms
Definition at line 51 of file frechetviewapplication.h.
GPU support (for headless mode only)
Enumerator | |
---|---|
NO | no GPU |
YES | GPU required. |
DEFAULT | default = use GPU, if available |
Definition at line 64 of file frechetviewapplication.h.
FrechetViewApplication::FrechetViewApplication | ( | QString | exec_path, |
bool | withGui | ||
) |
default constructor
exec_path | path to executable file |
withGui | set up GUI, or run head-less |
Definition at line 29 of file frechetviewapplication.cpp.
FrechetViewApplication::~FrechetViewApplication | ( | ) |
desctructor; closes all resources and windows
Definition at line 53 of file frechetviewapplication.cpp.
|
signal |
raised when another algorithm is selected. Triggers changes in all parts of the GUI.
algo | int algorithm (of type Algorithm) |
|
inline |
Definition at line 158 of file frechetviewapplication.h.
|
slot |
stops long-running algorithm (if necessary)
Definition at line 481 of file frechetviewapplication.cpp.
|
private |
|
private |
int FrechetViewApplication::commandLineInterface | ( | QString | inputFile, |
Algorithm | algo, | ||
bool | topo, | ||
double | accuracy, | ||
double | epsilon | ||
) | |||
throw | ( | std::exception | |
) |
run the command line interface
inputFile | file to process |
algo | select an algorithm |
topo | parameter to poly algorithm: process matrixes in topological order, saving memory |
accuracy | parameter to approximation algorithms |
epsilon | epsilon for the decision variant |
std::exception | if there is an error in the input, or parameters are not correct |
|
staticprivate |
copy data to a file on disk
Definition at line 604 of file frechetviewapplication.cpp.
|
staticprivate |
copy files on disk
Definition at line 613 of file frechetviewapplication.cpp.
|
slot |
creates an application icon on the users desktop
Definition at line 366 of file frechetviewapplication.cpp.
|
inline |
Definition at line 143 of file frechetviewapplication.h.
|
inline |
test current algorithm
alg | an algorithm |
Definition at line 149 of file frechetviewapplication.h.
|
slot |
opens the input file in an editor
Definition at line 400 of file frechetviewapplication.cpp.
|
signal |
raised when a new file is opened. Triggers changes in all parts of the GUI.
file | file name |
|
inlineslot |
Definition at line 211 of file frechetviewapplication.h.
|
inlineslot |
Definition at line 213 of file frechetviewapplication.h.
|
inlineslot |
Definition at line 209 of file frechetviewapplication.h.
|
inlineslot |
Definition at line 215 of file frechetviewapplication.h.
|
inlineslot |
Definition at line 220 of file frechetviewapplication.h.
|
inlineslot |
Definition at line 217 of file frechetviewapplication.h.
|
inlineslot |
Definition at line 222 of file frechetviewapplication.h.
void FrechetViewApplication::init | ( | QString | file | ) |
initialise the GUI application and open a file (optional)
file | file to open (optional, may be empty) |
Definition at line 60 of file frechetviewapplication.cpp.
|
private |
create a desktop file on a Linux system (or try at least..)
Definition at line 509 of file frechetviewapplication.cpp.
|
private |
create a desktop icon on a Linux system (or try at least..)
Definition at line 487 of file frechetviewapplication.cpp.
|
inlinestaticslot |
Definition at line 188 of file frechetviewapplication.h.
|
private |
find location of desktpo file
Definition at line 522 of file frechetviewapplication.cpp.
|
slot |
initialises the GUI
firstTime | show user hint when no file is opened (optional) |
|
slot |
initialises the GUI and opens a file
filePath | absolute path to file |
Definition at line 205 of file frechetviewapplication.cpp.
|
private |
for presentation mode only
Definition at line 554 of file frechetviewapplication.cpp.
|
inlineslot |
quit the application, closing all resources and windows
Definition at line 194 of file frechetviewapplication.h.
|
slot |
stops running algorithm(s)
Definition at line 168 of file frechetviewapplication.cpp.
|
private |
read file specific settings from preferences
settings | application preferences |
histId | ID in file history |
Definition at line 632 of file frechetviewapplication.cpp.
|
private |
save file specific settings to preferences
settings | application preferences |
histId | ID in file history |
Definition at line 621 of file frechetviewapplication.cpp.
void FrechetViewApplication::setCurrentAlgorithm | ( | FrechetViewApplication::Algorithm | alg | ) |
change current algorithm
alg | new algorithm |
Clears the feasible path and triggers the signal algorithmChanged(). This signal will cause subsequent changes to several parts of the GUI, like the control panel, the curve view, etc.
Definition at line 141 of file frechetviewapplication.cpp.
|
private |
set up geometric data structures, like triangulations etc.
topo |
Definition at line 646 of file frechetviewapplication.cpp.
|
slot |
opens the "About" dialog
Definition at line 356 of file frechetviewapplication.cpp.
|
private |
show a short hint when the application is opened for the very first time
Definition at line 733 of file frechetviewapplication.cpp.
|
slot |
starts the brute-force k-Frechet algorithm
Definition at line 474 of file frechetviewapplication.cpp.
|
slot |
starts, or stops the approximation algorithm for curves
Definition at line 456 of file frechetviewapplication.cpp.
|
slot |
starts, or stops the approximation algorithm for simple polygons
Definition at line 434 of file frechetviewapplication.cpp.
|
slot |
starts, or stops the decision algorithm for simple polygons
Definition at line 409 of file frechetviewapplication.cpp.
|
private |
start or stop decision algorithm for simple polygons
epsilon |
Definition at line 415 of file frechetviewapplication.cpp.
|
slot |
starts, or stops the optimisation algorithm for curves
Definition at line 451 of file frechetviewapplication.cpp.
|
private |
start or stop algorithm for curves
approx | if > 0, run approximation algorithm. if ==0, run optimisation algorithm. |
Definition at line 462 of file frechetviewapplication.cpp.
|
slot |
starts, or stops the optimisation algorithm for simple polygons
Definition at line 429 of file frechetviewapplication.cpp.
|
private |
start or stop algorithm for simple polygons
approx | if > 0, run approximation algorithm. if ==0, run optimisation algorithm. |
Definition at line 440 of file frechetviewapplication.cpp.
|
inlineslot |
called when the main window is closed by the user
Definition at line 201 of file frechetviewapplication.h.
|
protected |
selects current Algorithm
Definition at line 94 of file frechetviewapplication.h.
|
protected |
long-running job. some algorithms take long and are delegated to a background thread.
Definition at line 103 of file frechetviewapplication.h.
|
protected |
reference to current File
Definition at line 77 of file frechetviewapplication.h.
|
protected |
maximum value for epsilon
Definition at line 105 of file frechetviewapplication.h.
|
private |
path to executable file
Definition at line 252 of file frechetviewapplication.h.
|
protected |
keeps track of changed files on disk. If the current file changes on disk, it will be automatically reloaded.
Definition at line 85 of file frechetviewapplication.h.
|
staticprotected |
singleton instance
Definition at line 72 of file frechetviewapplication.h.
|
protected |
the free-space diagram
Definition at line 92 of file frechetviewapplication.h.
|
protected |
the feasible path (if available)
Definition at line 96 of file frechetviewapplication.h.
|
protected |
manages the free-space grid
Definition at line 90 of file frechetviewapplication.h.
|
protected |
Open Recent file history.
Definition at line 75 of file frechetviewapplication.h.
|
protected |
the k-Frechet algorithm (if available)
Definition at line 98 of file frechetviewapplication.h.
|
protected |
first input curve
Definition at line 87 of file frechetviewapplication.h.
|
protected |
pointer to input data within an xml file
Definition at line 82 of file frechetviewapplication.h.
|
protected |
the algorithm for simple polygons and curves (if available)
Definition at line 100 of file frechetviewapplication.h.
|
protected |
second input curve
Definition at line 88 of file frechetviewapplication.h.
|
protected |
reads files from disk
Definition at line 80 of file frechetviewapplication.h.
|
protected |
the main window
Definition at line 107 of file frechetviewapplication.h.