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"
48 using namespace DGtal;
55 template <
typename Range>
63 std::vector<Value> v1, v2;
64 std::list<Value> l3, l4;
69 for ( ; i != end; ++i) {
79 for ( ; i != end; ++i) {
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()) );
128 template <
typename Range>
129 void testRangeConceptChecking()
138 int main(
int argc,
char** argv )
142 for (
int i = 0; i < argc; ++i )
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);
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)));
187 testRangeConceptChecking<SimpleRange>();
188 testRangeConceptChecking<BoolRange>();
189 testRangeConceptChecking<PointRange>();
196 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Aim: Provides an adapter for classical iterators that can iterate through the underlying data structu...
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,...
Aim: model of CBidirectionalRangeFromPoint that adapts any range of elements bounded by two iterators...
std::reverse_iterator< ConstCirculator > ConstReverseCirculator
TConstIterator ConstIterator
std::reverse_iterator< ConstIterator > ConstReverseIterator
void beginBlock(const std::string &keyword="")
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
bool isNotEmpty(const IC &itb, const IC &ite, IteratorType)
DGtal is the top-level namespace which contains all DGtal functions and types.
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 ...
int main(int argc, char **argv)
bool testRange(Container c)