Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
range.cpp
Go to the documentation of this file.
1
16
30
31
32
38
39
41#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
50using namespace std;
51using namespace DGtal;
52
54
55int 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// //
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
DGtal is the top-level namespace which contains all DGtal functions and types.
Trace trace
STL namespace.
int main()
Definition range.cpp:55
HyperRectDomain_ReverseIterator< ConstIterator > ConstReverseIterator
Domain domain