CGAL 5.1 - dD Spatial Searching
CGAL::Distance_adapter< Key, PointPropertyMap, Base_distance > Class Template Reference

#include <CGAL/Search_traits_adapter.h>

Inherits Base_distance.

Definition

template<typename Key, typename PointPropertyMap, typename Base_distance>
class CGAL::Distance_adapter< Key, PointPropertyMap, Base_distance >

A class that uses a point property map to adapt a distance class to work on a key as point type. When using Search_traits_adapter<Key,PointPropertyMap,BaseTraits> in a nearest neighbor search algorithm, this class must be used as distance.

Template Parameters
Keyis a type that is associated to a point of type Base_distance::Point_d.
PointPropertyMapis a model of ReadablePropertyMap with Key as key type and Base_distance::Point_d as value type.
Base_distanceis a model of either GeneralDistance or OrthogonalDistance.
Is Model Of:

GeneralDistance if Base_distance is a model of GeneralDistance

OrthogonalDistance if Base_distance is a model of OrthogonalDistance

See also
Search_traits_adapter<Key,PointPropertyMap,BaseTraits>

Types

typedef Base_distance::FT FT
 
typedef Key Point_d
 
typedef Base_distance::Query_item Query_item
 

Creation

 Distance_adapter (const PointPropertyMap &ppmap=PointPropertyMap(), const Base_distance &base=Base_distance())
 Constructor initializing the class to base and setting the point property map of the class to ppmap. More...
 

Operations

const PointPropertyMap & point_property_map () const
 Returns the point property map. More...
 

Member Typedef Documentation

◆ FT

template<typename Key , typename PointPropertyMap , typename Base_distance >
typedef Base_distance::FT CGAL::Distance_adapter< Key, PointPropertyMap, Base_distance >::FT

◆ Point_d

template<typename Key , typename PointPropertyMap , typename Base_distance >
typedef Key CGAL::Distance_adapter< Key, PointPropertyMap, Base_distance >::Point_d

◆ Query_item

template<typename Key , typename PointPropertyMap , typename Base_distance >
typedef Base_distance::Query_item CGAL::Distance_adapter< Key, PointPropertyMap, Base_distance >::Query_item

Constructor & Destructor Documentation

◆ Distance_adapter()

template<typename Key , typename PointPropertyMap , typename Base_distance >
CGAL::Distance_adapter< Key, PointPropertyMap, Base_distance >::Distance_adapter ( const PointPropertyMap &  ppmap = PointPropertyMap(),
const Base_distance &  base = Base_distance() 
)

Constructor initializing the class to base and setting the point property map of the class to ppmap.

Member Function Documentation

◆ point_property_map()

template<typename Key , typename PointPropertyMap , typename Base_distance >
const PointPropertyMap& CGAL::Distance_adapter< Key, PointPropertyMap, Base_distance >::point_property_map ( ) const

Returns the point property map.