DGtal  1.3.beta
range.cpp
Go to the documentation of this file.
1 
40 #include <iostream>
42 #include "DGtal/base/Common.h"
43 #include "DGtal/kernel/SpaceND.h"
44 #include "DGtal/helpers/StdDefs.h"
45 #include "DGtal/kernel/domains/HyperRectDomain.h"
46 #include "DGtal/io/boards/Board2D.h"
47 
49 
50 using namespace std;
51 using namespace DGtal;
52 
54 
55 int main()
56 {
57  trace.beginBlock ( "Example range" );
58 
59  typedef SpaceND<3> TSpace;
60  TSpace::Point a(1, 1, 1);
61  TSpace::Point b(5, 5, 5);
63 
64  std::vector<TSpace::Dimension> v(2); v[0]=2; v[1]=1;
65  TSpace::Point c(3,1,1);
67  it = domain.subRange(v, c).rbegin(), itend = domain.subRange(v, c).rend();
68  it != itend;
69  ++it)
70  trace.info() << "Processing point"<< (*it) << endl;
71 
72  trace.endBlock();
73 
74  trace.beginBlock ( "Example range with CPP11 initializer list" );
75 
77  it = domain.subRange({2,1}, c).rbegin(), itend = domain.subRange({2,1}, c).rend();
78  it != itend;
79  ++it)
80  trace.info() << "Processing point"<< (*it) << endl;
81 
82  trace.endBlock();
83 
84 
86  domain2=domain;
87 
89  it = domain.subRange({2,1}, c).rbegin(), itend = domain.subRange({2,1}, c).rend();
90  it != itend;
91  ++it)
92  trace.info() << "Processing point"<< (*it) << endl;
93 
94  return 0;
95 }
96 // //
DGtal::HyperRectDomain
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
Definition: HyperRectDomain.h:99
DGtal::Trace::endBlock
double endBlock()
DGtal::HyperRectDomain_ReverseIterator
Reverse iterator for HyperRectDomain.
Definition: HyperRectDomain_Iterator.h:66
DGtal::trace
Trace trace
Definition: Common.h:154
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::SpaceND
Definition: SpaceND.h:95
DGtal::Trace::info
std::ostream & info()
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
main
int main()
Definition: range.cpp:55
domain
Domain domain
Definition: testProjection.cpp:88
DGtal::HyperRectDomain::subRange
ConstSubRange subRange(const std::vector< Dimension > &permutation) const
Definition: HyperRectDomain.h:472
Point
MyPointD Point
Definition: testClone2.cpp:383