Example of DGtal kernel with Domain.
- See also
- DGtal Space
Iteration over a domain with displacements depicted as arrows.
#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;
{
MyPoint p(13,-5);
MyPoint a(-3,-4);
MyPoint b(10,4);
board.
saveSVG(
"kernel-domain.svg");
MyPoint c(5,1);
trace.
info() <<
"C is inside the domain"<<endl;
else
trace.
info() <<
"C is outside the domain"<<endl;
board << c;
board.
saveSVG(
"kernel-domain-point.svg");
MyPoint q;
MyPoint::Coordinate coord = 24;
for(MySpace::Dimension d = 0 ; d < MySpace::dimension; d++)
q[d] = coord;
MyPoint r;
for(MyPoint::Iterator it=r.begin(), itend=r.end() ;
it != itend;
++it)
(*it) = coord;
it != itend;
++it)
trace.
info() <<
"Processing point"<< (*it) << endl;
++it;
board << (*itPrec);
it != itend;
++it, ++itPrec)
{
shift = (*it) -(*itPrec);
}
board.
saveSVG(
"kernel-domain-it-arrow.svg");
return 0;
}
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
bool isInside(const Point &p) const
const ConstIterator & end() const
const ConstIterator & begin() const