Undocument Geographical Coordinates traits, for now

The issue is that currently all predicates and constructions are based
on a construction to convert from lat/long towards R^3, so the benefits
of the exact representation are lost.

Still, it might be useful in the current state, so just leaving it undocumented.
This commit is contained in:
Mael Rouxel-Labbé 2021-01-31 12:26:58 +01:00
parent 225d1f5d47
commit 919f58f94b
2 changed files with 7 additions and 148 deletions

View File

@ -1,135 +0,0 @@
namespace CGAL {
/*!
\ingroup PkgTriangulationOnSphere2TriangulationClasses
The class `Geographical_coordinates_traits_2` is a model
of the concept `DelaunayTriangulationOnSphereTraits_2`. It implements the `Point_on_sphere_2` type
as a pair of coordinates representing the latitude and the longitude of the point on the sphere.
\tparam LK a linear kernel type; must be a model of `Kernel`.
\tparam SK a spherical kernel type; must be a model of `SphericalKernel`.
\cgalModels `DelaunayTriangulationOnSphereTraits_2`
\sa `CGAL::Delaunay_triangulation_on_sphere_traits_2`
\sa `CGAL::Projection_on_sphere_traits_3`
*/
template <typename LK,
typename SK = CGAL::Spherical_kernel_3<
K, CGAL::Algebraic_kernel_for_spheres_2_3<typename LK::FT> > >
class Geographical_coordinates_traits_2
{
public:
/// The field number type.
typedef typename LK::FT FT;
/// A pair of latitude and longitude values.
typedef Geographical_coordinates<K> Point_on_sphere_2;
///
typedef typename SK::Circular_arc_3 Arc_on_sphere_2;
///
typedef typename LK::Point_3 Point_3;
///
typedef typename LK::Segment_3 Segment_3;
///
typedef typename LK::Triangle_3 Triangle_3;
/// \name Predicates
///
/// @{
/// The 2-dimensional lexicographical order is used to create a strict total order on the sphere.
typedef unspecified_type Compare_on_sphere_2;
/// Two points are equal if their two coordinates (latitude and longitude) are equal.
typedef unspecified_type Equal_on_sphere_2;
///
typedef unspecified_type Collinear_are_strictly_ordered_on_great_circle_2;
///
typedef unspecified_type Side_of_oriented_circle_on_sphere_2;
///
typedef unspecified_type Orientation_on_sphere_2;
/// @}
/// \name Constructions
///
/// @{
///
typedef typename unspecified_type Construct_arc_on_sphere_2;
///
typedef typename unspecified_type Construct_circumcenter_on_sphere_2;
///
typedef typename unspecified_type Construct_circumcenter_3;
/// converts points from the latitude/longitude system to the 3D Euclidean system
typedef unspecified_type Construct_point_3;
///
typedef unspecified_type Construct_segment_3;
///
typedef unspecified_type Construct_triangle_3;
/// @}
public:
/// \name Precision predicates
///
/// @{
/// Due to their representation, points are always exactly on the sphere, and consequently
/// this function simply returns `true` for any input.
bool is_on_sphere(const Point_on_sphere_2& p) const;
/// Since there is no need to ensure separations of the points because representation
/// of the points is exact (see also \cgalCite{cgal:ccplr-redtp-10}),
/// this function simply returns `false` for any input.
bool are_points_too_close(const Point_on_sphere_2& p, const Point_on_sphere_2& q) const;
/// @}
};
/*!
\ingroup PkgTriangulationOnSphere2TriangulationClasses
This class represents coordinates of the Geographical Coordinates System,
that is a pair of scalar values representing a latitude and a longitude.
\tparam K a kernel type; it must be a model of `Kernel`.
*/
template< typename K >
class Geographical_coordinates
{
public:
/// The field number type
typedef typename K::FT FT;
///
typedef FT Latitude;
///
typedef FT Longitude;
/// %Default constructor. Creates a point at coordinates `(0, 0)`.
Geographical_coordinates();
/// constructs a point on the sphere at coordinates `(la, lo)`.
///
/// \pre `la` is within `[-90; 90[` and `lo` is within `[-180; 180[`.
Geographical_coordinates(const Latitude la, const Longitude lo);
};
} // namespace CGAL

View File

@ -23,6 +23,13 @@
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
// Note: this is currently undocumented because it uses a conversion to
// the Cartesian domain R^3 to perform predicates and constructions,
// losing the benefit of the exact representation on the way.
// It can be useful on its own (especially since it contains code
// to handle generic convex domains), but hidden points are possible
// and are not handled properly.
namespace CGAL { namespace CGAL {
template <typename LK> template <typename LK>
@ -35,16 +42,6 @@ struct Geographical_coordinates
Geographical_coordinates() : _la(360), _lo(360) { } Geographical_coordinates() : _la(360), _lo(360) { }
Geographical_coordinates(const FT la, const FT lo) : _la(la), _lo(lo) { } Geographical_coordinates(const FT la, const FT lo) : _la(la), _lo(lo) { }
// Geographical_coordinates() = default;
// Geographical_coordinates(const Geographical_coordinates&) = default;
// Geographical_coordinates& operator=(const Geographical_coordinates& l) = default;
// void swap(Geographical_coordinates& l)
// {
// std::swap(_la, l.latitude());
// std::swap(_lo, l.longitude());
// }
Latitude latitude() const { return _la; } Latitude latitude() const { return _la; }
Longitude longitude() const { return _lo; } Longitude longitude() const { return _lo; }
@ -121,9 +118,6 @@ struct Construct_Cartesian_coordinates
const FT pol_radius = 6356.7523; const FT pol_radius = 6356.7523;
FT radius_ratio = equ_radius / pol_radius; FT radius_ratio = equ_radius / pol_radius;
// @tmp just to have a laugh
radius_ratio = 1.5;
const FT a2 = square(_radius * radius_ratio); const FT a2 = square(_radius * radius_ratio);
const FT b2 = square(_radius); const FT b2 = square(_radius);