-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
124 additions
and
39 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
Frechet_distance/examples/Frechet_distance/Frechet_distance_d.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// Copyright (c) 2024 Max-Planck-Institute Saarbruecken (Germany), GeometryFactory (France) | ||
// All rights reserved. | ||
// | ||
// This file is part of CGAL (www.cgal.org). | ||
// | ||
// $URL$ | ||
// $Id$ | ||
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial | ||
// | ||
// Author(s) : André Nusser <[email protected]> | ||
// Marvin Künnemann <[email protected]> | ||
// Karl Bringmann <[email protected]> | ||
// Andreas Fabri | ||
// ============================================================================= | ||
|
||
#ifndef CGAL_FRECHET_DISTANCE_TRAITS_H | ||
#define CGAL_FRECHET_DISTANCE_TRAITS_H | ||
|
||
#include <CGAL/license/Frechet_distance.h> | ||
|
||
#include <CGAL/Bbox.h> | ||
#include <array> | ||
|
||
namespace CGAL | ||
{ | ||
/* | ||
* \ingroup PkgFrechetDistanceRef | ||
* | ||
* \cgalModels{FrechetDistanceTraits} | ||
* \tparam NT number type | ||
* \tparam dimension point dimension | ||
*/ | ||
template <class NT, int dimension> | ||
class Frechet_distance_traits | ||
{ | ||
public: | ||
using Dimension = Dimension_tag<dimension>; | ||
|
||
using FT = NT; | ||
using Point_d = std::array<FT, dimension>; | ||
using Cartesian_const_iterator_d = typename Point_d::const_iterator; | ||
|
||
struct Construct_bbox_d | ||
{ | ||
Bbox<Dimension, double> operator()(const Point_d& p) const | ||
{ | ||
Bbox<Dimension, double> bb; | ||
for (int i=0;i<dimension; ++i) | ||
{ | ||
bb.min(i)=to_interval(p[i]).first; | ||
bb.max(i)=to_interval(p[i]).second; | ||
} | ||
|
||
return bb; | ||
} | ||
}; | ||
|
||
struct Construct_cartesian_const_iterator_d | ||
{ | ||
Cartesian_const_iterator_d operator()(const Point_d& p) const | ||
{ | ||
return p.begin(); | ||
} | ||
Cartesian_const_iterator_d operator()(const Point_d& p, int) const | ||
{ | ||
return p.end(); | ||
} | ||
}; | ||
|
||
Construct_bbox_d construct_bbox_d_object() const { return Construct_bbox_d(); } | ||
|
||
Construct_cartesian_const_iterator_d construct_cartesian_const_iterator_d_object() const | ||
{ | ||
return Construct_cartesian_const_iterator_d(); | ||
} | ||
}; | ||
|
||
} // end of namespace CGAL | ||
|
||
#endif // CGAL_FRECHET_DISTANCE_TRAITS_H |