This example shows how to use GridCurve as a sequence of 2-scells in a 3d Khalimsky space.
Note that the data type you want to display may be passed as argument as follows:
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/topology/KhalimskySpaceND.h"
#include "DGtal/topology/SurfelAdjacency.h"
#include "DGtal/topology/DigitalSurface.h"
#include "DGtal/topology/SetOfSurfels.h"
#include "DGtal/topology/DigitalSurface2DSlice.h"
#include "DGtal/topology/helpers/Surfaces.h"
#include "DGtal/io/viewers/Viewer3D.h"
#include "DGtal/io/readers/VolReader.h"
#include "DGtal/io/DrawWithDisplay3DModifier.h"
#include "DGtal/images/ImageSelector.h"
#include "DGtal/images/ImageHelper.h"
#include "DGtal/kernel/sets/DigitalSetInserter.h"
#include "DGtal/io/Color.h"
#include "DGtal/geometry/curves/GridCurve.h"
#include "ConfigExamples.h"
using namespace std;
using namespace Z3i;
int main(
int argc,
char** argv )
{
trace.
info() <<
"exampleGridCurve3d-2: the type of data to be displayed "
<< "may be given as argument as follows: "
<< argv[0] << " inner" << endl;
trace.
info() <<
"Available types are: gridcurve (default), inner, outer, incident" << endl;
string type = (argc > 1) ? string(argv[1]) : "gridcurve";
trace.
info() <<
"Chosen type: " << type << endl;
std::string inputFilename = examplesPath + "samples/cat10.vol";
trace.
beginBlock(
"Construct the Khalimsky space from the image domain." );
MySurfelAdjacency surfAdj( true );
MySetOfSurfels theSetOfSurfels( ks, surfAdj );
ks, set3d,
image.domain().upperBound() );
MyTracker* tracker = digSurf.
container().newTracker( surf );
My2DSlice slice( tracker, *(ks.
sDirs( surf )) );
delete tracker;
QApplication application(argc,argv);
it_end = theSetOfSurfels.end(); it != it_end; ++it )
viewer<< *it;
viewer << Viewer3D<Space, KSpace>::shiftSurfelVisu;
if (type == "gridcurve")
{
viewer << gc;
}
else if (type == "inner")
{
}
else if (type == "outer")
{
}
else if (type == "incident")
{
}
else
{
trace.
info() <<
"Display type not known." << std::endl;
}
viewer << Viewer3D<Space, KSpace>::updateDisplay;
return application.exec();
}