DGtal 1.3.0
Loading...
Searching...
No Matches
Functions
range.cpp File Reference
#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"

Go to the source code of this file.

Functions

int main ()
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
David Coeurjolly (david.nosp@m..coe.nosp@m.urjol.nosp@m.ly@l.nosp@m.iris..nosp@m.cnrs.nosp@m..fr )
Guillaume Damiand Laboratoire d'InfoRmatique en Image et Systèmes d'information - LIRIS (CNRS, UMR 5205), CNRS, France
Date
2011/04/04

An example file named range.

This file is part of the DGtal library.

Definition in file range.cpp.

Function Documentation

◆ main()

int main ( void  )

Definition at line 55 of file range.cpp.

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}
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()
Trace trace
Definition: Common.h:154
Domain domain

References DGtal::Trace::beginBlock(), domain, DGtal::Trace::endBlock(), DGtal::Trace::info(), DGtal::HyperRectDomain< TSpace >::subRange(), and DGtal::trace.