32#include "ConfigExamples.h"
33#include "DGtal/helpers/StdDefs.h"
34#include "DGtal/base/Common.h"
35#include "DGtal/geometry/surfaces/estimation/MaximalSegmentSliceEstimation.h"
36#include "DGtal/helpers/Shortcuts.h"
37#include "DGtal/io/viewers/Viewer3D.h"
58 static const RealPoint shift(-0.5, -0.5, -0.5);
60 return p + 0.5 * u + 0.5 * v + shift;
65int main(
int argc,
char** argv)
67 QApplication application(argc, argv);
70 params(
"polynomial",
"ellipsoid")(
"gridstep",
"1.0");
78 double gridstep = params[
"gridstep"].as<
double>();
88 estimator.init(gridstep, surfels.begin(), surfels.end());
92 std::vector<Estimator::Quantity> quantities;
93 estimator.eval(surfels.begin(), surfels.end(), std::back_inserter(quantities));
96 Color fillColor = viewer.getFillColor();
98 for (std::size_t i = 0; i < surfels.size(); ++i)
100 const Surfel& s = surfels[i];
106 viewer.setFillColor(fillColor);
110 viewer.addLine(origin, origin + 1.5 * n, 0.3);
113 viewer << Viewer3D<>::updateDisplay;
Structure representing an RGB triple with alpha component.
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cell...
DigitalSurfaceContainer::Surfel Surfel
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
Point uCoords(const Cell &c) const
Return its digital coordinates.
typename TetrahedronEstimator::Quantity Quantity
PointVector< dim, double, std::array< double, dim > > getNormalized() const
Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes an...
Space::RealPoint RealPoint
Point with floating-point coordinates.
static KSpace getKSpace(const Point &low, const Point &up, Parameters params=parametersKSpace())
static CountedPtr< DigitizedImplicitShape3D > makeDigitizedImplicitShape3D(CountedPtr< ImplicitShape3D > shape, Parameters params=parametersDigitizedImplicitShape3D())
Space::Point Point
Point with integer coordinates.
static CellRange getPrimalVertices(const KSpace &K, const SCell &s)
static SurfelRange getSurfelRange(CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface, const Parameters ¶ms=parametersDigitalSurface())
static CountedPtr< DigitalSurface > makeDigitalSurface(CountedPtr< TPointPredicate > bimage, const KSpace &K, const Parameters ¶ms=parametersDigitalSurface())
::DGtal::DigitalSurface< ExplicitSurfaceContainer > DigitalSurface
defines an arbitrary digital surface over a binary image.
static Parameters defaultParameters()
LightDigitalSurface::SCell SCell
static CountedPtr< BinaryImage > makeBinaryImage(Domain shapeDomain)
static CountedPtr< ImplicitShape3D > makeImplicitShape3D(const Parameters ¶ms=parametersImplicitShape3D())
CountedPtr< SH3::DigitalSurface > surface
CountedPtr< SH3::BinaryImage > binary_image
RealPoint centerSurfel(KSpace const &K, SH3::SCell const &s)
KhalimskySpaceND< 3, Integer > KSpace
DGtal is the top-level namespace which contains all DGtal functions and types.
Modifier class in a Display3D stream. Useful to choose your own mode for a given class....
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.