Note that the data type you want to display may be passed as argument as follows:
This command line produces the following output (points are displayed as voxels):
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "ConfigExamples.h"
#include "DGtal/geometry/curves/GridCurve.h"
#ifdef DGTAL_WITH_POLYSCOPE
#include "DGtal/io/viewers/PolyscopeViewer.h"
#endif
int main(
int argc,
char** argv )
{
trace.info() <<
"exampleGridCurve3d: the type of data to be displayed "
<< "may be given as argument as follows: "
<< argv[0] << " scells" << endl;
trace.info() <<
"Available types are: gridcurve (default), scells, points, midpoints, arrows" << endl;
string type = (argc > 1) ? string(argv[1]) : "arrows";
trace.info() <<
"Chosen type: " << type << endl;
string sinus = examplesPath + "samples/sinus.dat";
Point lowerBound = Point::diagonal( -100 );
Point upperBound = Point::diagonal( 100 );
K3 ks; ks.
init( lowerBound, upperBound,
true );
fstream inputStream;
inputStream.open (sinus.c_str(), ios::in);
inputStream.close();
#ifdef DGTAL_WITH_POLYSCOPE
PolyscopeViewer<Space,K3> viewer(ks);
if (type == "gridcurve")
{
viewer << gc;
}
else if (type == "scells")
{
}
else if (type == "points")
{
}
else if (type == "midpoints")
{
}
else if (type == "arrows")
{
}
else
{
trace.info() <<
"Display type not known." << std::endl;
}
#endif
return 0;
}
Aim: describes, in a cellular space of dimension n, a closed or open sequence of signed d-cells (or d...
SCellsRange getSCellsRange() const
MidPointsRange getMidPointsRange() const
bool initFromVectorStream(std::istream &in)
PointsRange getPointsRange() const
ArrowsRange getArrowsRange() const
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
void show() override
Starts the event loop and display of elements.
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal is the top-level namespace which contains all DGtal functions and types.