![]() |
Fréchet View
1.6.0
A Tool for Exploring Fréchet Distance Algorithms
|
displays one cell of the free-space diagram.
A cell is either empty, completely covered, or displays a section of an ellipse.
Content color is variable (k-Frechet uses colors for components).
Optionally, reachable intervals are shown at the border of the cell.
Optionally, the bounding rectangle of the content area is shown.
Ellipses are implemented as a circle object, that is applied an affine transformation (see FreeSpaceView::createEllipseTransform). The resulting ellipse is clipped at the bounds of each cell.
Degenerate ellipses, which become excessively large, are replaced by an approximated polygon (i.e. two parallel lines). The same is true if the ellipse covers the cell completely.
Definition at line 40 of file freespaceview.h.
#include <freespaceview.h>
Inherits QGraphicsItemGroup.
Public Types | |
typedef data::Array2D< CellView * > | Matrix |
an array of cell views More... | |
typedef boost::shared_ptr< Matrix > | MatrixPtr |
pointer to an array of cell views More... | |
Public Member Functions | |
CellView (FreeSpaceView *parent, int i, int j) | |
default constructor More... | |
virtual | ~CellView () |
destructor More... | |
void | setColor (QColor areaColor, QColor borderColor=QColor()) |
update drawing colors More... | |
void | update (double eps, bool showBounds, QLineF bounds[4]) |
update display More... | |
virtual QPainterPath | shape () const |
virtual QRectF | boundingRect () const |
bool | dropUnusedItems () |
release graphics items that are not currently displayed More... | |
Private Types | |
enum | What { MASK = 0x00f, NOTHING = 0x00, POLY = 0x01, ELLIPSE = 0x02, BOUNDS = 0x10, ELLIPSE_AND_BOUNDS = ELLIPSE|BOUNDS, POLY_AND_BOUNDS = POLY|BOUNDS } |
display mode; what is displayed? Flags can be combined (except Poly and Ellipse). More... | |
Private Member Functions | |
QPolygonF | createPolygon (int i, int j, bool *thin) |
create a polygon that draws the content area More... | |
QGraphicsPolygonItem * | getPoly () |
QGraphicsEllipseItem * | getEllipse () |
QGraphicsLineItem * | getBounds (int i) |
void | setBounds (QLineF bounds[4]) |
update bounding rectangle More... | |
void | dodraw (What what) |
update content More... | |
void | dropUnusedItem (QGraphicsItem **item) |
release an unused item More... | |
Static Private Member Functions | |
static void | setBrushColor (QAbstractGraphicsShapeItem *item, QColor col) |
update brush (fill) color of a graphics item More... | |
static void | setPenColor (QAbstractGraphicsShapeItem *item, QColor col) |
update pen (edge) color of a graphics item More... | |
static void | setBoundsPenColor (QGraphicsLineItem **bounds, int len, QColor col) |
update pen color of several graphics item More... | |
static void | setPenStyle (QAbstractGraphicsShapeItem *item, Qt::PenStyle style) |
update pen style (dotted,solid,...) of a graphics item More... | |
static void | setPenStyleWidth (QAbstractGraphicsShapeItem *item, Qt::PenStyle style, float width) |
update pen style and pen width of a graphics item More... | |
Private Attributes | |
int | i |
column index in free-space grid More... | |
int | j |
row index in free-space grid More... | |
FreeSpaceView * | parent |
pointer to parent More... | |
QRectF | cellBounds |
bounding rectangle More... | |
QPainterPath | clipShape |
shape used for clipping ellipses More... | |
QGraphicsPolygonItem * | _poly |
content area may be a polygon (created on demand) More... | |
QGraphicsEllipseItem * | _ellipse |
bool | useEllipse |
true if an ellipse is to be shown More... | |
QGraphicsLineItem * | _bounds [4] |
boundary lines of the content area More... | |
enum frechet::view::CellView::What | what |
Static Private Attributes | |
static const double | DET_MINIMUM |
determines when a hige ellipse is replaced by two parallel lines More... | |
static const double | MAX_DIAMETER = 1e5 |
what's this? More... | |
Friends | |
class | FreeSpaceView |
an array of cell views
Definition at line 83 of file freespaceview.h.
typedef boost::shared_ptr<Matrix> frechet::view::CellView::MatrixPtr |
pointer to an array of cell views
Definition at line 85 of file freespaceview.h.
|
private |
display mode; what is displayed? Flags can be combined (except Poly and Ellipse).
Definition at line 69 of file freespaceview.h.
CellView::CellView | ( | FreeSpaceView * | parent, |
int | i, | ||
int | j | ||
) |
default constructor
parent | parent widget |
i | column index in free-space grid |
j | row index in free-space grid |
Definition at line 660 of file freespaceview.cpp.
|
virtual |
destructor
Definition at line 676 of file freespaceview.cpp.
|
inlinevirtual |
Definition at line 117 of file freespaceview.h.
|
private |
create a polygon that draws the content area
i | grid column |
j | grid row |
thin | when parallel lines are close |
Definition at line 1042 of file freespaceview.cpp.
|
private |
update content
what | what should be displayed? |
Definition at line 814 of file freespaceview.cpp.
|
private |
release an unused item
item | handle to graphics item |
Definition at line 878 of file freespaceview.cpp.
bool CellView::dropUnusedItems | ( | ) |
release graphics items that are not currently displayed
Definition at line 886 of file freespaceview.cpp.
|
private |
i | 0 through 3 |
Definition at line 714 of file freespaceview.cpp.
|
private |
Definition at line 695 of file freespaceview.cpp.
|
private |
Definition at line 684 of file freespaceview.cpp.
|
private |
update bounding rectangle
Definition at line 728 of file freespaceview.cpp.
|
staticprivate |
update pen color of several graphics item
bounds | array of graphics items |
len | number of items |
col | new pen color |
Definition at line 771 of file freespaceview.cpp.
|
staticprivate |
update brush (fill) color of a graphics item
item | a graphics item |
col | new brush color |
Definition at line 783 of file freespaceview.cpp.
void CellView::setColor | ( | QColor | areaColor, |
QColor | borderColor = QColor() |
||
) |
update drawing colors
areaColor | color for content area |
borderColor | color for borders (by default is equal to areaColor) |
Definition at line 744 of file freespaceview.cpp.
|
staticprivate |
update pen (edge) color of a graphics item
item | a graphics item |
col | new pen color |
Definition at line 762 of file freespaceview.cpp.
|
staticprivate |
update pen style (dotted,solid,...) of a graphics item
item | a graphics item |
style | new style |
Definition at line 792 of file freespaceview.cpp.
|
staticprivate |
update pen style and pen width of a graphics item
item | a graphics item |
style | new style |
width | new pen width |
Definition at line 801 of file freespaceview.cpp.
|
inlinevirtual |
Definition at line 113 of file freespaceview.h.
void CellView::update | ( | double | eps, |
bool | showBounds, | ||
QLineF | bounds[4] | ||
) |
update display
eps | new value of epsilon |
showBounds | show bounding rect? |
bounds | content area bounding rectangle |
Definition at line 899 of file freespaceview.cpp.
|
friend |
Definition at line 125 of file freespaceview.h.
|
private |
boundary lines of the content area
Definition at line 63 of file freespaceview.h.
|
private |
content area may be a (clipped) ellipse (created on demand). this is a circle with an affine transform
Definition at line 59 of file freespaceview.h.
|
private |
content area may be a polygon (created on demand)
Definition at line 56 of file freespaceview.h.
|
private |
bounding rectangle
Definition at line 51 of file freespaceview.h.
|
private |
shape used for clipping ellipses
Definition at line 53 of file freespaceview.h.
|
staticprivate |
determines when a hige ellipse is replaced by two parallel lines
Definition at line 127 of file freespaceview.h.
|
private |
column index in free-space grid
Definition at line 44 of file freespaceview.h.
|
private |
row index in free-space grid
Definition at line 46 of file freespaceview.h.
|
staticprivate |
what's this?
Definition at line 129 of file freespaceview.h.
|
private |
pointer to parent
Definition at line 48 of file freespaceview.h.
|
private |
true if an ellipse is to be shown
Definition at line 61 of file freespaceview.h.
|
private |