DGtal 1.4.2
Loading...
Searching...
No Matches
range.cpp
Go to the documentation of this file.
1
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
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
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// //
Reverse iterator for HyperRectDomain.
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
ConstSubRange subRange(const std::vector< Dimension > &permutation) const
void beginBlock(const std::string &keyword="")
std::ostream & info()
double endBlock()
DGtal is the top-level namespace which contains all DGtal functions and types.
Trace trace
Definition Common.h:153
STL namespace.
int main()
Definition range.cpp:55
Domain domain