DGtal 1.3.0
|
Aim: simple adapter class which adapts any models of concepts::CMetricSpace to a model of concepts::CDigitalMetricSpace. More...
#include <DGtal/geometry/volumes/distance/DigitalMetricAdapter.h>
Public Types | |
typedef TMetric | Metric |
Input metric type. More... | |
typedef TInteger | Value |
Values are integer numbers. More... | |
typedef Metric::Point | Point |
Point type. More... | |
typedef Metric::Space | Space |
Space type. More... | |
typedef Value | RawValue |
RawValue type. More... | |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((concepts::CMetricSpace< Metric >)) | |
BOOST_CONCEPT_ASSERT ((concepts::CInteger< Value >)) | |
DigitalMetricAdapter (ConstAlias< Metric > aMetric) | |
DigitalMetricAdapter (const DigitalMetricAdapter &anotherMetric) | |
~DigitalMetricAdapter () | |
DigitalMetricAdapter & | operator= (const DigitalMetricAdapter &other) |
Value | operator() (const Point &p, const Point &q) const |
Value | rawDistance (const Point &p, const Point &q) const |
DGtal::Closest | closest (const Point &a, const Point &p, const Point &q) const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Protected Member Functions | |
DigitalMetricAdapter () | |
Private Attributes | |
const Metric * | myMetric |
Aim: simple adapter class which adapts any models of concepts::CMetricSpace to a model of concepts::CDigitalMetricSpace.
Description of template class 'DigitalMetricAdapter'
This class uses the ceil function to perform the adaptation. This class is thus a model of CDigitalMetricSpace
TMetric | any model of concepts::CMetricSpace. |
TInteger | any model of concepts::CInteger to be used as value type. By default, it corresponds to the Integer type of the digital space in which the TMetric is defined. |
Definition at line 71 of file DigitalMetricAdapter.h.
typedef TMetric DGtal::DigitalMetricAdapter< TMetric, TInteger >::Metric |
Input metric type.
Definition at line 77 of file DigitalMetricAdapter.h.
typedef Metric::Point DGtal::DigitalMetricAdapter< TMetric, TInteger >::Point |
Point type.
Definition at line 86 of file DigitalMetricAdapter.h.
typedef Value DGtal::DigitalMetricAdapter< TMetric, TInteger >::RawValue |
RawValue type.
Definition at line 92 of file DigitalMetricAdapter.h.
typedef Metric::Space DGtal::DigitalMetricAdapter< TMetric, TInteger >::Space |
Space type.
Definition at line 89 of file DigitalMetricAdapter.h.
typedef TInteger DGtal::DigitalMetricAdapter< TMetric, TInteger >::Value |
Values are integer numbers.
Definition at line 81 of file DigitalMetricAdapter.h.
|
inline |
Constructor from a CMetricSpace model.
aMetric | the metric to adapt. |
Definition at line 100 of file DigitalMetricAdapter.h.
|
inline |
Copy Constructor
anotherMetric | the digital metric adapter to copy. |
Definition at line 109 of file DigitalMetricAdapter.h.
References DGtal::DigitalMetricAdapter< TMetric, TInteger >::myMetric.
|
inline |
|
protected |
Constructor. Forbidden by default (protected to avoid g++ warnings).
DGtal::DigitalMetricAdapter< TMetric, TInteger >::BOOST_CONCEPT_ASSERT | ( | (concepts::CInteger< Value >) | ) |
DGtal::DigitalMetricAdapter< TMetric, TInteger >::BOOST_CONCEPT_ASSERT | ( | (concepts::CMetricSpace< Metric >) | ) |
|
inline |
closest operator.
[in] | a | the origin point. |
[in] | p | a first point. |
[in] | q | a second point. |
Definition at line 169 of file DigitalMetricAdapter.h.
References DGtal::ClosestBOTH, DGtal::ClosestFIRST, and DGtal::ClosestSECOND.
|
inline |
Checks the validity/consistency of the object.
Definition at line 195 of file DigitalMetricAdapter.h.
References DGtal::DigitalMetricAdapter< TMetric, TInteger >::myMetric.
|
inline |
Distance operator.
[in] | p | a first point. |
[in] | q | a second point. |
Definition at line 144 of file DigitalMetricAdapter.h.
References DGtal::DigitalMetricAdapter< TMetric, TInteger >::myMetric.
Referenced by DGtal::DigitalMetricAdapter< TMetric, TInteger >::rawDistance().
|
inline |
Assignment.
other | the object to copy. |
Definition at line 131 of file DigitalMetricAdapter.h.
References DGtal::DigitalMetricAdapter< TMetric, TInteger >::myMetric.
|
inline |
RawDistance operator.
[in] | p | a first point. |
[in] | q | a second point. |
Definition at line 156 of file DigitalMetricAdapter.h.
References DGtal::DigitalMetricAdapter< TMetric, TInteger >::operator()().
|
inline |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 186 of file DigitalMetricAdapter.h.
References DGtal::DigitalMetricAdapter< TMetric, TInteger >::myMetric.
|
private |
Definition at line 202 of file DigitalMetricAdapter.h.
Referenced by DGtal::DigitalMetricAdapter< TMetric, TInteger >::DigitalMetricAdapter(), DGtal::DigitalMetricAdapter< TMetric, TInteger >::isValid(), DGtal::DigitalMetricAdapter< TMetric, TInteger >::operator()(), DGtal::DigitalMetricAdapter< TMetric, TInteger >::operator=(), and DGtal::DigitalMetricAdapter< TMetric, TInteger >::selfDisplay().