DGtal  1.4.beta
dgtalBoard2D-3-custom-points.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/io/Color.h"
#include "DGtal/io/boards/Board2D.h"
#include "DGtal/helpers/StdDefs.h"
Include dependency graph for dgtalBoard2D-3-custom-points.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
Jacques-Olivier Lachaud (jacqu.nosp@m.es-o.nosp@m.livie.nosp@m.r.la.nosp@m.chaud.nosp@m.@uni.nosp@m.v-sav.nosp@m.oie..nosp@m.fr ) Laboratory of Mathematics (CNRS, UMR 5807), University of Savoie, France
Date
2010/11/26

An example file named dgtalboard-3-custom-points.

This file is part of the DGtal library.

Definition in file dgtalBoard2D-3-custom-points.cpp.

Function Documentation

◆ main()

int main ( void  )

Definition at line 71 of file dgtalBoard2D-3-custom-points.cpp.

72 {
73  trace.beginBlock ( "Example dgtalBoard2D-3-custom-points" );
74 
75  Point p1( -3, -2 );
76  Point p2( 7, 3 );
77  Point p3( 0, 0 );
78  Domain domain( p1, p2 );
79 
80  Color red( 255, 0, 0 );
81  Color dred( 192, 0, 0 );
82  Color green( 0, 255, 0 );
83  Color dgreen( 0, 192, 0 );
84  Color blue( 0, 0, 255 );
85  Color dblue( 0, 0, 192 );
86 
87  Board2D board;
88  board << domain
89  << CustomStyle( p1.className(), new MyDrawStyleCustomColor( red, dred ) )
90  << p1
91  << CustomStyle( p2.className(), new MyDrawStyleCustomColor( green, dgreen ) )
92  << p2
93  << CustomStyle( p3.className(), new MyDrawStyleCustomColor( blue, dblue ) )
94  << p3;
95  board.saveSVG("dgtalBoard2D-3-custom-points.svg");
96  board.saveEPS("dgtalBoard2D-3-custom-points.eps");
97  board.saveTikZ("dgtalBoard2D-3-custom-points.tikz");
98 
99 #ifdef WITH_CAIRO
100  board.saveCairo("dgtalBoard2D-3-custom-points-cairo.pdf", Board2D::CairoPDF);
101  board.saveCairo("dgtalBoard2D-3-custom-points-cairo.png", Board2D::CairoPNG);
102  board.saveCairo("dgtalBoard2D-3-custom-points-cairo.ps", Board2D::CairoPS);
103  board.saveCairo("dgtalBoard2D-3-custom-points-cairo.svg", Board2D::CairoSVG);
104 #endif
105 
106  trace.endBlock();
107  return 0;
108 }
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
void beginBlock(const std::string &keyword="")
double endBlock()
void saveTikZ(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:1218
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:804
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:1011
void saveCairo(const char *filename, CairoType type=CairoPNG, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:1138
Trace trace
Definition: Common.h:153
Domain domain

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