14 #include <boost/smart_ptr.hpp> 16 namespace frechet {
namespace fs {
92 typedef boost::shared_ptr<FreeSpace>
ptr;
161 Q_ASSERT(x>=0 && x <
n);
162 Q_ASSERT(y>=0 && y <
m);
163 return cells.at(x,y);
171 Q_ASSERT(x>=0 && x <
n);
172 Q_ASSERT(y>=0 && y <
m);
173 return cells.at(x,y);
264 template<
typename Float>
298 template<
typename Float>
310 #endif // FREESPACE_H Components & components()
static const QRectF UNIT_RECT
the unit rectangle [0,1]x[0,1]
bool cellFull(int i, int j) const
test if a cell is completely covered by the free-space area
bool isParallel(int i, int j) const
test if the free-space area of a cell is a degenerate ellipse, i.e. two parallel lines....
static void fixBorderCase(data::Interval *N, data::Interval *E, data::Interval *S, data::Interval *W)
fix border case at the joint of four intervals
size_t component(int i, int j)
find the component ID for a cell. Empty cells return NO_COMPONENT.
QRectF segmentBounds(int i, int j)
bool wrapTop() const
if Q is a closed curve, the free space diagram wraps at top edge
global definitions for all algorithms.
double determinant(int i, int j) const
void calculateFreeSpace(double epsilon)
calculate all free space intervals
bool isAlmostParallel(int i, int j) const
test if the free-space area of a cell is a almost degenerate ellipse, This is the case if the determi...
static void calculateFreeSpaceSegment(const Point &p, const Point &q, const Point &r, double epsilon, data::Interval &result)
compute intervals for one point and segment. As parameters we expect a point on one curve (P,...
static const double DET_MINIMUM
minimum determinant to avoid roundoff errors
a pair of horizonal / vertical intervals.
const data::Interval & LB(bool l)
Components _components
tracks connected components for k-Frechet algorithm
data::IntervalPair bounds
bool cellEmptyIntervals(int i, int j) const
test if a cell is empty
QPointF Point
a point in the plane; with double floating point precision. This type is heavily used throughout all ...
Free-Space connected components and their projections to the domain axes.
QPolygonF Curve
a polygonal curve in the plane; with double floating point precision. This type is heavily used throu...
A simple two-dimensional array of fixed size.
std::list< data::Interval > collectFreeVerticalIntervals(int i) const
traverse one column of the free-space and find all connected intervals. This method is needed by the ...
bool wrapRight() const
if P is a closed curve, the free space diagram wraps at right edge
data::Array2D< Cell > cells
free line segments as Intervals subset of [0..1]
const int m
number of vertexes in Q
bool cellEmptyBounds(int i, int j) const
test if the bounding box of a cell is empty
void calculateBounds(double epsilon)
calculate the bounding boxes of the free-space areas (k-Frechet only)
The FreeSpace class models the Free-Space Diagram calculated from two curves.
holds data for one cell of the free-space diagram
component_id_t representative(int i, int j)
find the component ID of a cell
const int n
number of vertexes in P
an interval of two double values.
FreeSpace(const Curve &ap, const Curve &aq)
default constructor with two input curves
static const component_id_t NO_COMPONENT
empty cells have an invalid component ID
Number abs(const Number &x)
abs() function template for arbitrary numerical types
const Curve & Q
second input curve
void calculateEllipseBoundaries(const Point &p1, const Point &p2, const Point &q1, const Point &q2, double epsilon, double lambda[2])
compute the bounding box of one cell in the free-space are. As parameters we expect two segments of P...
boost::shared_ptr< FreeSpace > ptr
smart pointer to FreeSpace object
Cell & cell(int x, int y)
const Curve & P
first input curve
const Cell & cell(int x, int y) const