DGtal  1.2.0
demo-kernel-1.cpp
Go to the documentation of this file.
1 
36 #include <iostream>
37 #include "DGtal/base/Common.h"
38 #include "DGtal/kernel/SpaceND.h"
39 #include "DGtal/helpers/StdDefs.h"
40 #include "DGtal/kernel/domains/HyperRectDomain.h"
41 #include "DGtal/io/boards/Board2D.h"
42 
44 
45 using namespace std;
46 using namespace DGtal;
47 
49 
50 int main()
51 {
52  // define digital space and domain
53  typedef DGtal::SpaceND<2, DGtal::int32_t> MySpace;
54  typedef MySpace::Point MyPoint;
55  typedef HyperRectDomain<MySpace> MyDomain;
56  // define points in this domain
57  MyPoint p1(-3,-4);
58  MyPoint p2(10,4);
59  MyPoint p3(5,1);
60  MyDomain domain(p1,p2);
61  // 2D display
62  Board2D board;
63  board << domain;
64  board << p1 << p2 << p3;
65  board.saveSVG("demo-kernel-1.svg");
66  board.saveEPS("demo-kernel-1.eps");
67  return 0;
68 }
69 // //
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Definition: Board2D.h:71
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:805
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:1012
int main()
DGtal is the top-level namespace which contains all DGtal functions and types.
MyPointD Point
Definition: testClone2.cpp:383
Domain domain