User Manual, rename tags, add example

This commit is contained in:
Andreas Fabri 2024-06-18 09:22:29 +01:00
parent e301f37428
commit c50619822a
14 changed files with 88 additions and 42 deletions

View File

@ -1,5 +1,5 @@
/*! /*!
\ingroup PkgPolylineDistanceConcepts \ingroup PkgFrechetDistanceConcepts
\cgalConcept \cgalConcept
The concept `FrechetDistanceTraits` defines the requirements ... The concept `FrechetDistanceTraits` defines the requirements ...

View File

@ -5,32 +5,61 @@ namespace CGAL {
\anchor Chapter_dD_Frechet_distance \anchor Chapter_dD_Frechet_distance
\cgalAutoToc \cgalAutoToc
\author André Nusser, Marvin Künnemann, and Karl Bringmann \authors André Nusser, Marvin Künnemann, and Karl Bringmann
This chapter describes the ...
\section secPolylineDistanceDefinitions Definitions <center>
<img src="FrechetTeaser.jpg" style="max-width:70%;"/>
</center>
Section on definitions here ... This chapter provides functions for computing the Fréchet distance of polylines in any dimension under Euclidean metric.
\section secPolylineDistanceExamples Examples \section secFrechetDistanceIntroduction Introdution
\subsection subsecPolylineDistanceFirstExample First Example The Fréchet distance .....
The following example shows ...
\cgalExample{Frechet_distance/Frechet_distance_2.cpp}
\cgalFigureBegin{figRefId,pdist-pkg-small.png} \cgalFigureBegin{figRefId,pdist-pkg-small.png}
Here you can put the caption Here you can put the caption
\cgalFigureEnd \cgalFigureEnd
\section secFrechetDistanceAPI API
\subsection subsecPolylineDistanceImplementation Implementation History The function `continuous_Frechet_distance()` computes an approximation of the Fréchet distance between two polylines,
up to a given approximation error. It returns an interval.
The function `continuous_Frechet_distance_less_than()` decides if the Fréchet distance
between two polylines is smaller than a given bound.
An intial version using floating point arithmetic was developed by the authors. Both functions have as template parameter a traits class defining the dimension and the point type.
André Nusser, together with Sebastien Loriot and Andreas Fabri introduced The traits classes have as template parameter a kernel. This may be a kernel such as `Simple_cartesian`
interval arithmetic and square root extensions to achieve a certified result. with a floating point number type, or a filtered kernel. In both cases the result is guaranteed to be correct.
\section secFrechetDistanceImplementation Implementation
Internally all computations are done using interval arithmetic. In case of filter failures
the algorithm switches to the usage of square root extensions.
\section secFrechetDistanceExamples Examples
\subsection subsecFrechetDistanceFirstExample Decision for 2D Polylines
The following example shows ...
\cgalExample{Frechet_distance/Frechet_distance_2.cpp}
subsection subsecFrechetDistanceSecondExample Distance Computation for 3D Polylines
The following example shows ...
\cgalExample{Frechet_distance/Frechet_distance_3.cpp}
\subsection subsecFrechetDistanceImplementation Implementation History
An intial version using floating point arithmetic was developed by the authors
while working at the Max-Planck Institute of Computer Science in Saarbrücken.
André Nusser, together with Sebastien Loriot and Andreas Fabri, introduced
the usage of interval arithmetic and square root extensions to achieve a certified result.
*/ */
} /* namespace CGAL */ } /* namespace CGAL */

View File

@ -1,21 +1,21 @@
/// \defgroup PkgPolylineDistanceRef dD Polyline Distance Reference /// \defgroup PkgFrechetDistanceRef dD Polyline Distance Reference
/// \defgroup PkgPolylineDistanceConcepts Concepts /// \defgroup PkgFrechetDistanceConcepts Concepts
/// \ingroup PkgPolylineDistanceRef /// \ingroup PkgFrechetDistanceRef
/// \defgroup PkgPolylineDistanceFunctions Functions /// \defgroup PkgFrechetDistanceFunctions Functions
/// You can add some text here if you want a description at the group level /// You can add some text here if you want a description at the group level
/// \ingroup PkgPolylineDistanceRef /// \ingroup PkgFrechetDistanceRef
/*! /*!
\addtogroup PkgPolylineDistanceRef \addtogroup PkgFrechetDistanceRef
\cgalPkgDescriptionBegin{dD Polyline Distance,PkgPolylineDistance} \cgalPkgDescriptionBegin{dD Polyline Distance,PkgFrechetDistance}
\cgalPkgPicture{pdist-pkg-small.png} \cgalPkgPicture{pdist-pkg-small.png}
\cgalPkgSummaryBegin \cgalPkgSummaryBegin
\cgalPkgAuthors{André Nusser, Marvin Künnemann, and Karl Bringmann} \cgalPkgAuthors{André Nusser, Marvin Künnemann, and Karl Bringmann}
\cgalPkgDesc{The package provides ... } \cgalPkgDesc{The package provides ... }
\cgalPkgManuals{Chapter_dD_Frechet_distance,PkgPolylineDistanceRef} \cgalPkgManuals{Chapter_dD_Frechet_distance,PkgFrechetDistanceRef}
\cgalPkgSummaryEnd \cgalPkgSummaryEnd
\cgalPkgShortInfoBegin \cgalPkgShortInfoBegin

View File

@ -0,0 +1,17 @@
#include <CGAL/Frechet_distance.h>
#include <CGAL/Frechet_distance_traits_3.h>
#include <CGAL/Simple_cartesian.h>
#include <ostream>
using Kernel = CGAL::Simple_cartesian<double?;
using Traits = CGAL::Frechet_distance_traits_3<Kernel>;
using Point = Traits::Point;
int main(int argc, char* argv[])
{
std::vector<Point> A, B;
std::pair<double> res = CGAL::continuous_Frechet_distance<Traits>(A, B, 0.000001);
std::cout << "The Frechet distance between the curves is between " << res.first << " and " << res.second << std::endl;
return 0;
}

View File

@ -35,7 +35,7 @@ namespace CGAL
{ {
/** /**
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* decides if the Frechet distance between two polylines given as a range of * decides if the Frechet distance between two polylines given as a range of
* points is less than a given distance. * points is less than a given distance.
* \param curve1 the first curve defined * \param curve1 the first curve defined
@ -63,7 +63,7 @@ bool continuous_Frechet_distance_less_than(const PointRange& curve1,
} }
/** /**
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* approximates the Fréchet distance between `curve1` and `curve2` up to an additive error * approximates the Fréchet distance between `curve1` and `curve2` up to an additive error
* of `precision` between two polylines given as a range of points. * of `precision` between two polylines given as a range of points.
* *

View File

@ -55,7 +55,7 @@ double length_of_diagonal(const Bbox_3& bb)
// TODO: Clean up Curve // TODO: Clean up Curve
/*! /*!
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* A class representing a trajectory. Additionally to the points given in the * A class representing a trajectory. Additionally to the points given in the
* input file, we also store the length of any prefix of the trajectory. * input file, we also store the length of any prefix of the trajectory.
*/ */

View File

@ -36,7 +36,7 @@ namespace internal {
// decisions // decisions
/*! /*!
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* A class representing a * A class representing a
*/ */
template <typename K> template <typename K>

View File

@ -43,7 +43,7 @@ namespace internal {
/*! /*!
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* A class representing a * A class representing a
*/ */
template <typename C> template <typename C>

View File

@ -39,7 +39,7 @@ namespace internal {
// //
/*! /*!
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* A class representing a * A class representing a
*/ */
template <typename K> template <typename K>
@ -66,7 +66,7 @@ using Boxes = std::vector<Box<K>>;
// //
/*! /*!
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* A class representing a * A class representing a
*/ */
template <typename K> template <typename K>
@ -105,7 +105,7 @@ struct Inputs {
// //
/*! /*!
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* A class representing a * A class representing a
*/ */
@ -120,7 +120,7 @@ struct Outputs {
// //
/*! /*!
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* A class representing a * A class representing a
*/ */
template <typename K> template <typename K>
@ -185,7 +185,7 @@ using QSimpleID = ID<QSimpleInterval<K>>;
// //
/*! /*!
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* A class representing a * A class representing a
*/ */
@ -200,7 +200,7 @@ struct QSimpleOutputs {
// //
/*! /*!
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* A class representing a * A class representing a
*/ */
template <typename K> template <typename K>

View File

@ -48,7 +48,7 @@ namespace internal {
/*! /*!
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* A class representing a value in the interval `[0,1]`.... * A class representing a value in the interval `[0,1]`....
*/ */
template<typename C> template<typename C>
@ -287,7 +287,7 @@ BFDirection toBFDirection(Direction direction);
// TODO: does CGAL have any replacement for this or do we want our custom type // TODO: does CGAL have any replacement for this or do we want our custom type
// here? // here?
/*! /*!
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* A class representing a * A class representing a
*/ */
@ -325,7 +325,7 @@ template <typename C>
std::ostream& operator<<(std::ostream& out, const Interval<C>& interval); std::ostream& operator<<(std::ostream& out, const Interval<C>& interval);
/*! /*!
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* Data Types for FrechetLight: * Data Types for FrechetLight:
* *
* CPoint is integral part + rational [0,1] number given as sqrt_extension * CPoint is integral part + rational [0,1] number given as sqrt_extension
@ -461,7 +461,7 @@ using CPositions = std::vector<CPosition<C>>;
using CurveID = std::size_t; using CurveID = std::size_t;
/*! /*!
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* A class representing a * A class representing a
*/ */
template <typename C> template <typename C>

View File

@ -136,7 +136,7 @@ namespace HLPred
{ {
/*! /*!
* \ingroup PkgPolylineDistanceFunctions * \ingroup PkgFrechetDistanceFunctions
* computes * computes
*/ */
template <typename C> template <typename C>

View File

@ -35,7 +35,7 @@
namespace CGAL namespace CGAL
{ {
/*! /*!
* \ingroup PkgPolylineDistanceRef * \ingroup PkgFrechetDistanceRef
* This class ... * This class ...
* \cgalModels{FrechetDistanceTraits} * \cgalModels{FrechetDistanceTraits}
* \tparam GT geometric traits class * \tparam GT geometric traits class

View File

@ -39,7 +39,7 @@
namespace CGAL namespace CGAL
{ {
/*! /*!
* \ingroup PkgPolylineDistanceRef * \ingroup PkgFrechetDistanceRef
* This class ... * This class ...
* \cgalModels{FrechetDistanceTraits} * \cgalModels{FrechetDistanceTraits}
* \tparam GT geometric traits class * \tparam GT geometric traits class

View File

@ -37,7 +37,7 @@
namespace CGAL namespace CGAL
{ {
/*! /*!
* \ingroup PkgPolylineDistanceRef * \ingroup PkgFrechetDistanceRef
* This class ... * This class ...
* \cgalModels{FrechetDistanceTraits} * \cgalModels{FrechetDistanceTraits}
* \tparam GT geometric traits class * \tparam GT geometric traits class