#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"
{
typedef MySpace::Point MyPoint;
MyPoint p(13,-5);
trace.
info() <<
"Point p="<<p<<endl;
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;
trace.
info()<<
"Q="<<q<<endl;
MyPoint r;
for(MyPoint::Iterator it=r.begin(), itend=r.end() ;
it != itend;
++it)
(*it) = coord;
trace.
info()<<
"R="<<r<<endl;
for( MyDomain::ConstIterator it =
domain.begin(), itend =
domain.end();
it != itend;
++it)
trace.
info() <<
"Processing point"<< (*it) << endl;
MyDomain::ConstIterator itPrec =
domain.begin();
MyDomain::ConstIterator it = itPrec;
MyDomain::Vector shift;
++it;
board << (*itPrec);
for( MyDomain::ConstIterator itend =
domain.end();
it != itend;
++it, ++itPrec)
{
shift = (*it) -(*itPrec);
Display2DFactory::draw(board, shift, (*itPrec));
}
board.
saveSVG(
"kernel-domain-it-arrow.svg");
return 0;
}
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
void beginBlock(const std::string &keyword="")
void clear(const DGtal::Color &color=DGtal::Color::None)
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
DGtal is the top-level namespace which contains all DGtal functions and types.