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);
typedef HyperRectDomain<MySpace> MyDomain;
MyPoint a(-3,-4);
MyPoint b(10,4);
Board2D board;
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;
board.clear();
++it;
board << (*itPrec);
it != itend;
++it, ++itPrec)
{
shift = (*it) -(*itPrec);
}
board.saveSVG("kernel-domain-it-arrow.svg");
return 0;
}
void beginBlock(const std::string &keyword="")
DigitalPlane::Point Vector
MyDigitalSurface::ConstIterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.
int main(int argc, char **argv)
void draw(const Iterator &itb, const Iterator &ite, Board &aBoard)