DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
dgtalBoard2D-3-custom-classes.cpp
Go to the documentation of this file.
1
16
29
40
42
#include <iostream>
43
#include "DGtal/base/Common.h"
44
#include "DGtal/io/boards/Board2D.h"
45
#include "DGtal/helpers/StdDefs.h"
46
#include "DGtal/io/Color.h"
48
49
using namespace
std
;
50
using namespace
DGtal
;
51
using namespace
DGtal::Z2i
;
52
54
int
main
()
55
{
56
trace
.
beginBlock
(
"Example dgtalBoard2D-3-custom-classes"
);
57
58
Point
p1( -3, -2 );
59
Point
p2( 7, 3 );
60
Point
p3( 0, 0 );
61
Domain
domain
( p1, p2 );
62
63
Color
red( 255, 0, 0 );
64
Color
dred( 192, 0, 0 );
65
Color
dgreen( 0, 192, 0 );
66
Color
blue( 0, 0, 255 );
67
Color
dblue( 0, 0, 192 );
68
69
Board2D
board;
70
board <<
domain
71
<<
CustomStyle
( p1.className(),
new
CustomColors
( red, dred ) )
72
<< p1
73
<<
CustomStyle
( p2.className(),
new
CustomFillColor
( dgreen ) )
74
<< p2
75
<<
CustomStyle
( p3.className(),
76
new
CustomPen
( blue, dblue, 6.0,
77
Board2D::Shape::SolidStyle
,
78
Board2D::Shape::RoundCap
,
79
Board2D::Shape::RoundJoin
) )
80
<< p3;
81
board.
saveSVG
(
"dgtalBoard2D-3-custom-classes.svg"
);
82
board.
saveEPS
(
"dgtalBoard2D-3-custom-classes.eps"
);
83
board.
saveTikZ
(
"dgtalBoard2D-3-custom-classes.tikz"
);
84
85
#ifdef DGTAL_WITH_CAIRO
86
board.
saveCairo
(
"dgtalBoard2D-3-custom-classes-cairo.pdf"
,
Board2D::CairoPDF
);
87
board.
saveCairo
(
"dgtalBoard2D-3-custom-classes-cairo.png"
,
Board2D::CairoPNG
);
88
board.
saveCairo
(
"dgtalBoard2D-3-custom-classes-cairo.ps"
,
Board2D::CairoPS
);
89
board.
saveCairo
(
"dgtalBoard2D-3-custom-classes-cairo.svg"
,
Board2D::CairoSVG
);
90
#endif
91
92
trace
.
endBlock
();
93
return
0;
94
}
95
// //
DGtal::Board2D
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Definition
Board2D.h:71
DGtal::Color
Structure representing an RGB triple with alpha component.
Definition
Color.h:77
DGtal::Point
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::endBlock
double endBlock()
DGtal::Domain
LibBoard::Board::saveTikZ
void saveTikZ(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition
Board.cpp:1218
LibBoard::Board::saveEPS
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition
Board.cpp:804
LibBoard::Board::saveSVG
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition
Board.cpp:1011
LibBoard::Board::CairoSVG
@ CairoSVG
Definition
Board.h:40
LibBoard::Board::CairoPDF
@ CairoPDF
Definition
Board.h:40
LibBoard::Board::CairoPNG
@ CairoPNG
Definition
Board.h:40
LibBoard::Board::CairoPS
@ CairoPS
Definition
Board.h:40
LibBoard::Board::saveCairo
void saveCairo(const char *filename, CairoType type=CairoPNG, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition
Board.cpp:1138
DGtal::Z2i
Z2i this namespace gathers the standard of types for 2D imagery.
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::trace
Trace trace
std
STL namespace.
DGtal::CustomColors
Custom style class redefining the pen color and the fill color. You may use Board2D::Color::None for ...
Definition
Board2D.h:279
DGtal::CustomFillColor
Custom style class redefining the fill color. You may use Board2D::Color::None for transparent color.
Definition
Board2D.h:343
DGtal::CustomPen
Custom style class redefining the pen attributes. You may use Board2D::Color::None for transparent co...
Definition
Board2D.h:374
DGtal::CustomStyle::CustomStyle
CustomStyle(std::string classname, DrawableWithBoard2D *style)
Definition
Board2D.h:224
LibBoard::Shape::RoundJoin
@ RoundJoin
Definition
Board/Shapes.h:61
LibBoard::Shape::SolidStyle
@ SolidStyle
Definition
Board/Shapes.h:62
LibBoard::Shape::RoundCap
@ RoundCap
Definition
Board/Shapes.h:60
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
domain
Domain domain
Definition
testProjection.cpp:88
examples
io
boards
dgtalBoard2D-3-custom-classes.cpp
Generated on
for DGtal by
1.18.0