DGtal  1.3.beta
doc-examples/demo-kernel-1.cpp

Example of DGtal kernel and export with Board2D.

Display 2D points in its domain and export woth Board2D.
#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()
{
// define digital space and domain
typedef MySpace::Point MyPoint;
typedef HyperRectDomain<MySpace> MyDomain;
// define points in this domain
MyPoint p1(-3,-4);
MyPoint p2(10,4);
MyPoint p3(5,1);
MyDomain domain(p1,p2);
// 2D display
Board2D board;
board << domain;
board << p1 << p2 << p3;
board.saveSVG("demo-kernel-1.svg");
board.saveEPS("demo-kernel-1.eps");
return 0;
}
// //
DGtal::HyperRectDomain
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
Definition: HyperRectDomain.h:99
DGtal::SpaceND
Definition: SpaceND.h:95
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
LibBoard::Board::saveSVG
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:1012
main
int main(int argc, char **argv)
Definition: testArithmeticDSS-benchmark.cpp:147
DGtal::Board2D
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Definition: Board2D.h:70
LibBoard::Board::saveEPS
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:805
domain
Domain domain
Definition: testProjection.cpp:88
Point
MyPointD Point
Definition: testClone2.cpp:383