32#if defined(FrechetShortcut_RECURSES)
33#error Recursive header files inclusion detected in FrechetShortcut.h
36#define FrechetShortcut_RECURSES
38#if !defined FrechetShortcut_h
40#define FrechetShortcut_h
44#include "DGtal/base/Common.h"
45#include "DGtal/base/ConceptUtils.h"
46#include "DGtal/kernel/PointVector.h"
47#include "DGtal/arithmetic/IntegerComputer.h"
48#include <boost/icl/interval_set.hpp>
53#include "DGtal/geometry/curves/SegmentComputerUtils.h"
106 template <typename TIterator,typename TInteger = typename IteratorCirculatorTraits<TIterator>::Value::Coordinate>
150 } occulter_attributes;
300 Cone(
double x,
double y,
double x0,
double y0,
double x1,
double y1);
362 static bool isBetween(
double i,
double a,
double b,
double n)
365 return (i>=a && i<=b);
367 return ((i>=a && i<=n) || (i>=0 && i<=b));
398 double x1,
double y1,
double r1,
399 double *xi,
double *yi,
400 double *xi_prime,
double *yi_prime)
402 double a, dx, dy, d, h, rx, ry;
419 std::cerr <<
"Warning : the two circles do not intersect -> should never happen" << std::endl;
422 if (d < fabs(r0 - r1))
434 a = ((r0*r0) - (r1*r1) + (d*d)) / (2.0 * d) ;
437 x2 = x0 + (dx * a/d);
438 y2 = y0 + (dy * a/d);
443 h = sqrt((r0*r0) - (a*a));
481 static int circleTangentPoints(
double x,
double y,
double x1,
double y1,
double r1,
double *xi,
double *yi,
482 double *xi_prime,
double *yi_prime)
484 double x0 = (x+x1)/2;
485 double y0 = (y+y1)/2;
486 double r0 = sqrt((x-x1)*(x-x1) + (y-y1)*(y-y1))/2;
518 return atan(alpha)+2*M_PI;
521 return atan(alpha)+M_PI;
543 return acos((
double)ic.
dotProduct(u,v)/(u.norm()*v.norm()));
641 static int rot(
int d,
int quad)
931 template <
typename TIterator,
typename TInteger>
945#include "DGtal/geometry/curves/FrechetShortcut.ih"
951#undef FrechetShortcut_RECURSES
const FrechetShortcut< ConstIterator, Integer > * myS
boost::icl::interval_set< double > IntervalSet
void updateBackPathFirstQuad(int d, const ConstIterator &)
std::map< ConstIterator, occulter_attributes > occulter_list
Backpath & operator=(const Backpath &other)
IntervalSet myForbiddenIntervals
Backpath(const Backpath &other)
Backpath(const FrechetShortcut< ConstIterator, Integer > *s, int q)
occulter_list myOcculters
void intersectCones(Cone c)
Cone & operator=(const Cone &c)
void selfDisplay(std::ostream &out) const
Cone(const Cone &c)=default
Cone(double a0, double a1)
Cone intersectConesSimple(Cone c)
Cone(double x, double y, double x0, double y0, double x1, double y1)
Aim: On-line computation Computation of the longest shortcut according to the Fréchet distance for a ...
std::string className() const
FrechetShortcut & operator=(const Self &other)
FrechetShortcut< std::reverse_iterator< ConstIterator >, Integer > Reverse
ConstIterator begin() const
IteratorCirculatorTraits< ConstIterator >::Value Point
bool operator!=(const Self &other) const
Vector::Coordinate Coordinate
Reverse getReverse() const
IteratorCirculatorTraits< ConstIterator >::Value Vector
FrechetShortcut(const Self &other)
void selfDisplay(std::ostream &out) const
void init(const ConstIterator &it)
FrechetShortcut(double error)
FrechetShortcut getSelf()
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
bool operator==(const Self &other) const
ConstIterator end() const
std::vector< Backpath > myBackpath
FrechetShortcut< ConstIterator, Integer > Self
bool testUpdateBackpath()
Aim: This class gathers several types and methods to make computation with integers.
Integer dotProduct(const Vector2I &u, const Vector2I &v) const
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...