42 template <
typename SegmentComputer,
typename SCEstimator>
49 template <
typename SegmentComputer,
typename SCEstimator>
53 const SCEstimator& aSCEstimator)
54 : myH(0), mySC(aSegmentComputer), mySCEstimator(aSCEstimator)
59 template <
typename SegmentComputer,
typename SCEstimator>
70 mySCEstimator.
init( myH, myBegin, myEnd );
76 template <
typename SegmentComputer,
typename SCEstimator>
81 return ( (myH > 0)&&(
isNotEmpty(myBegin, myEnd)) );
85 template <
typename SegmentComputer,
typename SCEstimator>
86 template <
typename OutputIterator>
92 OutputIterator result)
95 return endEval (itb, ite, itCurrent, first, last, result, Type() );
99 template <
typename SegmentComputer,
typename SCEstimator>
100 template <
typename OutputIterator>
108 mySCEstimator.attach( *last );
109 result = mySCEstimator.
eval( itCurrent, ite, result );
114 template <
typename SegmentComputer,
typename SCEstimator>
115 template <
typename OutputIterator>
128 mySCEstimator.attach( *last );
129 result = mySCEstimator.eval( itCurrent, itEnd, result );
131 if (itCurrent != ite)
134 mySCEstimator.attach( *first );
135 result = mySCEstimator.eval( itCurrent, ite, result );
140 mySCEstimator.attach( *last );
141 result = mySCEstimator.eval( itCurrent, ite, result );
147 template <
typename SegmentComputer,
typename SCEstimator>
148 template <
typename OutputIterator>
153 OutputIterator result) {
158 if ((myBegin != itb) || (myEnd != ite))
167 if (this->isValid()) {
174 if (nextSegIt != segItEnd )
178 if (nextSegIt == segItEnd )
180 mySCEstimator.attach( *segIt );
181 result = mySCEstimator.eval( itb, ite, result );
189 while (nextSegIt != segItEnd)
194 mySCEstimator.attach( *segIt );
195 result = mySCEstimator.eval( itCurrent, itEnd, result );
204 result = endEval(itb, ite, itCurrent, segItBegin, segIt, result);
213 std::cerr <<
"[DGtal::MostCenteredMaximalSegmentEstimator<SegmentComputer,SCEstimator>::eval(const ConstIterator& itb, const ConstIterator& ite,OutputIterator result)]"
214 <<
" ERROR. Object is not initialized." << std::endl;
224 template <
typename SegmentComputer,
typename SCEstimator>
230 if ( this->isValid() )
236 mySCEstimator.attach( mySC );
237 return mySCEstimator.eval( it );
241 std::cerr <<
"[DGtal::MostCenteredMaximalSegmentEstimator<SegmentComputer,SCEstimator>::eval(const ConstIterator& it)]"
242 <<
" ERROR. Iterator is invalid (==myEnd)." << std::endl;
250 std::cerr <<
"[DGtal::MostCenteredMaximalSegmentEstimator<SegmentComputer,SCEstimator>::eval(const ConstIterator& it)]"
251 <<
" ERROR. Object is not initialized." << std::endl;