template<typename TKSpace, typename TMap, bool isIndirect = false>
class DGtal::L2FirstOrderLocalDistanceFromCells< TKSpace, TMap, isIndirect >
Aim: Class for the computation of the Euclidean distance at some point p, from the available distance values in the neighborhood of p. Contrary to L2FirstOrderLocalDistance, the distance values are not available from the points adjacent to p but instead from the (d-1)-cells lying between p and these points.
Description of template class 'L2FirstOrderLocalDistanceFromCells'
- Note:
- The stored values are expected to be the distance of the interface to the points directly incident to the cells and must be between 0 and 1.
- Template Parameters:
-
TKSpace | a model of cellular grid |
TMap | a model of associative container used for the mapping cells-value |
isIndirect | a bool equal to 'false' if the tested points are expected to be directly incident to the cells (default) and 'true' otherwise |
- See also:
- initFromBelsRange FMM
Definition at line 584 of file FMMPointFunctors.h.
template<typename TKSpace , typename TMap , bool isIndirect>
Euclidean distance computation at aPoint , from the available distance values of the adjacent cells.
- Parameters:
-
aPoint | the point for which the distance is computed |
- Returns:
- the distance value at aPoint.
for the direct orientation
for the indirect orientation
Definition at line 799 of file FMMPointFunctors.ih.
{
v.reserve(Point::dimension);
for (
typename KSpace::DirIterator q =
myKSpace->uDirs( spel );
(q != 0); ++q )
{
ASSERT(
myKSpace->uDim( surfel1 ) == (KSpace::dimension - 1) );
ASSERT(
myKSpace->uDim( surfel2 ) == (KSpace::dimension - 1) );
typename Map::iterator it1 =
myMap->find( surfel1 );
typename Map::iterator it2 =
myMap->find( surfel2 );
bool flag1 = ( it1 !=
myMap->end() );
bool flag2 = ( it2 !=
myMap->end() );
if ( flag1 || flag2 )
{
if ( flag1 && flag2 )
{
ASSERT( (it1->second >= 0)&&(it1->second <= 1) );
ASSERT( (it2->second >= 0)&&(it2->second <= 1) );
if (it1->second < it2->second)
d = ValueBetween0And1<isIndirect>
::get( it1->second );
else
d = ValueBetween0And1<isIndirect>
::get( it2->second );
} else
{
if (flag1)
{
ASSERT( (it1->second >= 0)&&(it1->second <= 1) );
d = ValueBetween0And1<isIndirect>
::get( it1->second );
}
if (flag2)
{
ASSERT( (it2->second >= 0)&&(it2->second <= 1) );
d = ValueBetween0And1<isIndirect>
::get( it2->second );
}
}
if (d == 0) return 0;
v.push_back(d);
}
}
}