DGtal  1.3.beta
doc-examples/range.cpp

Example of range on Domain.

DGtal Space
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/kernel/SpaceND.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/kernel/domains/HyperRectDomain.h"
#include "DGtal/io/boards/Board2D.h"
using namespace std;
using namespace DGtal;
int main()
{
trace.beginBlock ( "Example range" );
typedef SpaceND<3> TSpace;
TSpace::Point a(1, 1, 1);
TSpace::Point b(5, 5, 5);
std::vector<TSpace::Dimension> v(2); v[0]=2; v[1]=1;
TSpace::Point c(3,1,1);
it = domain.subRange(v, c).rbegin(), itend = domain.subRange(v, c).rend();
it != itend;
++it)
trace.info() << "Processing point"<< (*it) << endl;
trace.beginBlock ( "Example range with CPP11 initializer list" );
it = domain.subRange({2,1}, c).rbegin(), itend = domain.subRange({2,1}, c).rend();
it != itend;
++it)
trace.info() << "Processing point"<< (*it) << endl;
domain2=domain;
it = domain.subRange({2,1}, c).rbegin(), itend = domain.subRange({2,1}, c).rend();
it != itend;
++it)
trace.info() << "Processing point"<< (*it) << endl;
return 0;
}
// //
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(int argc, char **argv)
Definition: testArithmeticDSS-benchmark.cpp:147
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