![]() |
Fréchet View
1.6.0
A Tool for Exploring Fréchet Distance Algorithms
|
performs mappings to and from the free-space grid
Calculations are done in three coordinate systems:
(1) the unit square [0..1]x[0..1] free-space segments are usually in this coordinate system
(2) [0..n]x[0..m] each free-space cell is mapped to its location in the grid with each segment having length 1
2-intervals for the k-Frechet algorithm are expressed in this coordinate system
(3) [0..|P|]x[0..|Q|] each free-space cell is scaled to arc-length. this is the coordinate system used for visualisation.
The Grid class provides functions for converting from one coordinate system to another.
In particular from: [1] to [2] and [3] [2] to [3] and back to [1]
#include <grid.h>
Public Types | |
typedef boost::shared_ptr< Grid > | ptr |
smart pointer to a Grid object More... | |
Public Member Functions | |
Grid () | |
empty constructor More... | |
void | setCurves (const Curve &P, const Curve &Q) |
calculate grid from input curves More... | |
const GridAxis & | hor () const |
const GridAxis & | vert () const |
GridAxis & | hor () |
GridAxis & | vert () |
QSizeF | size () const |
QSizeF | extent () const |
QRectF | cellBounds (int i, int j) const |
Point | mapPoint (Point p) |
map a point from [0..n]x[0..m] to the grid coordinates [0..|P|]x[0..|Q|] More... | |
QLineF | mapLine (QLineF l) |
map a line segment from [0..n]x[0..m] to the grid coordinates [0..|P|]x[0..|Q|] More... | |
QRectF | mapRect (QRectF r) |
map a rectangle from [0..n]x[0..m] to the grid coordinates [0..|P|]x[0..|Q|] More... | |
Curve | mapCurve (Curve c) |
map a sequence of line segments from [0..n]x[0..m] to the grid coordinates [0..|P|]x[0..|Q|] More... | |
QLineF | verticalGridLine (int i) |
map a vertical line More... | |
QLineF | horizontalGridLine (int j) |
map a horizontal line More... | |
QRectF | sceneRect () |
Static Public Member Functions | |
static Point | mapToPoint (const Curve &C, double x) |
given a polygonal curve and an offset, compute the point on the curve More... | |
static QLineF | mapToSegment (const Curve &C, double x1, double x2) |
given a polygonal curve and two offsets, compute the corresponding line segment More... | |
static Curve | mapToSequence (const Curve &C, double x1, double x2) |
given a polygonal curve and two offsets, compute the sequence of line segment connecting both offsets More... | |
static Curve | mapToSequence (const Curve &C, const std::vector< double > &seq) |
given a polygonal curve and list of offsets, compute the sequence of line segment connects the offsets More... | |
Private Attributes | |
GridAxis | _hor |
arc lengths of P == horizontal grid coordinates More... | |
GridAxis | _vert |
arc lengths of Q == vertical grid coordinates More... | |
typedef boost::shared_ptr<Grid> frechet::fs::Grid::ptr |
QRectF Grid::cellBounds | ( | int | i, |
int | j | ||
) | const |
QSizeF Grid::extent | ( | ) | const |
|
inline |
|
inline |
QLineF Grid::horizontalGridLine | ( | int | j | ) |
QLineF Grid::mapLine | ( | QLineF | l | ) |
QRectF Grid::mapRect | ( | QRectF | r | ) |
|
static |
QRectF Grid::sceneRect | ( | ) |
|
inline |
|
inline |
|
inline |
QLineF Grid::verticalGridLine | ( | int | i | ) |
|
private |
|
private |