![]() |
Fréchet View
1.6.0
A Tool for Exploring Fréchet Distance Algorithms
|
displays input curves P and Q.
Curves can be drawn separated for better readability.
If the algorithm for simple polygons is appplied, c-diagonals and t-diagonals are displayed.
Polygon edges and diagonals are mouse sensitive. When the mouse hovers over and edge (or diagonal) the corresponding edges of the feasible path are highlighted.
Definition at line 22 of file curveview.h.
#include <curveview.h>
Inherits frechet::view::BaseView.
Public Slots | |
void | setSeparateCurves (bool sep) |
update the display to show curves separately, or not More... | |
void | onAlgorithmChanged (int alg) |
called when the user changes the current algorithm. Update the curve display accordingly (e.g. show, or hide diagonals). More... | |
void | onHiliteSegment (int loc, int a, int b) |
called when a line segment should be highlighted 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... | |
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 | hiliteSegment (int loc, int a, int b) |
raised when a mouse sensitive line segment is highlighted. Parameters identify the location of the line segment. More... | |
Public Member Functions | |
CurveView (QWidget *parent=0) | |
default constructor with parent More... | |
void | populateScene (const Curve &P, const Curve &Q, frechet::poly::Algorithm::ptr alg) |
set up the graphics scene with polygonal curves 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... | |
bool | separateCurves () const |
virtual void | segmentSelected (GraphicsHoverLineItem *item) override |
called when the mouse hovers over a sensitive line segment. Updates the corresponding line segments. More... | |
![]() | |
BaseView (QWidget *parent=0, QString title="", bool showRotate=true) | |
constructore with parent and title More... | |
QGraphicsView * | view () const |
Private Member Functions | |
void | doHiliteSegment (GraphicsHoverLineItem::Location loc, int a, int b) |
highlight a line segment More... | |
QGraphicsItemGroup * | addPolygonToScene (const Curve &poly, QPen pen, GraphicsHoverLineItem::Location hover) |
add a polygon curve to the graphics scene More... | |
QGraphicsItemGroup * | addSegmentsToScene (QGraphicsItemGroup *group, frechet::poly::Triangulation::Edge_range d, const frechet::poly::Segments &exclude, bool with_edges, QPen pen, GraphicsHoverLineItem::Location hover) |
add a number of line segments to the graphics scene More... | |
QGraphicsItemGroup * | addSegmentsToScene (QGraphicsItemGroup *group, const frechet::poly::Segments &d, bool with_edges, QPen pen, const Curve &P, GraphicsHoverLineItem::Location hover) |
add a number of line segments to the graphics scene More... | |
QGraphicsLineItem * | createLineItem (QLineF line, QPen pen, frechet::poly::Segment seg, QGraphicsItemGroup *group, GraphicsHoverLineItem::Location hover) |
create a line segment graphics item More... | |
Private Attributes | |
bool | _separate |
draw curves separately? More... | |
QGraphicsItemGroup * | polygon_a |
graphics items for (boundary of) curve P More... | |
QGraphicsItemGroup * | polygon_b |
graphics items for (boundary of) curve Q More... | |
QGraphicsItemGroup * | diagonals_a |
graphics items for diagonals of curve P More... | |
QGraphicsItemGroup * | diagonals_b |
QRectF | polygon_bounds |
boundary rectangle for both curves More... | |
QGraphicsPathItem * | select_a |
highlited items for curve P More... | |
QGraphicsPathItem * | select_b |
highlited items for curve Q More... | |
Static Private Attributes | |
static const QPen | PEN_A |
pen for drawing the curve P More... | |
static const QPen | PEN_B |
pen for drawing the curve Q More... | |
static const QPen | PEN_C_DIAGS |
pen for drawing the c-diagonals in P More... | |
static const QPen | PEN_T_DIAGS |
pen for drawing the t-diagonals in P More... | |
static const QPen | PEN_PASSIVE_DIAGS |
static const double | SEPARATOR = 0.06 |
distance when curves are displayed separately More... | |
Friends | |
class | GraphicsHoverLineItem |
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 | dropUnusedItems () |
clean up graphics scene items after free-space is modified implemented by FreeSpaceView. 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... | |
CurveView::CurveView | ( | QWidget * | parent = 0 | ) |
default constructor with parent
parent | parent widget (optional) |
Definition at line 21 of file curveview.cpp.
|
private |
add a polygon curve to the graphics scene
poly | the polygon curve |
pen | pen for drawing the curve |
hover | hover location |
Definition at line 106 of file curveview.cpp.
|
private |
add a number of line segments to the graphics scene
group | group to add the items to |
d | a number of polygon edges |
exclude | set of segments to exclude |
with_edges | include outer edges? |
pen | pen for drawing |
hover | hover location |
|
private |
add a number of line segments to the graphics scene
group | group to add the items to |
d | a number of polygon edges |
with_edges | include outer edges? |
pen | pen for drawing |
P | polygonal curve |
hover | hover location |
|
private |
create a line segment graphics item
line | the line segment |
pen | pen for drawing |
seg | the associated polygon segment |
group | p group to add the items to |
hover | hover location |
Definition at line 167 of file curveview.cpp.
|
private |
highlight a line segment
loc | location on screen |
a | identifier |
b | identifier |
Definition at line 273 of file curveview.cpp.
|
signal |
raised when a mouse sensitive line segment is highlighted. Parameters identify the location of the line segment.
loc | location on screen |
a | identifier |
b | identifier |
|
slot |
called when the user changes the current algorithm. Update the curve display accordingly (e.g. show, or hide diagonals).
alg | current algorithm |
Definition at line 355 of file curveview.cpp.
|
slot |
called when a line segment should be highlighted
loc | location on screen |
a | identifier |
b | identifier |
Definition at line 268 of file curveview.cpp.
void CurveView::populateScene | ( | const Curve & | P, |
const Curve & | Q, | ||
frechet::poly::Algorithm::ptr | alg | ||
) |
set up the graphics scene with polygonal curves
P | the first input curve |
Q | the second input curve |
alg | the algorithm for simple polygons |
Definition at line 32 of file curveview.cpp.
|
virtual |
load settings from application preferences
settings | application preferences |
group | section where to store settings |
Reimplemented from frechet::view::BaseView.
Definition at line 189 of file curveview.cpp.
|
virtual |
store settings to application preferences
settings | application preferences |
group | section where to store settings |
Reimplemented from frechet::view::BaseView.
Definition at line 180 of file curveview.cpp.
|
overridevirtual |
called when the mouse hovers over a sensitive line segment. Updates the corresponding line segments.
item | the line segment |
Reimplemented from frechet::view::BaseView.
Definition at line 252 of file curveview.cpp.
|
inline |
Definition at line 56 of file curveview.h.
|
slot |
update the display to show curves separately, or not
sep | true if the curves should be displayed separately |
Definition at line 200 of file curveview.cpp.
|
friend |
Definition at line 178 of file curveview.h.
|
private |
draw curves separately?
Definition at line 115 of file curveview.h.
|
private |
graphics items for diagonals of curve P
Definition at line 119 of file curveview.h.
|
private |
graphics items for diagonals of curve Q
Definition at line 120 of file curveview.h.
|
staticprivate |
pen for drawing the curve P
Definition at line 107 of file curveview.h.
|
staticprivate |
pen for drawing the curve Q
Definition at line 108 of file curveview.h.
|
staticprivate |
pen for drawing the c-diagonals in P
Definition at line 109 of file curveview.h.
|
staticprivate |
pen for drawing the diagonals in Q
Definition at line 111 of file curveview.h.
|
staticprivate |
pen for drawing the t-diagonals in P
Definition at line 110 of file curveview.h.
|
private |
graphics items for (boundary of) curve P
Definition at line 117 of file curveview.h.
|
private |
graphics items for (boundary of) curve Q
Definition at line 118 of file curveview.h.
|
private |
boundary rectangle for both curves
Definition at line 122 of file curveview.h.
|
private |
highlited items for curve P
Definition at line 124 of file curveview.h.
|
private |
highlited items for curve Q
Definition at line 125 of file curveview.h.
|
staticprivate |
distance when curves are displayed separately
Definition at line 113 of file curveview.h.