36#include "DGtal/base/Common.h" 
   37#include "DGtal/base/BasicFunctors.h" 
   38#include "DGtal/base/CConstBidirectionalRange.h" 
   39#include "DGtal/base/ConstRangeAdapter.h" 
   41#include "DGtal/topology/KhalimskySpaceND.h" 
   42#include "DGtal/topology/SCellsFunctors.h" 
   43#include "DGtal/kernel/BasicPointFunctors.h" 
   45#include "DGtal/base/IteratorFunctions.h" 
   55template <
typename Range>
 
   56bool testRange(
const Range &aRange)
 
   60  trace.info() << 
"Testing Range" << endl;
 
   63  std::vector<Value> v1, v2; 
 
   64  std::list<Value> l3, l4; 
 
   66    trace.info() << 
"Forward" << endl;
 
   69    for ( ; i != end; ++i) {
 
   76    trace.info() << 
"Backward" << endl;
 
   79    for ( ; i != end; ++i) {
 
   86    trace.info() << 
"Circulator" << endl;
 
   90    trace.info() << 
"c is valid: "<< (int)c.
isValid() << 
" --  " << *c << std::endl;
 
   91    trace.info() << 
"cend is valid: "<< (int)cend.
isValid() << 
" --   " << *cend << std::endl;
 
  107    trace.info() << 
"Reverse Circulator" << endl;
 
  122  return ( std::equal(v1.begin(),v1.end(),l3.begin())
 
  123           && std::equal(v1.begin(),v1.end(),v2.rbegin())
 
  124           && (l3.front() == l4.front()) );
 
  128template <
typename Range>
 
  129void testRangeConceptChecking()
 
  138int main( 
int argc, 
char** argv )
 
  140  trace.beginBlock ( 
"Testing class ConstRangeAdapter" );
 
  141  trace.info() << 
"Args:";
 
  142  for ( 
int i = 0; i < argc; ++i )
 
  143    trace.info() << 
" " << argv[ i ];
 
  144  trace.info() << endl;
 
  149  std::back_insert_iterator<std::vector<int> > ito(v); 
 
  150  for (
int i = 1; i < n; ++i) 
 
  155  SimpleRange r1(v.begin(), v.end(), df); 
 
  161  BoolRange r2(v.begin(), v.end(), t); 
 
  165  typedef K::Point Point3; 
 
  168  v3.push_back(ks.sCell(Point3(1,1,0))); 
 
  169  v3.push_back(ks.sCell(Point3(2,1,1))); 
 
  170  v3.push_back(ks.sCell(Point3(3,1,2))); 
 
  174  typedef S::Point Point2; 
 
  187  testRangeConceptChecking<SimpleRange>();
 
  188  testRangeConceptChecking<BoolRange>();
 
  189  testRangeConceptChecking<PointRange>();
 
  192  bool res = testRange(r1) 
 
  196  trace.emphase() << ( res ? 
"Passed." : 
"Error." ) << endl;
 
Aim: model of CConstBidirectionalRange that adapts any range of elements bounded by two iterators [it...
 
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
 
boost::reverse_iterator< ConstIterator > ConstReverseIterator
 
boost::reverse_iterator< ConstCirculator > ConstReverseCirculator
 
DGtal::Circulator< ConstIterator > ConstCirculator
 
ConstIterator ConstIterator
 
Aim: Define a new Functor from the composition of two other functors.
 
Aim: transforms a signed cell c into a point corresponding to the signed cell of greater dimension th...
 
Aim: A small functor with an operator () that compares one value to a threshold value according to tw...
 
std::vector< Point > PointRange
 
DGtal is the top-level namespace which contains all DGtal functions and types.
 
bool isNotEmpty(const IC &itb, const IC &ite)
 
Aim: Defines the concept describing a bidirectional const range.
 
Aim: Define a simple default functor that just returns its argument.
 
Aim: Functor that maps a point P of dimension i to a point Q of dimension j. The member myDims is an ...