![]() |
Fréchet View
1.6.0
A Tool for Exploring Fréchet Distance Algorithms
|
display the free-space diagram.
It is made up of a line grid and an array of CellView objects. Cell contents adjusts automatically at changes of epsilon. When epsilon changes, FreeSpaceView executes the decision variant of the curve algorithm.
When the k-Frechet algorithm is selected, connected components are color-coded. Component boundaries can be shown as intervals below the free-space diagram.
Optionally, a feasible path is displayed as one (or two) polygonal chains. Line segments of the feasible path are mouse hover sensitive.
Optionally, reachable intervals are displayed at the cell edges (along the grid lines).
Definition at line 199 of file freespaceview.h.
#include <freespaceview.h>
Inherits frechet::view::BaseView.
Public Slots | |
void | calculateFreeSpace (double epsilon) |
update free-space diagram when epsilon changes. If the curve algorithm is selected, compute a feasible path, too. All other algorithms must be triggered by the user. More... | |
void | showBounds (bool show) |
update display of bounding rects More... | |
void | showGreedyResult () |
show the result of the k-Frechet greedy algorithms. Highlights all components that are part of the solution, other components are grayed. More... | |
void | showOptimalResult () |
show the optimal result of the k-Frechet (brute-force) algorithms. Highlights all components that are part of the solution, other components are grayed. More... | |
void | hideResult () |
hide results of the k-Frechet algorithms. Remove gray-out, display all components in their original color. More... | |
void | showPath (bool show) |
show or hide feasible path More... | |
void | onHiliteSegment (int loc, int a, int b) |
highlight a segment of the feasible path More... | |
void | onAlgorithmChanged (int alg) |
updatee free-space diagram when a new algorithm is selected. For example, for the k-Frechet algorithm, components are color-coded. More... | |
void | hilitePoint (QPointF p) |
hilite on point inf the diagram (used for animation only) More... | |
virtual void | saveSettings (QSettings &settings, QString group) |
store settings to application preferences More... | |
virtual void | restoreSettings (QSettings &settings, QString group) |
load settings from application preferences More... | |
![]() | |
void | zoomIn (int level=-1) |
zoom in; connected to the zomm controls More... | |
void | zoomOut (int level=-1) |
connected to the zomm controls More... | |
virtual void | saveSettings (QSettings &settings, QString group) |
store view settings to application prefs More... | |
virtual void | restoreSettings (QSettings &settings, QString group) |
load view settings to application prefs More... | |
void | flipVertical (bool flip) |
flip graphics scene vertically More... | |
void | mouseMoveEvent (QMouseEvent *event) |
handles a mouse move event and detects mouse sensitve polygon segments More... | |
QPoint | mapSceneToGlobal (QPointF p) const |
map scene coordinates to window coordinate More... | |
Signals | |
void | curveFinished (bool yes) |
raised when after decision variant of the curve algorithm More... | |
void | hiliteSegment (int loc, int a, int b) |
raised when the mouse moves over a highlighted segment This signal triggers the display of associated line items. More... | |
Public Member Functions | |
FreeSpaceView (QWidget *parent=0) | |
default constructor More... | |
virtual | ~FreeSpaceView () |
destructor; releases all items More... | |
void | populateScene () |
create the grid lines and an array of CellView objects More... | |
bool | showBounds () const |
virtual void | dropUnusedItems () override |
release graphics items that are currently not drawn implements empty method from super-class More... | |
virtual void | segmentSelected (GraphicsHoverLineItem *item) override |
called when the mouse hovers over a sensitve line item More... | |
![]() | |
BaseView (QWidget *parent=0, QString title="", bool showRotate=true) | |
constructore with parent and title More... | |
QGraphicsView * | view () const |
Public Attributes | |
QPen | GRID_PEN [4] |
QPen | AREA_PEN |
pen for content area More... | |
QPen | BOUNDS_PEN |
pen for bounding rectangles More... | |
QPen | PATH_PEN |
pen for feasible path More... | |
Static Public Attributes | |
static const QBrush | AREA_BRUSH1 |
brush (fill color) for content area More... | |
static const QBrush | AREA_BRUSH2 |
brush (fill color) for content area More... | |
static const double | TF_MAX_ARG = 1e6 |
max. value for affine transforms More... | |
static const QColor | LIGHT_GRAY |
used for disabled components (k-Frechet) More... | |
static const QColor | AREA_COLOR |
color for content area (except k-Frechet) More... | |
Private Member Functions | |
CellView * | getCellView (int i, int j) |
get a free-space cell view More... | |
void | updateView (double eps) |
update free-space view in response to a change of epsilon More... | |
void | updateBounds () |
update bounding rectangles More... | |
void | updateIntervals () |
update component intervals (k-Frechet only) More... | |
void | showResult (const data::BitSet *resultSet) |
show the result of a k-Frechet algorithm More... | |
void | createBoundsRect (int i, int j, QLineF result[4]) |
create a boundary rectangle for a cell More... | |
void | createReachabilityRect (int i, int j, QLineF result[4]) |
create a set of line segments for reachability intervals More... | |
QLineF | boundsLine (QPointF a, QPointF b, int i, int j) |
calculates one boundary line More... | |
QTransform | createEllipseTransform (int i, int j) |
compute the transformation for drawing an ellipse More... | |
void | addGridLine (QLineF line, LineStyle style) |
add a grid line to the graphics scene More... | |
void | doHiliteSegment (GraphicsHoverLineItem::Location loc, int a, int b) |
highlight a line segment More... | |
Static Private Member Functions | |
static bool | validTransform (const QTransform &tf) |
validity test for a transformation. If transform parameters become excessively large, the ellipse is replaced by an approximating polygon. More... | |
static bool | validTransformArg (double x) |
validity test for a transformation More... | |
Private Attributes | |
bool | path_ok |
true, if there is a feasible path More... | |
bool | _showBounds |
true, if bounding rectangle are shown More... | |
Palette | componentPalette |
CellView::MatrixPtr | cells |
free space areas for all cells (i,j) More... | |
IntervalView * | intervalView [2] |
k-Frechet: show component intervals below and to the left More... | |
QGraphicsItemGroup * | pathView |
the feasible path More... | |
QGraphicsPathItem * | select |
highlighted line segment (or nullptr) More... | |
Friends | |
class | CellView |
Additional Inherited Members | |
![]() | |
void | resetView () |
reset zoom to default More... | |
void | setResetButtonEnabled () |
enabled reset button More... | |
void | setupMatrix () |
set up transformation matrix to account for zoom,rotate,scroll More... | |
void | print () |
print the contents of the graphics scene More... | |
void | saveAs () |
save the contents of the graphics scene to disk (as PDF, or SVG) More... | |
void | rotateLeft (double angle=10) |
rotate the scene to the left More... | |
void | rotateRight (double angle=10) |
rotate the scene to the right More... | |
int | rotation () const |
void | setRotation (double angle) |
update rotation angle More... | |
![]() | |
void | resizeEvent (QResizeEvent *) override |
handles window resizes; adjusts controls to new window size More... | |
void | saveAsPdf (QString file) |
save content of scene to a PDF file More... | |
void | saveAsSvg (QString file) |
save content of scene to an SVG file More... | |
virtual void | render (QPainter *painter, QRectF target=QRectF()) |
render the scene into a QPainter used for printing and saving to disk More... | |
QMatrix | baseMatrix () |
![]() | |
static void | setPenWidth (QGraphicsItem *item, double width) |
update the pen width of a graphics item More... | |
static void | addLine (QPainterPath &ppath, const QLineF &line) |
add a line segment to a QPainterPath More... | |
static void | addPolygon (QPainterPath &ppath, const QPolygonF &poly) |
add a polygon curve segment to a QPainterPath More... | |
static void | addPoint (QPainterPath &ppath, const QPointF &point, double diameter=1.0) |
add a dot to a QPainterPath More... | |
![]() | |
QGraphicsView * | graphicsView |
the embedded QGraphicsView More... | |
QGraphicsScene * | scene |
scene that is displayed by graphicsView More... | |
bool | isFlipped |
true if the scene should be flipped vertically More... | |
int | zoomStepMouse |
zoom step for mouse wheel More... | |
int | zoomStepDefault |
default zoom step More... | |
QToolButton * | resetButton |
the reset button More... | |
QSlider * | zoomSlider |
the slider control for zoom More... | |
QSlider * | rotateSlider |
the slider control for rotate More... | |
GraphicsHoverLineItem * | selected_item |
the currently selected mouse sensitve polyon segment (or nullptr) More... | |
![]() | |
static const QPen | PEN_SELECT |
pen for drawing selected polygon segment More... | |
static const int | ROTATE_DEFAULT_VALUE = 0 |
what this? More... | |
static const QStringList | OUTPUT_FILTERS |
file name filters for save dialog More... | |
FreeSpaceView::FreeSpaceView | ( | QWidget * | parent = 0 | ) |
default constructor
parent | paren widget (optional) |
Definition at line 31 of file freespaceview.cpp.
|
virtual |
destructor; releases all items
Definition at line 51 of file freespaceview.cpp.
|
private |
add a grid line to the graphics scene
line | grid line |
style | drawing style |
Definition at line 508 of file freespaceview.cpp.
|
private |
calculates one boundary line
a | start of line in free-space coordinates |
b | end of line in free-space coordinates |
i | grid column |
j | grid row |
Definition at line 1029 of file freespaceview.cpp.
|
slot |
update free-space diagram when epsilon changes. If the curve algorithm is selected, compute a feasible path, too. All other algorithms must be triggered by the user.
epsilon | new value of epsilon |
Definition at line 161 of file freespaceview.cpp.
|
private |
create a boundary rectangle for a cell
i | grid column |
j | grid row |
result | holds the boundary lines on return |
Definition at line 956 of file freespaceview.cpp.
|
private |
compute the transformation for drawing an ellipse
i | grid column |
j | grid row |
Definition at line 463 of file freespaceview.cpp.
|
private |
create a set of line segments for reachability intervals
i | grid column |
j | grid row |
result | holds the reachability intervals on return |
Definition at line 982 of file freespaceview.cpp.
|
signal |
raised when after decision variant of the curve algorithm
yes | if there is a feasible path for the curve algorithm |
|
private |
highlight a line segment
loc | location on screen |
a | identifier |
b | identifier |
Definition at line 561 of file freespaceview.cpp.
|
overridevirtual |
release graphics items that are currently not drawn implements empty method from super-class
Reimplemented from frechet::view::BaseView.
Definition at line 134 of file freespaceview.cpp.
|
private |
get a free-space cell view
i | grid column |
j | grid row |
Definition at line 149 of file freespaceview.cpp.
|
slot |
hide results of the k-Frechet algorithms. Remove gray-out, display all components in their original color.
Definition at line 536 of file freespaceview.cpp.
|
slot |
hilite on point inf the diagram (used for animation only)
p | a point |
Definition at line 629 of file freespaceview.cpp.
|
signal |
raised when the mouse moves over a highlighted segment This signal triggers the display of associated line items.
loc | location on screen |
a | identifier |
b | identifier |
|
slot |
updatee free-space diagram when a new algorithm is selected. For example, for the k-Frechet algorithm, components are color-coded.
alg | next algorithm |
Definition at line 1038 of file freespaceview.cpp.
|
slot |
highlight a segment of the feasible path
loc | location on screen |
a | identifier |
b | identifier |
Definition at line 556 of file freespaceview.cpp.
void FreeSpaceView::populateScene | ( | ) |
create the grid lines and an array of CellView objects
Definition at line 59 of file freespaceview.cpp.
|
virtualslot |
load settings from application preferences
settings | application preferences |
group | section where to store settings |
Definition at line 648 of file freespaceview.cpp.
|
virtualslot |
store settings to application preferences
settings | application preferences |
group | section where to store settings |
Definition at line 639 of file freespaceview.cpp.
|
overridevirtual |
called when the mouse hovers over a sensitve line item
Reimplemented from frechet::view::BaseView.
Definition at line 541 of file freespaceview.cpp.
|
inline |
Definition at line 227 of file freespaceview.h.
|
slot |
update display of bounding rects
show | whether to show bounding rects |
|
slot |
show the result of the k-Frechet greedy algorithms. Highlights all components that are part of the solution, other components are grayed.
Definition at line 524 of file freespaceview.cpp.
|
slot |
show the optimal result of the k-Frechet (brute-force) algorithms. Highlights all components that are part of the solution, other components are grayed.
Definition at line 530 of file freespaceview.cpp.
|
slot |
show or hide feasible path
show | whether to show the feasible path |
Definition at line 295 of file freespaceview.cpp.
|
private |
show the result of a k-Frechet algorithm
resultSet | a set of highlighted components |
Definition at line 429 of file freespaceview.cpp.
|
private |
update bounding rectangles
Definition at line 345 of file freespaceview.cpp.
|
private |
update component intervals (k-Frechet only)
Definition at line 390 of file freespaceview.cpp.
|
private |
update free-space view in response to a change of epsilon
eps | new value of epsilon |
Definition at line 228 of file freespaceview.cpp.
|
staticprivate |
validity test for a transformation. If transform parameters become excessively large, the ellipse is replaced by an approximating polygon.
tf | an affine transformation |
Definition at line 488 of file freespaceview.cpp.
|
staticprivate |
validity test for a transformation
x | entry in a transformation matrix |
Definition at line 501 of file freespaceview.cpp.
|
friend |
Definition at line 320 of file freespaceview.h.
|
private |
true, if bounding rectangle are shown
Definition at line 324 of file freespaceview.h.
|
static |
brush (fill color) for content area
Definition at line 209 of file freespaceview.h.
|
static |
brush (fill color) for content area
Definition at line 210 of file freespaceview.h.
|
static |
color for content area (except k-Frechet)
Definition at line 213 of file freespaceview.h.
QPen frechet::view::FreeSpaceView::AREA_PEN |
pen for content area
Definition at line 206 of file freespaceview.h.
QPen frechet::view::FreeSpaceView::BOUNDS_PEN |
pen for bounding rectangles
Definition at line 207 of file freespaceview.h.
|
private |
free space areas for all cells (i,j)
Definition at line 330 of file freespaceview.h.
|
private |
a palette of colors, used to color-code components for the k-Frechet algorithm
Definition at line 327 of file freespaceview.h.
QPen frechet::view::FreeSpaceView::GRID_PEN[4] |
pens for drawing grid lines with different styles
Definition at line 205 of file freespaceview.h.
|
private |
k-Frechet: show component intervals below and to the left
Definition at line 333 of file freespaceview.h.
|
static |
used for disabled components (k-Frechet)
Definition at line 212 of file freespaceview.h.
|
private |
true, if there is a feasible path
Definition at line 322 of file freespaceview.h.
QPen frechet::view::FreeSpaceView::PATH_PEN |
pen for feasible path
Definition at line 208 of file freespaceview.h.
|
private |
the feasible path
Definition at line 335 of file freespaceview.h.
|
private |
highlighted line segment (or nullptr)
Definition at line 337 of file freespaceview.h.
|
static |
max. value for affine transforms
Definition at line 211 of file freespaceview.h.