Source of examples used to generate illustrations of Cubical Complex module documention.
#include <iostream>
#include <map>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/topology/KhalimskySpaceND.h"
#include "DGtal/topology/CubicalComplex.h"
#include "DGtal/io/boards/Board2D.h"
{
X.insertCell(
K.uSpel(
Point(1,1) ) );
X.insertCell(
K.uSpel(
Point(2,1) ) );
X.insertCell(
K.uSpel(
Point(3,1) ) );
X.insertCell(
K.uSpel(
Point(2,2) ) );
X.insertCell(
K.uSpel(
Point(3,2) ) );
X.insertCell(
K.uSpel(
Point(4,2) ) );
X.close();
<< X;
board.
saveTikZ(
"cubical-complex-illustrations-X.tikz" );
S.insertCell(
K.uCell(
Point( 5, 4 ) ) );
S.insertCell(
K.uCell(
Point( 4, 4 ) ) );
S.insertCell(
K.uCell(
Point( 7, 5 ) ) );
<< S;
board.
saveTikZ(
"cubical-complex-illustrations-S.tikz" );
<< X;
<< X.closure( S );
board.
saveTikZ(
"cubical-complex-illustrations-closure.tikz" );
<< X;
<< X.star( S );
board.
saveTikZ(
"cubical-complex-illustrations-star.tikz" );
<< X;
<< X.link( S );
board.
saveTikZ(
"cubical-complex-illustrations-link.tikz" );
<< X;
<< X.boundary();
board.
saveTikZ(
"cubical-complex-illustrations-bd.tikz" );
<< X;
<< X.interior();
board.
saveTikZ(
"cubical-complex-illustrations-int.tikz" );
<< X;
X[ p1 ] = CC::FIXED;
X[ p2 ] = CC::FIXED;
CC::DefaultCellMapIteratorPriority P;
functions::collapse( X, X.begin(), X.end(), P, true, true, true );
<< X
<< p1 << p2;
board.
saveTikZ(
"cubical-complex-illustrations-collapse.tikz" );
return 0;
}
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....
void beginBlock(const std::string &keyword="")
void saveTikZ(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
void clear(const DGtal::Color &color=DGtal::Color::None)
Z2i this namespace gathers the standard of types for 2D imagery.
DGtal is the top-level namespace which contains all DGtal functions and types.
Custom style class redefining the pen color and the fill color. You may use Board2D::Color::None for ...
std::string className() const
Return the style name used for drawing this object.
CubicalComplex< KSpace, Map > CC
HyperRectDomain< Space > Domain