template<typename Domain, Dimension maxNorm1, Dimension dimension = Domain::Space::dimension>
class DGtal::deprecated::DomainMetricAdjacency< Domain, maxNorm1, dimension >
Aim: Describes digital adjacencies in a digital domain that are defined with the 1-norm and the infinity-norm.
Description of template class 'DomainMetricAdjacency'
It induces the classical 4 and 8 adjacencies in 2D, the 6, 18 and 26 adjacencies in 3D, and the \( \omega \) and \( \alpha \) adjacencies in nD.
Model of a CAdjacency.
- Template Parameters:
-
Domain | any domain of a digital space (see concept CDomain). |
maxNorm1 | defines which points are adjacent. More precisely, two points are adjacent iff their norm-infinity is less or equal than 1 and if their norm-1 is less or equal than maxNorm1. |
Definition at line 75 of file DomainMetricAdjacency.h.
template<typename Domain , Dimension maxNorm1, Dimension dimension>
template<typename OutputIterator >
Outputs the whole neighborhood of point [p] as a sequence of *out_it++ = ...
- Template Parameters:
-
OutputIterator | any output iterator (like std::back_insert_iterator< std::vector<int> >). |
- Parameters:
-
p | any point of this space. |
out_it | any output iterator. |
Definition at line 134 of file DomainMetricAdjacency.ih.
{
for ( typename Point::Iterator it = p1.begin(); it != p1.end(); ++it )
--(*it);
for ( typename Point::Iterator it = p2.begin(); it != p2.end(); ++it )
++(*it);
typedef HyperRectDomain<Space> LocalDomain;
LocalDomain domain( p1, p2 );
for ( typename LocalDomain::ConstIterator it = domain.begin();
it != domain.end();
++it )
{
{
Vector v( p - *it );
typename Vector::UnsignedComponent n1 = v.norm1();
if ( n1 <= maxNorm1 )
*out_it++ = *it;
}
}
}
template<typename Domain , Dimension maxNorm1, Dimension dimension>
template<typename OutputIterator >
Outputs the whole proper neighborhood of point [p] (thus without [p] itself) as a sequence of *out_it++ = ...
- Template Parameters:
-
OutputIterator | any output iterator (like std::back_insert_iterator< std::vector<int> >). |
- Parameters:
-
p | any point of this space. |
out_it | any output iterator. |
Definition at line 172 of file DomainMetricAdjacency.ih.
{
for ( typename Point::Iterator it = p1.begin(); it != p1.end(); ++it )
--(*it);
for ( typename Point::Iterator it = p2.begin(); it != p2.end(); ++it )
++(*it);
typedef HyperRectDomain<Space> LocalDomain;
LocalDomain domain( p1, p2 );
for ( typename LocalDomain::ConstIterator it = domain.begin();
it != domain.end();
++it )
{
{
Vector v( p - *it );
typename Vector::UnsignedComponent n1 = v.norm1();
if ( ( n1 <= maxNorm1 ) && ( n1 != 0 ) )
*out_it++ = *it;
}
}
}