PointSet -> PointRange

This commit is contained in:
Andreas Fabri 2024-01-14 21:31:03 +00:00
parent add12f51bf
commit 8097ba81bc
4 changed files with 18 additions and 18 deletions

View File

@ -13,7 +13,7 @@
\cgalRefines{OrthtreeTraits} \cgalRefines{OrthtreeTraits}
\cgalHasModelsBegin \cgalHasModelsBegin
\cgalHasModels{CGAL::Orthtree_traits_point<GeomTraits, PointSet, PointMap, DimensionTag>} \cgalHasModels{CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, DimensionTag>}
\cgalHasModelsEnd \cgalHasModelsEnd
*/ */
class CollectionPartitioningOrthtreeTraits { class CollectionPartitioningOrthtreeTraits {
@ -39,7 +39,7 @@ public:
/*! /*!
* \brief Functor with an operator to produce a geometric object from a `Node_data_element`. * \brief Functor with an operator to produce a geometric object from a `Node_data_element`.
* *
* The return type of the functor must be a valid argument to `CGAL::squared_distance`. * The return type of the functor must be a valid argument to `CGAL::squared_distance()`.
*/ */
using Get_geometric_object_for_element = unspecified_type; using Get_geometric_object_for_element = unspecified_type;

View File

@ -6,7 +6,7 @@
template parameter of the `CGAL::Orthtree` class. template parameter of the `CGAL::Orthtree` class.
\cgalHasModelsBegin \cgalHasModelsBegin
\cgalHasModels{CGAL::Orthtree_traits_point<GeomTraits, PointSet, PointMap, DimensionTag>} \cgalHasModels{CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, DimensionTag>}
\cgalHasModels{CGAL::Orthtree_traits_face_graph<PolygonMesh, VPM>} \cgalHasModels{CGAL::Orthtree_traits_face_graph<PolygonMesh, VPM>}
\cgalHasModelsEnd \cgalHasModelsEnd
*/ */

View File

@ -26,12 +26,12 @@ namespace CGAL {
\ingroup PkgOrthtreeTraits \ingroup PkgOrthtreeTraits
The class `Orthtree_traits_base_for_dimension` is a base class providing common choices for types and functors. The class `Orthtree_traits_base_for_dimension` is a base class providing common choices for types and functors.
The base class is extended by `CGAL::Orthtree_traits_point<GeomTraits, PointSet, PointMap, DimensionTag>` and by `CGAL::Orthtree_traits_face_graph<PolygonMesh, VertexPointMap>`. The base class is extended by `CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, DimensionTag>` and by `CGAL::Orthtree_traits_face_graph<PolygonMesh, VertexPointMap>`.
\tparam K model of `Kernel`. \tparam K model of `Kernel`.
\tparam DimensionTag is a tag representing the dimension of the ambient Euclidean space. Must be `Dimension_tag<d>` where `d` is an integer. \tparam DimensionTag is a tag representing the dimension of the ambient Euclidean space. Must be `Dimension_tag<d>` where `d` is an integer.
\sa `CGAL::Orthtree_traits_point<GeomTraits, PointSet, PointMap, DimensionTag>` \sa `CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, DimensionTag>`
\sa `CGAL::Orthtree_traits_face_graph<PolygonMesh, VertexPointMap>` \sa `CGAL::Orthtree_traits_face_graph<PolygonMesh, VertexPointMap>`
*/ */

View File

@ -66,7 +66,7 @@ void reassign_points(
the `Orthtree` class. the `Orthtree` class.
\tparam GeomTraits model of `Kernel`. \tparam GeomTraits model of `Kernel`.
\tparam PointSet must be a model of range whose value type is the key type of `PointMap` \tparam PointRange must be a model of `Range` whose value type is the key type of `PointMap`
\tparam PointMap must be a model of `ReadablePropertyMap` whose value type is `GeomTraits::Traits::Point_d` \tparam PointMap must be a model of `ReadablePropertyMap` whose value type is `GeomTraits::Traits::Point_d`
\warning The input point set is not copied. It is used directly \warning The input point set is not copied. It is used directly
@ -80,10 +80,10 @@ void reassign_points(
*/ */
template < template <
typename GeomTraits, typename GeomTraits,
typename PointSet, typename PointRange,
typename PointMap = Identity_property_map<typename std::iterator_traits<typename PointSet::iterator>::value_type>, typename PointMap = Identity_property_map<typename std::iterator_traits<typename PointRange::iterator>::value_type>,
typename DimensionTag = Ambient_dimension< typename DimensionTag = Ambient_dimension<
typename std::iterator_traits<typename PointSet::iterator>::value_type, typename std::iterator_traits<typename PointRange::iterator>::value_type,
GeomTraits GeomTraits
> >
> >
@ -93,18 +93,18 @@ public:
/// \name Types /// \name Types
/// @{ /// @{
using Self = Orthtree_traits_point<GeomTraits, PointSet, PointMap, DimensionTag>; using Self = Orthtree_traits_point<GeomTraits, PointRange, PointMap, DimensionTag>;
using Tree = Orthtree<Self>; using Tree = Orthtree<Self>;
using Node_data = boost::iterator_range<typename PointSet::iterator>; using Node_data = boost::iterator_range<typename PointRange::iterator>;
using Node_data_element = typename std::iterator_traits<typename PointSet::iterator>::value_type; using Node_data_element = typename std::iterator_traits<typename PointRange::iterator>::value_type;
/// @} /// @}
Orthtree_traits_point( Orthtree_traits_point(
PointSet& point_set, PointRange& points,
PointMap point_map = PointMap() PointMap point_map = PointMap()
) : m_point_set(point_set), m_point_map(point_map) {} ) : m_points(points), m_point_map(point_map) {}
/// \name Operations /// \name Operations
/// @{ /// @{
@ -117,7 +117,7 @@ public:
// init bbox with first values found // init bbox with first values found
{ {
const typename Self::Point_d& point = get(m_point_map, *(m_point_set.begin())); const typename Self::Point_d& point = get(m_point_map, *(m_points.begin()));
std::size_t i = 0; std::size_t i = 0;
for (const typename Self::FT& x: cartesian_range(point)) { for (const typename Self::FT& x: cartesian_range(point)) {
bbox_min[i] = x; bbox_min[i] = x;
@ -126,7 +126,7 @@ public:
} }
} }
// Expand bbox to contain all points // Expand bbox to contain all points
for (const auto& p: m_point_set) { for (const auto& p: m_points) {
const typename Self::Point_d& point = get(m_point_map, p); const typename Self::Point_d& point = get(m_point_map, p);
std::size_t i = 0; std::size_t i = 0;
for (const typename Self::FT& x: cartesian_range(point)) { for (const typename Self::FT& x: cartesian_range(point)) {
@ -143,7 +143,7 @@ public:
auto construct_root_node_contents_object() const { auto construct_root_node_contents_object() const {
return [&]() -> typename Self::Node_data { return [&]() -> typename Self::Node_data {
return {m_point_set.begin(), m_point_set.end()}; return {m_points.begin(), m_points.end()};
}; };
} }
@ -164,7 +164,7 @@ public:
private: private:
PointSet& m_point_set; PointRange& m_points;
PointMap m_point_map; PointMap m_point_map;
}; };