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
- Tristan Roussillon (
trist.nosp@m.an.r.nosp@m.oussi.nosp@m.llon.nosp@m.@liri.nosp@m.s.cn.nosp@m.rs.fr
) Laboratoire d'InfoRmatique en Image et Systemes d'information - LIRIS (CNRS, UMR 5205), CNRS, France
- Date
- 2015/04/28
An example file named exampleBezierCurve.
This file is part of the DGtal library.
Definition in file exampleBezierCurve.cpp.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 52 of file exampleBezierCurve.cpp.
53{
56 for ( int i = 0; i < argc; ++i )
59
60
62 Point P(0,0), Q(4,4), R(8,0);
63
64
66
67
68 board <<
SetMode(P.className(),
"Grid") << P << Q << R;
70
71 board.
saveSVG(
"BezierCurve.svg", Board2D::BoundingBox, 5000 );
72 board.
saveEPS(
"BezierCurve.eps", Board2D::BoundingBox, 5000 );
73 board.
saveTikZ(
"BezierCurve.tikz", Board2D::BoundingBox, 5000 );
74 board.
saveFIG(
"BezierCurve.fig", Board2D::BoundingBox, 5000 );
75#ifdef WITH_CAIRO
76 board.
saveCairo(
"BezierCurve.pdf", Board2D::CairoPDF);
77#endif
78
80
81 board <<
SetMode(P.className(),
"Grid") << P << Q << R;
84
85 board.
saveSVG(
"BezierCurve2.svg", Board2D::BoundingBox, 5000 );
86 board.
saveEPS(
"BezierCurve2.eps", Board2D::BoundingBox, 5000 );
87 board.
saveTikZ(
"BezierCurve2.tikz", Board2D::BoundingBox, 5000 );
88 board.
saveFIG(
"BezierCurve2.fig", Board2D::BoundingBox, 5000 );
89#ifdef WITH_CAIRO
90 board.
saveCairo(
"BezierCurve2.pdf", Board2D::CairoPDF);
91#endif
92
94 return 0;
95}
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Aim: Implements basic operations that will be used in Point and Vector classes.
void beginBlock(const std::string &keyword="")
void saveTikZ(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
void saveFIG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0, bool includeFIGHeader=true) const
void drawQuadraticBezierCurve(double x1, double y1, double x2, double y2, double x3, double y3, int depthValue=-1)
void clear(const DGtal::Color &color=DGtal::Color::None)
Board & setFillColor(const DGtal::Color &color)
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
void saveCairo(const char *filename, CairoType type=CairoPNG, PageSize size=Board::BoundingBox, double margin=10.0) const
Modifier class in a Board2D stream. Useful to choose your own mode for a given class....
References DGtal::Trace::beginBlock(), LibBoard::Board::clear(), LibBoard::Board::drawQuadraticBezierCurve(), DGtal::Trace::endBlock(), DGtal::Trace::info(), DGtal::Color::None, LibBoard::Board::saveCairo(), LibBoard::Board::saveEPS(), LibBoard::Board::saveFIG(), LibBoard::Board::saveSVG(), LibBoard::Board::saveTikZ(), LibBoard::Board::setFillColor(), and DGtal::trace.