A simple example of cellular grid space with several cells instantiated and visualized in 3D. This program outputs this image.
- See also
- Cells may be unsigned or signed
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/io/DrawWithDisplay3DModifier.h"
#include "DGtal/io/viewers/Viewer3D.h"
using namespace std;
int main(
int argc,
char** argv )
{
QApplication application(argc,argv);
K.init( plow, pup,
true );
typedef Viewer3D<Space, KSpace> MyViewer;
viewer.show();
viewer << SetMode3D(
domain.className(),
"Paving" );
Cell ptlow =
K.uPointel( plow );
Cell ptup1 =
K.uPointel( pup );
Cell ptup2 =
K.uTranslation( ptup1, Point::diagonal() );
viewer << ptlow << ptup1 << ptup2;
viewer << p1 << p2 << p3 << p4 << p5 << p6 << p7 << p8;
viewer << linel0<< linel1<< linel2 << linel3 ;
viewer << linel4<< linel5<< linel6 << linel7 ;
viewer << linel8<< linel9<< linel10 << linel11 << linel12;
viewer << surfelA << surfelB << surfelC;
viewer << vox1 << vox2;
viewer<< MyViewer::updateDisplay;
return application.exec();
}
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal is the top-level namespace which contains all DGtal functions and types.
int main(int argc, char **argv)
HyperRectDomain< Space > Domain