A simple example of cellular grid space with several cells instantiated and visualized. This program outputs this image.
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/io/boards/Board2D.h"
#include "DGtal/io/Color.h"
using namespace std;
{
Board2D board;
K.init( plow, pup,
true );
board << SetMode(
domain.className(),
"Paving" )
Cell pixlow =
K.uSpel( plow );
Cell ptlow =
K.uPointel( plow );
Cell pixup =
K.uSpel( pup );
Cell ptup1 =
K.uPointel( pup );
Cell ptup2 =
K.uTranslation( ptup1, Point::diagonal() );
board << CustomStyle( ptlow.className(),
new CustomColors( Color( 0, 0, 200 ),
Color( 100, 100, 255 ) ) )
<< ptlow << ptup2;
board << CustomStyle( pixlow.className(),
new CustomColors( Color( 200, 0, 0 ),
Color( 255, 100, 100 ) ) )
<< pixlow << pixup;
board << CustomStyle( linelb.className(),
new CustomColors( Color( 0, 200, 0 ),
Color( 100, 255, 100 ) ) )
<< linelb << linelt << linell << linelr;
board.saveSVG("ctopo-1.svg");
board.saveEPS("ctopo-1.eps");
return 0;
}
Z2i this namespace gathers the standard of types for 2D imagery.
DGtal is the top-level namespace which contains all DGtal functions and types.
int main(int argc, char **argv)
HyperRectDomain< Space > Domain