Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes

mln::point< G, C > Struct Template Reference

Generic point class. More...

#include <point.hh>

Inheritance diagram for mln::point< G, C >:
Inheritance graph

List of all members.

Public Types

enum  { dim = G::dim }
typedef Gpoint< void > category
typedef C coord
 Coordinate associated type.
typedef dpoint< G, C > delta
 Delta associated type.
typedef dpoint< G, C > dpsite
 DPsite associated type.
typedef point< G, C > exact_t
typedef G grid
 Grid associated type.
typedef mln::algebra::h_vec
< G::dim, float > 
h_vec
 Algebra hexagonal vector (hvec) associated type.
typedef point psite
typedef point site
typedef mln::algebra::vec
< G::dim, float > 
vec
 Algebra vector (vec) associated type.

Public Member Functions

mln::algebra::vec< G::dim, C > & hook_coord_ ()
 Return the underlying vector storing the coordinates.
C & last_coord ()
 Read-write access to the last coordinate.
const C & last_coord () const
 Read-only access to the last coordinate.
 operator typename internal::vec_of_point< G, C >::ret () const
point< G, C > & operator+= (const delta &dp)
 Shifting by dp.
point< G, C > & operator-= (const delta &dp)
 Shifting by the inverse of dp.
C & operator[] (unsigned i)
 Read-write access to the i-th coordinate value.
const C & operator[] (unsigned i) const
 Read-only access to the i-th coordinate value.
 point (const mln::algebra::vec< dim, C > &v)
template<typename F >
 point (const Function_v2v< F > &f)
 Constructor; coordinates are set by function f.
 point ()
 Constructor without argument.
template<typename C2 >
 point (const mln::algebra::vec< dim, C2 > &v)
 Constructor from an algebra vector.
void set_all (C c)
 Set all coordinates to the value c.
h_vec to_h_vec () const
 Transform to point in homogene coordinate system.
vec to_vec () const
 Explicit conversion towards mln::algebra::vec.

 point (C ind)
 point (C row, C col)
 point (C sli, C row, C col)

 point (const literal::origin_t &)
 Constructors/assignments with literals.
point< G, C > & operator= (const literal::origin_t &)
 point (const literal::zero_t &)
point< G, C > & operator= (const literal::zero_t &)
 point (const literal::one_t &)
point< G, C > & operator= (const literal::one_t &)

Static Public Member Functions

static const point< G, C > & minus_infty ()
 Point with all coordinates set to the mininum value.
static const point< G, C > & plus_infty ()
 Point with all coordinates set to the maximum value.

Static Public Attributes

static const point< G, C > origin = all_to(0)
 Origin point (all coordinates are 0).

Protected Attributes

mln::algebra::vec< G::dim, C > coord_

Detailed Description

template<typename G, typename C>
struct mln::point< G, C >

Generic point class.

Parameters are n the dimension of the space and C the coordinate type in this space.

Definition at line 108 of file point.hh.


Member Typedef Documentation

typedef Gpoint<void> mln::Gpoint< point< G, C > >::category [inherited]

Reimplemented from mln::Site< point< G, C > >.

Definition at line 117 of file gpoint.hh.

template<typename G, typename C>
typedef C mln::point< G, C >::coord

Coordinate associated type.

Definition at line 131 of file point.hh.

template<typename G, typename C>
typedef dpoint<G,C> mln::point< G, C >::delta

Delta associated type.

Definition at line 125 of file point.hh.

template<typename G, typename C>
typedef dpoint<G,C> mln::point< G, C >::dpsite

DPsite associated type.

Definition at line 128 of file point.hh.

typedef point< G, C > mln::Object< point< G, C > >::exact_t [inherited]

Definition at line 173 of file object.hh.

template<typename G, typename C>
typedef G mln::point< G, C >::grid

Grid associated type.

Definition at line 122 of file point.hh.

template<typename G, typename C>
typedef mln::algebra::h_vec<G::dim, float> mln::point< G, C >::h_vec

Algebra hexagonal vector (hvec) associated type.

Definition at line 137 of file point.hh.

template<typename G, typename C>
typedef point mln::point< G, C >::psite

Definition at line 113 of file point.hh.

template<typename G, typename C>
typedef point mln::point< G, C >::site

Definition at line 112 of file point.hh.

template<typename G, typename C>
typedef mln::algebra::vec<G::dim, float> mln::point< G, C >::vec

Algebra vector (vec) associated type.

Definition at line 134 of file point.hh.


Member Enumeration Documentation

template<typename G, typename C>
anonymous enum
Enumerator:
dim 

Dimension of the space.

Invariant:
dim > 0

Definition at line 119 of file point.hh.


Constructor & Destructor Documentation

template<typename G , typename C >
mln::point< G, C >::point (  )  [inline]

Constructor without argument.

Definition at line 420 of file point.hh.

template<typename G , typename C >
template<typename C2 >
mln::point< G, C >::point ( const mln::algebra::vec< dim, C2 > &  v  )  [inline]

Constructor from an algebra vector.

Definition at line 427 of file point.hh.

References mln::convert::over_load::from_to_().

template<typename G , typename C>
mln::point< G, C >::point ( const mln::algebra::vec< dim, C > &  v  )  [inline]

Definition at line 435 of file point.hh.

References mln::convert::over_load::from_to_().

template<typename G , typename C>
mln::point< G, C >::point ( ind  )  [inline, explicit]

Constructors with different numbers of arguments (coordinates) w.r.t. the dimension.

Definition at line 443 of file point.hh.

References mln::point< G, C >::coord_.

template<typename G , typename C>
mln::point< G, C >::point ( row,
col 
) [inline]

Definition at line 451 of file point.hh.

References mln::point< G, C >::coord_.

template<typename G , typename C>
mln::point< G, C >::point ( sli,
row,
col 
) [inline]

Definition at line 460 of file point.hh.

References mln::point< G, C >::coord_.

template<typename G , typename C>
mln::point< G, C >::point ( const literal::origin_t  )  [inline]

Constructors/assignments with literals.

Definition at line 481 of file point.hh.

References mln::point< G, C >::coord_, and mln::algebra::vec< n, T >::set_all().

template<typename G , typename C>
mln::point< G, C >::point ( const literal::zero_t  )  [inline]

Definition at line 497 of file point.hh.

References mln::point< G, C >::coord_.

template<typename G , typename C>
mln::point< G, C >::point ( const literal::one_t  )  [inline]

Definition at line 515 of file point.hh.

References mln::point< G, C >::coord_.

template<typename G , typename C >
template<typename F >
mln::point< G, C >::point ( const Function_v2v< F > &  f  )  [inline]

Constructor; coordinates are set by function f.

Definition at line 471 of file point.hh.

References mln::point< G, C >::coord_, and mln::exact().


Member Function Documentation

template<typename G , typename C >
mln::algebra::vec< G::dim, C > & mln::point< G, C >::hook_coord_ (  )  [inline]

Return the underlying vector storing the coordinates.

Definition at line 636 of file point.hh.

References mln::point< G, C >::coord_.

template<typename G , typename C >
const C & mln::point< G, C >::last_coord (  )  const [inline]

Read-only access to the last coordinate.

Definition at line 402 of file point.hh.

References mln::point< G, C >::coord_, and mln::point< G, C >::dim.

Referenced by mln::convert::impl::internal::from_image_to_site_set(), and mln::debug::put_word().

template<typename G , typename C >
C & mln::point< G, C >::last_coord (  )  [inline]

Read-write access to the last coordinate.

Definition at line 410 of file point.hh.

References mln::point< G, C >::coord_, and mln::point< G, C >::dim.

template<typename G , typename C >
const point< G, C > & mln::point< G, C >::minus_infty (  )  [inline, static]

Point with all coordinates set to the mininum value.

Definition at line 627 of file point.hh.

References mln::all_to().

template<typename G , typename C >
mln::point< G, C >::operator typename internal::vec_of_point< G, C >::ret (  )  const [inline]

Definition at line 563 of file point.hh.

References mln::point< G, C >::to_vec().

template<typename G , typename C >
point< G, C > & mln::point< G, C >::operator+= ( const delta dp  )  [inline]

Shifting by dp.

Definition at line 544 of file point.hh.

References mln::point< G, C >::coord_.

template<typename G , typename C >
point< G, C > & mln::point< G, C >::operator-= ( const delta dp  )  [inline]

Shifting by the inverse of dp.

Definition at line 554 of file point.hh.

References mln::point< G, C >::coord_.

template<typename G , typename C >
point< G, C > & mln::point< G, C >::operator= ( const literal::one_t  )  [inline]

Definition at line 524 of file point.hh.

References mln::point< G, C >::coord_.

template<typename G , typename C >
point< G, C > & mln::point< G, C >::operator= ( const literal::origin_t  )  [inline]

Definition at line 489 of file point.hh.

References mln::point< G, C >::coord_, and mln::algebra::vec< n, T >::set_all().

template<typename G , typename C >
point< G, C > & mln::point< G, C >::operator= ( const literal::zero_t  )  [inline]

Definition at line 506 of file point.hh.

References mln::point< G, C >::coord_.

template<typename G , typename C >
C & mln::point< G, C >::operator[] ( unsigned  i  )  [inline]

Read-write access to the i-th coordinate value.

Parameters:
[in] i The coordinate index.
Precondition:
i < dim

Definition at line 393 of file point.hh.

References mln::point< G, C >::coord_, and mln::point< G, C >::dim.

template<typename G , typename C >
const C & mln::point< G, C >::operator[] ( unsigned  i  )  const [inline]

Read-only access to the i-th coordinate value.

Parameters:
[in] i The coordinate index.
Precondition:
i < dim

Definition at line 385 of file point.hh.

References mln::point< G, C >::coord_, and mln::point< G, C >::dim.

template<typename G , typename C >
const point< G, C > & mln::point< G, C >::plus_infty (  )  [inline, static]

Point with all coordinates set to the maximum value.

Definition at line 618 of file point.hh.

References mln::all_to().

template<typename G , typename C>
void mln::point< G, C >::set_all ( c  )  [inline]

Set all coordinates to the value c.

Definition at line 533 of file point.hh.

References mln::point< G, C >::coord_, and mln::algebra::vec< n, T >::set_all().

template<typename G , typename C >
point< G, C >::h_vec mln::point< G, C >::to_h_vec (  )  const [inline]

Transform to point in homogene coordinate system.

Definition at line 592 of file point.hh.

References mln::point< G, C >::coord_, and mln::point< G, C >::dim.

template<typename G , typename C >
point< G, C >::vec mln::point< G, C >::to_vec (  )  const [inline]

Member Data Documentation

template<typename G, typename C>
mln::algebra::vec<G::dim, C> mln::point< G, C >::coord_ [protected]
template<typename G, typename C>
const point< G, C > mln::point< G, C >::origin = all_to(0) [static]

Origin point (all coordinates are 0).

Definition at line 192 of file point.hh.