DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
logoDGtal.cpp
1 
27 
28 #include <iostream>
29 #include "DGtal/base/Common.h"
30 #include "DGtal/io/boards/Board2D.h"
31 #include "DGtal/helpers/StdDefs.h"
33 
34 using namespace std;
35 using namespace DGtal;
36 using namespace DGtal::Z2i;
37 
39 
40 int main()
41 {
42  trace.beginBlock ( "Generate DGtal logo (without drop shadow)" );
43 
45  Point p1( 0,0 );
46  Point p2( 26, 8 );
47  Domain domain( p1, p2 );
48 
49  Board2D board;
50  board << SetMode( domain.className(), "Paving" ) << domain;
51  board << CustomStyle( p1.className(),
52  new CustomPen( Color(0,0,0), Color(180,180,180), 2.5,
53  Board2D::Shape::SolidStyle,
54  Board2D::Shape::RoundCap,
55  Board2D::Shape::RoundJoin ))
56  << Point(1,1) << Point(1,2) << Point(1,3)
57  << Point(1,4) << Point(1,5) << Point(1,6)
58  << Point(1,7) << Point(2,1) << Point(3,1) << Point(4,1)
59  << Point(4,2) << Point(5,2) << Point(5,3)
60  << Point(5,4) << Point(5,5) << Point(5,6)
61  << Point(4,6) << Point(4,7) << Point(3,7)
62  << Point(2,7) << Point(9,1) << Point(9,2)
63  << Point(8,2) << Point(8,3)
64  << Point(8,4) << Point(8,5) << Point(8,6)
65  << Point(9,6) << Point(9,7) << Point(10,7)
66  << Point(11,7) << Point(10,1) << Point(11,1) << Point(12,1)
67  << Point(12,2) << Point(12,3) << Point(12,4) << Point(11,4);
68 
69  board << CustomStyle( p1.className(),
70  new CustomPen( Color(0,0,0), Color(0,0,0), 1.0,
71  Board2D::Shape::SolidStyle,
72  Board2D::Shape::RoundCap,
73  Board2D::Shape::RoundJoin ))
74  << Point(15,1) << Point(16,1) << Point(17,1)
75  << Point(15,2) << Point(15,3) << Point(15,4)
76  << Point(15,5) << Point(16,4)
77  << Point(19,1) << Point(21,1) << Point(20,1) << Point(22,1)
78  << Point(19,2) << Point(21,2)
79  << Point(19,3) << Point(20,3) << Point(21,3)
80  << Point(24,1) << Point(25,1)
81  << Point(24,2) << Point(24,3) << Point(24,4) << Point(24,5);
82 
83  board.saveSVG("logoDGtal.svg");
85 
86  trace.endBlock();
87  return 0;
88 }
89 // //