DGtal  0.9.3beta
demo-kernel-1.cpp
1 
29 #include <iostream>
31 #include "DGtal/base/Common.h"
32 #include "DGtal/kernel/SpaceND.h"
33 #include "DGtal/helpers/StdDefs.h"
34 #include "DGtal/kernel/domains/HyperRectDomain.h"
35 #include "DGtal/io/boards/Board2D.h"
36 
38 
39 using namespace std;
40 using namespace DGtal;
41 
43 
44 int main()
45 {
46  // define digital space and domain
47  typedef DGtal::SpaceND<2, DGtal::int32_t> MySpace;
48  typedef MySpace::Point MyPoint;
49  typedef HyperRectDomain<MySpace> MyDomain;
50  // define points in this domain
51  MyPoint p1(-3,-4);
52  MyPoint p2(10,4);
53  MyPoint p3(5,1);
54  MyDomain domain(p1,p2);
55  // 2D display
56  Board2D board;
57  board << domain;
58  board << p1 << p2 << p3;
59  board.saveSVG("demo-kernel-1.svg");
60  board.saveEPS("demo-kernel-1.eps");
61  return 0;
62 }
63 // //
Aim: SpaceND is a utility class that defines the fundamental structure of a Digital Space in ND...
Definition: SpaceND.h:95
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
STL namespace.
DGtal is the top-level namespace which contains all DGtal functions and types.
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:1012
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:805
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)...
Definition: Board2D.h:70