DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Private Attributes
DGtal::SurfelAdjacency< dim > Class Template Reference

#include <SurfelAdjacency.h>

Inheritance diagram for DGtal::SurfelAdjacency< dim >:
Inheritance graph
[legend]

Public Member Functions

 ~SurfelAdjacency ()
 SurfelAdjacency (bool int2ext)
 SurfelAdjacency (const SurfelAdjacency &other)
SurfelAdjacencyoperator= (const SurfelAdjacency &other)
void setAdjacency (Dimension i, Dimension j, bool int2ext)
bool getAdjacency (Dimension i, Dimension j) const
void selfDisplay (std::ostream &out) const
bool isValid () const

Private Attributes

boost::array< bool, dim *dim > myInt2Ext

Detailed Description

template<Dimension dim>
class DGtal::SurfelAdjacency< dim >

Aim: Represent adjacencies between surfel elements, telling if it follows an interior to exterior ordering or exterior to interior ordering. It allows tracking of boundaries and of surfaces.

Description of class 'SurfelAdjacency'

Template Parameters:
dimthe number of dimension of the space.

NB: backported from ImaGene.

Examples:
topology/3dKSSurfaceExtraction.cpp, topology/ctopo-2-3d.cpp, and topology/ctopo-2.cpp.

Definition at line 65 of file SurfelAdjacency.h.


Constructor & Destructor Documentation

template<Dimension dim>
DGtal::SurfelAdjacency< dim >::~SurfelAdjacency ( )
inline

Destructor.

Definition at line 45 of file SurfelAdjacency.ih.

{}
template<Dimension dim>
DGtal::SurfelAdjacency< dim >::SurfelAdjacency ( bool  int2ext)
inline

Constructor.

Parameters:
int2extwhen 'true', the surfel adjacency is interior to exterior for any coordinate pair, when 'false', it is exterior to interior for any one.

NB:

See also:
setAdjacency to modify a specific pair or coordinates

Definition at line 51 of file SurfelAdjacency.ih.

References DGtal::SurfelAdjacency< dim >::myInt2Ext.

{
Dimension offset = 0;
for ( Dimension j = 0; j < dim; ++j )
for ( Dimension i = 0; i < dim; ++i )
myInt2Ext[ offset++ ] = int2ext;
}
template<Dimension dim>
DGtal::SurfelAdjacency< dim >::SurfelAdjacency ( const SurfelAdjacency< dim > &  other)
inline

Copy constructor.

Parameters:
otherthe object to clone.

Definition at line 64 of file SurfelAdjacency.ih.

: myInt2Ext( other.myInt2Ext )
{
}

Member Function Documentation

template<Dimension dim>
bool DGtal::SurfelAdjacency< dim >::getAdjacency ( Dimension  i,
Dimension  j 
) const
inline

Returns whether a coordinate pair is interior (true) or exterior (false) in the bel adjacency.

Parameters:
ifirst coordinate.
jsecond coordinate ('j != i').
Returns:
'true' if the surfel adjacency is interior to exterior for the coordinate pair '(i,j)', 'false' when it is exterior to interior.

Definition at line 94 of file SurfelAdjacency.ih.

{
return myInt2Ext[ i * dim + j ];
}
template<Dimension dim>
bool DGtal::SurfelAdjacency< dim >::isValid ( ) const
inline

Checks the validity/consistency of the object.

Returns:
'true' if the object is valid, 'false' otherwise.

Definition at line 112 of file SurfelAdjacency.ih.

{
return true;
}
template<Dimension dim>
DGtal::SurfelAdjacency< dim > & DGtal::SurfelAdjacency< dim >::operator= ( const SurfelAdjacency< dim > &  other)
inline

Assignment.

Parameters:
otherthe object to copy.
Returns:
a reference on 'this'.

Definition at line 73 of file SurfelAdjacency.ih.

References DGtal::SurfelAdjacency< dim >::myInt2Ext.

{
if ( this != &other )
myInt2Ext = other.myInt2Ext;
return *this;
}
template<Dimension dim>
void DGtal::SurfelAdjacency< dim >::selfDisplay ( std::ostream &  out) const
inline

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.

Definition at line 103 of file SurfelAdjacency.ih.

{
out << "[SurfelAdjacency]";
}
template<Dimension dim>
void DGtal::SurfelAdjacency< dim >::setAdjacency ( Dimension  i,
Dimension  j,
bool  int2ext 
)
inline

Set a coordinate pair as interior to exterior or exterior to interior in the surfel adjacency.

Parameters:
ifirst coordinate.
jsecond coordinate (j != i).
int2extwhen 'true', the surfel adjacency is interior to exterior for the coordinate pair '(i,j)', when 'false', it is exterior to interior.

Definition at line 84 of file SurfelAdjacency.ih.

{
myInt2Ext[ i * dim + j ] = int2ext;
myInt2Ext[ j * dim + i ] = int2ext;
}

Field Documentation

template<Dimension dim>
boost::array<bool, dim*dim> DGtal::SurfelAdjacency< dim >::myInt2Ext
private

Memorizes if the surfel adjacency is interior to exterior (true) or exterior to interior (false) for any pair (i,j). The index of the pair (i,j) is 'i * m_ks.dim() + j'.

Definition at line 147 of file SurfelAdjacency.h.

Referenced by DGtal::SurfelAdjacency< dim >::operator=(), and DGtal::SurfelAdjacency< dim >::SurfelAdjacency().


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