36 #if defined(SegmentComputerEstimators_RECURSES) 
   37 #error Recursive header files inclusion detected in SegmentComputerEstimators.h 
   38 #else // defined(SegmentComputerEstimators_RECURSES) 
   40 #define SegmentComputerEstimators_RECURSES 
   42 #if !defined SegmentComputerEstimators_h 
   44 #define SegmentComputerEstimators_h 
   49 #include "DGtal/base/Common.h" 
   50 #include "DGtal/helpers/StdDefs.h" 
   51 #include "boost/utility.hpp" 
   83     template <
typename TSegmentComputer, 
typename Functor, 
 
   84               typename ReturnType = 
typename Functor::Value>
 
  175       template <
typename OutputIterator>
 
  177                           OutputIterator result)
 const 
  216     template <
typename TSegmentComputer, 
typename Functor, 
 
  217               typename ReturnType = 
typename Functor::Value>
 
  350       template <
typename OutputIterator>
 
  352                           OutputIterator result)
 const 
  390     template <
typename TSegmentComputer, 
typename Functor, 
 
  391               typename ReturnType = 
typename Functor::Value>
 
  482       template <
typename OutputIterator>
 
  484                           OutputIterator result)
 const 
  522     template <
typename TSegmentComputer, 
typename Functor, 
 
  523               typename ReturnType = 
typename Functor::Value>
 
  656       template <
typename OutputIterator>
 
  658                           OutputIterator result)
 const  
  704       template<
typename DSS>
 
  708           ::castToDouble(aDSS.getA());      
 
  710           ::castToDouble(aDSS.getB());      
 
  712         return std::atan2(a,b);
 
  737       template<
typename DSS>
 
  754     template<
typename DSS>
 
  774         return Value(aDSS.getB(), aDSS.getA());
 
  789     template<
bool isCCW = true>
 
  808       template<
typename DCA>
 
  811         if ( aDCA.isStraight() )
 
  814           return ( aDCA.getSeparatingCircle().getCurvature() / aH );
 
  823       template<
typename DCA>
 
  826         if ( aDCA.isStraight() )
 
  829           return - ( aDCA.getSeparatingCircle().getCurvature() / aH );
 
  855       template<
typename DCA>
 
  857                         const DCA& aDCA)
 const  
  859         typedef typename DCA::ConstIterator ConstIterator; 
 
  860         typedef typename DCA::Pair Pair; 
 
  861         typedef typename DCA::Point 
Point;
 
  862         typedef typename Point::Coordinate Coordinate; 
 
  864         if ( !aDCA.isStraight() )
 
  868             aDCA.getSeparatingCircle().getParameters(c0, c1, r);
 
  871             Point i = pair.first; 
 
  872             Point o = pair.second;
 
  879             double n = std::sqrt(v0*v0 + v1*v1); 
 
  880             return Value( v0/n, v1/n );
 
  886             aDCA.getGeometricalDSSPtr()->getParameters(a, b, c);
 
  888             double n = std::sqrt(a*a + b*b); 
 
  889             return Value( a/n, b/n ); 
 
  918       template<
typename DCA>
 
  920                         const DCA& aDCA)
 const  
  923         Value normal = f(it, aDCA); 
 
  924         return Value( normal[1], normal[0] ); 
 
  936       typedef std::pair<double,double> 
Value; 
 
  954       template<
typename DCA>
 
  956                         const DCA& aDCA, 
const double& aH)
 const  
  958         typedef typename DCA::ConstIterator ConstIterator; 
 
  959         typedef typename DCA::Pair Pair; 
 
  960         typedef typename DCA::Point 
Point;
 
  961         typedef typename Point::Coordinate Coordinate; 
 
  963         if ( !aDCA.isStraight() )
 
  967             aDCA.getSeparatingCircle().getParameters(c0, c1, r);
 
  970             Point i = pair.first; 
 
  971             Point o = pair.second;
 
  975             double distI = std::sqrt( distI0*distI0 + distI1*distI1 ) - r; 
 
  978             double distO = std::sqrt( distO0*distO0 + distO1*distO1 ) - r; 
 
  979             return Value( distI*aH, distO*aH );
 
  985             aDCA.getGeometricalDSSPtr()->getParameters(a, b, c); 
 
  987             double n = std::sqrt(a*a + b*b); 
 
  990             Point i = pair.first; 
 
  991             Point o = pair.second;
 
  995             double distI = rI / n; 
 
  998             double distO = rO / n; 
 
  999             return Value( distI*aH, distO*aH ); 
 
 1017   template <
typename DSSComputer>
 
 1046   template <
typename DSSComputer>
 
 1076   template <
typename DSSComputer>
 
 1114   template <
typename DCAComputer, 
bool isCCW = true>
 
 1117                                                detail::CurvatureFromDCA<isCCW> >
 
 1144   template <
typename DCAComputer>
 
 1147                                                detail::NormalVectorFromDCA>
 
 1174   template <
typename DCAComputer>
 
 1177                                                detail::TangentVectorFromDCA>
 
 1205   template <
typename DCAComputer>
 
 1208                                              detail::DistanceFromDCA>
 
 1247       template<
typename DSS>
 
 1250         typedef typename DSS::Vector Vector; 
 
 1252         Vector v = ( *aDSS.begin() - *boost::prior(aDSS.end()) ); 
 
 1253         Value l = v.norm(Vector::L_2);
 
 1255         return 1/( (l*l)/8 + 0.5 );  
 
 1275       template<
typename DSS>
 
 1278         typedef typename DSS::Vector Vector; 
 
 1280         Vector v = ( *aDSS.begin() - *boost::prior(aDSS.end()) ); 
 
 1281         Value l = v.norm(Vector::L_2);
 
 1283         Vector t( aDSS.getB(), aDSS.getA() );
 
 1284         Value w = 1.0 / v.norm(Vector::L_2); 
 
 1286         return 1.0/( (l*l)/(8*w) + w/2 ); 
 
 1308     template <
typename DSSComputer, 
typename Functor = detail::CurvatureFromDSSLength >
 
 1421         typedef typename DSSComputer::Integer Integer; 
 
 1422         typedef typename DSSComputer::Vector Vector; 
 
 1439         if (isConnectedAtBack) {
 
 1440           if (isConnectedAtFront) {
 
 1445             Integer mu = 
mySCPtr->getMu();
 
 1446             Integer omega = 
mySCPtr->getOmega();
 
 1449             if ( (
mySCPtr->getRemainder(*back)<=mu-1)&&
 
 1450                  (
mySCPtr->getRemainder(*front)<=mu-1) ) {                
 
 1452             } 
else if ( (
mySCPtr->getRemainder(*back)>=mu+omega)&&
 
 1453                         (
mySCPtr->getRemainder(*front)>=mu+omega) ) {           
 
 1462             Integer mu = 
mySCPtr->getMu();
 
 1463             Integer omega = 
mySCPtr->getOmega();
 
 1466             if ( (
mySCPtr->getRemainder(*back)<=mu-1) ) {                
 
 1468             } 
else if ( (
mySCPtr->getRemainder(*back)>=mu+omega) ) {     
 
 1473         } 
else if (isConnectedAtFront) {
 
 1476           Integer mu = 
mySCPtr->getMu();
 
 1477           Integer omega = 
mySCPtr->getOmega();
 
 1480           if ( (
mySCPtr->getRemainder(*front)<=mu-1) ) {                
 
 1482           } 
else if ( (
mySCPtr->getRemainder(*front)>=mu+omega) ) {     
 
 1501       template <
typename OutputIterator>
 
 1503                           OutputIterator result)
 
 1513                 *result++ = 
eval( it ); 
 
 1515               } 
while (it != ite);
 
 1560   template <
typename DSSComputer>
 
 1597   template <
typename DSSComputer>
 
 1622 #endif // !defined SegmentComputerEstimators_h 
 1624 #undef SegmentComputerEstimators_RECURSES 
 1625 #endif // else defined(SegmentComputerEstimators_RECURSES)