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
- Kacper Pluta (
kacpe.nosp@m.r.pl.nosp@m.uta@e.nosp@m.siee.nosp@m..fr
) Laboratoire d'Informatique Gaspard-Monge - LIGM, France
- Date
- 2015/11/03
An example file named digitalSetToCubicalComplexes2D.
This file is part of the DGtal library.
Definition in file digitalSetToCubicalComplexes2D.cpp.
int main |
( |
int | , |
|
|
char ** | ) |
Definition at line 65 of file digitalSetToCubicalComplexes2D.cpp.
66{
70 MyEuclideanShape shape(
RealPoint( 0.0, 0.0 ), 16, 5, 5, M_PI_2/2. );
71
73 MyGaussDigitizer digShape;
75 digShape.init ( shape.getLowerBound(), shape.getUpperBound(), 1.0 );
76 Domain domainShape = digShape.getDomain();
79
82 Color dorange ( 255, 136, 0, 220 );
84 board << aSet;
86
88 typedef map<Cell, CubicalCellData>
Map;
90
92 K.
init ( domainShape.lowerBound(), domainShape.upperBound(),
true );
95
96 board <<
SetMode( domainShape.className(),
"Paving" ) << domainShape;
97
101 it != itE; ++it )
102 {
103 if ( d == 0 )
106 Color( 0, 0, 0 ) ) );
107 else if ( d == 1 )
110 Color( 100, 255, 100 ) ) );
111 else
114 Color( 100, 255, 100 ) ) );
115 board << it->first;
116 }
117
118 board.
saveEPS (
"cubicalComplexes.eps" );
121 return 0;
122}
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Structure representing an RGB triple with alpha component.
Aim: This class represents an arbitrary cubical complex living in some Khalimsky space....
CellMap::const_iterator CellMapConstIterator
Const iterator for visiting type CellMap.
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Aim: Model of the concept StarShaped represents any flower with k-petals in the plane.
void attach(ConstAlias< EuclideanShape > shape)
std::string className() const
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
static void digitalShaper(TDigitalSet &aSet, const TShapeFunctor &aFunctor)
void beginBlock(const std::string &keyword="")
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Space::RealPoint RealPoint
DGtal::uint32_t Dimension
Custom style class redefining the pen color and the fill color. You may use Board2D::Color::None for ...
Custom style class redefining the fill color. You may use Board2D::Color::None for transparent color.
Modifier class in a Board2D stream. Useful to choose your own mode for a given class....
std::unordered_map< Cell, CubicalCellData > Map
CubicalComplex< KSpace, Map > CC
CC::CellMapConstIterator CellMapConstIterator
References DGtal::GaussDigitizer< TSpace, TEuclideanShape >::attach(), DGtal::Trace::beginBlock(), DGtal::DigitalSetByAssociativeContainer< TDomain, TContainer >::className(), DGtal::HyperRectDomain< TSpace >::className(), DGtal::Shapes< TDomain >::digitalShaper(), DGtal::Trace::endBlock(), DGtal::KhalimskySpaceND< dim, TInteger >::init(), K, DGtal::HyperRectDomain< TSpace >::lowerBound(), LibBoard::Board::saveEPS(), DGtal::trace, and DGtal::HyperRectDomain< TSpace >::upperBound().