Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

DGtal::Lattice< TSpace > Class Template Reference

Aim: Represents an n-dimensional integer lattice in an m-dimensional real vector space. More...

#include <Lattice.h>

Inheritance diagram for DGtal::Lattice< TSpace >:
Inheritance graph
[legend]

Public Types

typedef TSpace Space
typedef TSpace::Integer Integer
typedef TSpace::Point Point
typedef TSpace::Dimension Dimension

Public Member Functions

 ~Lattice ()
 Lattice ()
 Lattice (const Lattice< Space > &other)
Lattice< Space > & operator= (const Lattice< Space > &other)
void init (Dimension n, Dimension m, double dh=1.0)
void clear ()
Dimension n () const
Dimension m () const
void setOrigin (const double *x)
void setVector (Dimension i, const double *v)
void immerse (const Integer *p, double *x) const
void immerse (const Point &p, double *x) const
void immerse (const Integer *p, float *x) const
void immerse (const Point &p, float *x) const
void selfDisplay (std::ostream &out) const
bool isValid () const

Static Public Member Functions

static void defaultZ2toZ3 (Lattice &l, const double *x0, double dh=1.0)
static void defaultZ3toZ3 (Lattice &l, const double *x0, double dh=1.0)

Private Member Functions

 BOOST_CONCEPT_ASSERT ((CSpace< TSpace >))

Private Attributes

uint myN
uint myM
double * myX0
double * myV

Detailed Description

template<typename TSpace>
class DGtal::Lattice< TSpace >

Aim: Represents an n-dimensional integer lattice in an m-dimensional real vector space.

Description of template class 'Lattice'

Parameters:
TSpace the source digital space for the lattice.

Member Typedef Documentation

template<typename TSpace>
typedef TSpace::Dimension DGtal::Lattice< TSpace >::Dimension
template<typename TSpace>
typedef TSpace::Integer DGtal::Lattice< TSpace >::Integer
template<typename TSpace>
typedef TSpace::Point DGtal::Lattice< TSpace >::Point
template<typename TSpace>
typedef TSpace DGtal::Lattice< TSpace >::Space

Constructor & Destructor Documentation

template<typename TSpace>
DGtal::Lattice< TSpace >::~Lattice (  ) 

Destructor.

template<typename TSpace>
DGtal::Lattice< TSpace >::Lattice (  ) 

Constructor. Invalid.

template<typename TSpace>
DGtal::Lattice< TSpace >::Lattice ( const Lattice< Space > &  other  ) 

Copy constructor.

Parameters:
other the object to clone.

Member Function Documentation

template<typename TSpace>
DGtal::Lattice< TSpace >::BOOST_CONCEPT_ASSERT ( (CSpace< TSpace >)   )  [private]
template<typename TSpace>
void DGtal::Lattice< TSpace >::clear (  ) 

Resets the lattice.

template<typename TSpace>
static void DGtal::Lattice< TSpace >::defaultZ2toZ3 ( Lattice< TSpace > &  l,
const double *  x0,
double  dh = 1.0 
) [static]

Constructs a default 2D lattice centered at [x0], with vectors (dh,0,0) and (0,dh,0).

Parameters:
l (returns) the lattice
x0 the origin of the lattice embedding (a 3D point)
dh the grid step or length of each vector.
template<typename TSpace>
static void DGtal::Lattice< TSpace >::defaultZ3toZ3 ( Lattice< TSpace > &  l,
const double *  x0,
double  dh = 1.0 
) [static]

Constructs a default 3D lattice centered at [x0], with vectors (dh,0,0) and (0,dh,0) and (0,0,dh).

Parameters:
l (returns) the lattice
x0 the origin of the lattice embedding (a 3D point)
dh the grid step or length of each vector.
template<typename TSpace>
void DGtal::Lattice< TSpace >::immerse ( const Integer p,
double *  x 
) const

Immerse a point of the lattice into the target space of dimension m.

Parameters:
p the n coordinates of a point in the lattice.
x (returns) its m coordinates in the target space of dimension m.
template<typename TSpace>
void DGtal::Lattice< TSpace >::immerse ( const Point p,
double *  x 
) const

Immerse a point of the lattice into the target space of dimension m.

Parameters:
p the n coordinates of a point in the lattice.
x (returns) its m coordinates in the target space of dimension m.
template<typename TSpace>
void DGtal::Lattice< TSpace >::immerse ( const Integer p,
float *  x 
) const

Immerse a point of the lattice into the target space of dimension m.

Parameters:
p the n coordinates of a point in the lattice.
x (returns) its m coordinates in the target space of dimension m.
template<typename TSpace>
void DGtal::Lattice< TSpace >::immerse ( const Point p,
float *  x 
) const

Immerse a point of the lattice into the target space of dimension m.

Parameters:
p the n coordinates of a point in the lattice.
x (returns) its m coordinates in the target space of dimension m.
template<typename TSpace>
void DGtal::Lattice< TSpace >::init ( Dimension  n,
Dimension  m,
double  dh = 1.0 
)

Defines the standard lattice when n=m, the standard injection when n < m, and when m > n, vectors are overlapping.

Parameters:
n the dimension of the lattice space
m the dimension of the target space where the lattice is represented.
dh the length of the elementary displacement.
template<typename TSpace>
bool DGtal::Lattice< TSpace >::isValid (  )  const

Checks the validity/consistency of the object.

Returns:
'true' if the object is valid, 'false' otherwise.
template<typename TSpace>
Dimension DGtal::Lattice< TSpace >::m (  )  const
Returns:
the dimension of the target space.
template<typename TSpace>
Dimension DGtal::Lattice< TSpace >::n (  )  const
Returns:
the dimension of the lattice space.
template<typename TSpace>
Lattice<Space>& DGtal::Lattice< TSpace >::operator= ( const Lattice< Space > &  other  ) 

Assignment.

Parameters:
other the object to copy.
Returns:
a reference on 'this'.
template<typename TSpace>
void DGtal::Lattice< TSpace >::selfDisplay ( std::ostream &  out  )  const

Writes/Displays the object on an output stream.

Parameters:
out the output stream where the object is written.
template<typename TSpace>
void DGtal::Lattice< TSpace >::setOrigin ( const double *  x  ) 

Sets the origin of the space.

Parameters:
x is a vector of size m.
template<typename TSpace>
void DGtal::Lattice< TSpace >::setVector ( Dimension  i,
const double *  v 
)

Sets the elementary vector along direction i

Parameters:
i is a coordinate between 0 and n-1.
v is a vector of size m.

Field Documentation

template<typename TSpace>
uint DGtal::Lattice< TSpace >::myM [private]

Dimension of target space;

template<typename TSpace>
uint DGtal::Lattice< TSpace >::myN [private]

Dimension of lattice space;

template<typename TSpace>
double* DGtal::Lattice< TSpace >::myV [private]

Vectors for each dimension. Array of size m_n times m_m;

template<typename TSpace>
double* DGtal::Lattice< TSpace >::myX0 [private]

Origin. Array of size m_m;


The documentation for this class was generated from the following file: