$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mln::Gpoint< E > Struct Template Reference

#include <mln/core/concept/gpoint.hh>

Protected Member Functions

 Gpoint ()

Public Types

typedef Gpoint< void > category
typedef E exact_t

Related Functions

(Note that these are not member functions.)

template<typename P , typename D >
operator+ (const Gpoint< P > &p, const Gdpoint< D > &dp)
template<typename P , typename D >
P & operator+= (Gpoint< P > &p, const Gdpoint< D > &dp)
template<typename L , typename R >
L::delta operator- (const Gpoint< L > &lhs, const Gpoint< R > &rhs)
template<typename P , typename D >
P & operator-= (Gpoint< P > &p, const Gdpoint< D > &dp)
template<typename P , typename D >
operator/ (const Gpoint< P > &p, const value::scalar_< D > &dp)
template<typename P >
std::ostream & operator<< (std::ostream &ostr, const Gpoint< P > &p)
template<typename L , typename R >
bool operator== (const Gpoint< L > &lhs, const Gpoint< R > &rhs)

Detailed Description

template<typename E>
struct mln::Gpoint< E >

Base class for implementation of point classes.

A point is an element of a space.

For instance, mln::point2d is the type of elements defined on the discrete square grid of the 2D plane.

Definition at line 122 of file gpoint.hh.

Constructor & Destructor Documentation

template<typename E>
mln::Gpoint< E >::Gpoint ( )
protected

Friends And Related Function Documentation

template<typename P , typename D >
P operator+ ( const Gpoint< P > &  p,
const Gdpoint< D > &  dp 
)
related

Add a delta-point rhs to a grid point lhs.

Parameters
[in]pA grid point.
[in]dpA delta-point.

The type of dp has to compatible with the type of p.

Returns
A point (temporary object).
\see mln::Gdpoint
template<typename P , typename D >
P & operator+= ( Gpoint< P > &  p,
const Gdpoint< D > &  dp 
)
related

Shift a point by a delta-point dp.

Parameters
[in,out]pThe targeted point.
[in]dpA delta-point.
Returns
A reference to the point p once translated by dp.
Precondition
The type of dp has to be compatible with the type of p.
template<typename L , typename R >
L::delta operator- ( const Gpoint< L > &  lhs,
const Gpoint< R > &  rhs 
)
related

Difference between a couple of grid point lhs and rhs.

Parameters
[in]lhsA first grid point.
[in]rhsA second grid point.
Warning
There is no type promotion in Milena so the client has to make sure that both points are defined with the same type of coordinates.
Precondition
Both lhs and rhs have to be defined on the same topology and with the same type of coordinates; otherwise this test does not compile.
Postcondition
The result, dp, is such as lhs == rhs + dp.
Returns
A delta point (temporary object).
\see mln::Gdpoint
template<typename P , typename D >
P & operator-= ( Gpoint< P > &  p,
const Gdpoint< D > &  dp 
)
related

Shift a point by the negate of a delta-point dp.

Parameters
[in,out]pThe targeted point.
[in]dpA delta-point.
Returns
A reference to the point p once translated by - dp.
Precondition
The type of dp has to be compatible with the type of p.
template<typename P , typename D >
P operator/ ( const Gpoint< P > &  p,
const value::scalar_< D > &  dp 
)
related

Divise a point by a scalar s.

Parameters
[in,out]pThe targeted point.
[in]dpA scalar.
Returns
A reference to the point p once divised by s.
template<typename P >
std::ostream & operator<< ( std::ostream &  ostr,
const Gpoint< P > &  p 
)
related

Print a grid point p into the output stream ostr.

Parameters
[in,out]ostrAn output stream.
[in]pA grid point.
Returns
The modified output stream ostr.
template<typename L , typename R >
bool operator== ( const Gpoint< L > &  lhs,
const Gpoint< R > &  rhs 
)
related

Equality comparison between a couple of grid point lhs and rhs.

Parameters
[in]lhsA first grid point.
[in]rhsA second grid point.
Precondition
Both lhs and rhs have to be defined on the same topology; otherwise this test does not compile.
Returns
True if both grid points have the same coordinates, otherwise false.

Member Typedef Documentation

template<typename E>
typedef Gpoint<void> mln::Gpoint< E >::category

Definition at line 124 of file gpoint.hh.

template<typename E>
typedef E mln::Object< E >::exact_t
inherited

Definition at line 105 of file object.hh.