DGtal  1.5.beta
logoDGtal.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/io/boards/Board2D.h"
#include "DGtal/helpers/StdDefs.h"
Include dependency graph for logoDGtal.cpp:

Go to the source code of this file.

Functions

int main ()
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
David Coeurjolly (david.nosp@m..coe.nosp@m.urjol.nosp@m.ly@l.nosp@m.iris..nosp@m.cnrs.nosp@m..fr ) CNRS, LIRIS UMR 5205, Université de Lyon, France
Date
2012/04/19

Definition in file logoDGtal.cpp.

Function Documentation

◆ main()

int main ( void  )

[logoDGtal-main]

[logoDGtal-main]

Definition at line 50 of file logoDGtal.cpp.

51 {
52  trace.beginBlock ( "Generate DGtal logo (without drop shadow)" );
53 
55  Point p1( 0,0 );
56  Point p2( 26, 8 );
57  Domain domain( p1, p2 );
58 
59  Board2D board;
60  board << SetMode( domain.className(), "Paving" ) << domain;
61  board << CustomStyle( p1.className(),
62  new CustomPen( Color(0,0,0), Color(180,180,180), 2.5,
63  Board2D::Shape::SolidStyle,
64  Board2D::Shape::RoundCap,
65  Board2D::Shape::RoundJoin ))
66  << Point(1,1) << Point(1,2) << Point(1,3)
67  << Point(1,4) << Point(1,5) << Point(1,6)
68  << Point(1,7) << Point(2,1) << Point(3,1) << Point(4,1)
69  << Point(4,2) << Point(5,2) << Point(5,3)
70  << Point(5,4) << Point(5,5) << Point(5,6)
71  << Point(4,6) << Point(4,7) << Point(3,7)
72  << Point(2,7) << Point(9,1) << Point(9,2)
73  << Point(8,2) << Point(8,3)
74  << Point(8,4) << Point(8,5) << Point(8,6)
75  << Point(9,6) << Point(9,7) << Point(10,7)
76  << Point(11,7) << Point(10,1) << Point(11,1) << Point(12,1)
77  << Point(12,2) << Point(12,3) << Point(12,4) << Point(11,4);
78 
79  board << CustomStyle( p1.className(),
80  new CustomPen( Color(0,0,0), Color(0,0,0), 1.0,
81  Board2D::Shape::SolidStyle,
82  Board2D::Shape::RoundCap,
83  Board2D::Shape::RoundJoin ))
84  << Point(15,1) << Point(16,1) << Point(17,1)
85  << Point(15,2) << Point(15,3) << Point(15,4)
86  << Point(15,5) << Point(16,4)
87  << Point(19,1) << Point(21,1) << Point(20,1) << Point(22,1)
88  << Point(19,2) << Point(21,2)
89  << Point(19,3) << Point(20,3) << Point(21,3)
90  << Point(24,1) << Point(25,1)
91  << Point(24,2) << Point(24,3) << Point(24,4) << Point(24,5);
92 
93  board.saveSVG("logoDGtal.svg");
95 
96  trace.endBlock();
97  return 0;
98 }
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Definition: Board2D.h:71
Structure representing an RGB triple with alpha component.
Definition: Color.h:68
std::string className() const
void beginBlock(const std::string &keyword="")
double endBlock()
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:1011
Trace trace
Definition: Common.h:153
Custom style class redefining the pen attributes. You may use Board2D::Color::None for transparent co...
Definition: Board2D.h:374
Modifier class in a Board2D stream. Useful to choose your own mode for a given class....
Definition: Board2D.h:247
MyPointD Point
Definition: testClone2.cpp:383
Domain domain

References DGtal::Trace::beginBlock(), DGtal::HyperRectDomain< TSpace >::className(), DGtal::PointVector< dim, TEuclideanRing, TContainer >::className(), domain, DGtal::Trace::endBlock(), LibBoard::Board::saveSVG(), and DGtal::trace.