12 #include <mrpt/containers/CDynamicGrid.h>
13 #include <mrpt/math/TPoint3D.h>
14 #include <mrpt/math/TPolygon2D.h>
15 #include <mrpt/opengl/TTriangle.h>
36 const mrpt::math::TPoint2Df& bbMin,
const mrpt::math::TPoint2Df& bbMax,
int numCells = 100);
37 void buildAddPoint(
const mrpt::math::TPoint3Df& pt);
38 void buildAddTriangle(
const mrpt::opengl::TTriangle& t);
40 const mrpt::math::TPolygon2D& getContour()
const;
42 double volume()
const;
46 void setShapeManual(
const mrpt::math::TPolygon2D& contour,
const float zMin,
const float zMax);
48 float zMin()
const {
return zMin_; }
49 float zMax()
const {
return zMax_; }
51 void clipZMin(
float v);
52 void clipZMax(
float v);
54 std::string asString()
const;
57 mutable std::optional<mrpt::math::TPolygon2D> contour_;
58 mutable float zMin_ = 0, zMax_ = 0;
60 class SimpleOccGrid :
public mrpt::containers::CDynamicGrid<uint8_t>
63 template <
typename... Args>
64 SimpleOccGrid(Args&&... args)
65 : mrpt::containers::CDynamicGrid<uint8_t>(std::forward<Args>(args)...)
70 float cell2float(
const uint8_t& v)
const override {
return v; }
73 mutable std::optional<SimpleOccGrid> grid_;
76 void computeShape()
const;
78 void internalGridFilterSpurious()
const;
79 void internalGridFloodFill()
const;
80 mrpt::math::TPolygon2D internalGridContour()
const;
81 mrpt::math::TPolygon2D internalPrunePolygon(
const mrpt::math::TPolygon2D& poly)
const;
83 struct RemovalCandidate
86 mrpt::math::TPolygon2D next;
89 std::optional<RemovalCandidate> lossOfRemovingVertex(
90 size_t i,
const mrpt::math::TPolygon2D& p,
bool allowApproxEdges)
const;
92 void debugSaveGridTo3DSceneFile(
93 const mrpt::math::TPolygon2D& rawGridContour,
const std::string& debugStr = {})
const;
Definition: Shape2p5.h:31