DGtal 1.3.0
Loading...
Searching...
No Matches
doc-examples/range.cpp

Example of range on Domain.

See also
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.endBlock();
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;
trace.endBlock();
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;
}
// //
Reverse iterator for HyperRectDomain.
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
void beginBlock(const std::string &keyword="")
std::ostream & info()
double endBlock()
DGtal is the top-level namespace which contains all DGtal functions and types.
STL namespace.
int main()
Definition: testBits.cpp:56
Domain domain