31#if defined(DigitalConvexity_RECURSES)
32#error Recursive header files inclusion detected in DigitalConvexity.h
35#define DigitalConvexity_RECURSES
37#if !defined DigitalConvexity_h
39#define DigitalConvexity_h
47#include <unordered_set>
48#include "DGtal/base/Common.h"
49#include "DGtal/base/Clone.h"
50#include "DGtal/kernel/LatticeSetByIntervals.h"
51#include "DGtal/topology/CCellularGridSpaceND.h"
52#include "DGtal/topology/KhalimskySpaceND.h"
53#include "DGtal/geometry/volumes/BoundedLatticePolytope.h"
54#include "DGtal/geometry/volumes/BoundedLatticePolytopeCounter.h"
55#include "DGtal/geometry/volumes/BoundedRationalPolytope.h"
56#include "DGtal/geometry/volumes/CellGeometry.h"
76 template <
typename TKSpace >
90 typedef DGtal::BoundedLatticePolytope < Space >
Polytope;
167 template <
typename Po
intIterator>
195 template <
typename Po
intIterator>
198 PointIterator itB, PointIterator itE );
222 template <
typename Po
intIterator>
254 template <
typename Po
intIterator>
277 template <
typename Po
intIterator>
334 template <
typename Po
intIterator>
380 bool make_minkowski_summable =
false )
const;
702 template <
typename Predicate>
913 template <
typename Predicate>
927 template <
typename TKSpace>
939#include "DigitalConvexity.ih"
946#undef DigitalConvexity_RECURSES
Aim: Useful to compute quickly the lattice points within a polytope, i.e. a convex polyhedron.
typename Intervals::Interval Interval
Aim: Represents an nD lattice polytope, i.e. a convex polyhedron bounded with vertices with integer c...
Aim: Represents an nD rational polytope, i.e. a convex polyhedron bounded by vertices with rational c...
Aim: This class encapsulates its parameter class to indicate that the given parameter is required to ...
Aim: A helper class to build polytopes from digital sets and to check digital k-convexity and full co...
static PointRange insidePoints(const LatticePolytope &polytope)
static RationalPolytope makeRationalSimplex(Integer d, PointIterator itB, PointIterator itE)
PointRange Extr(const LatticeSet &C) const
static bool isSimplexFullDimensional(std::initializer_list< Point > l)
LatticeSet toLatticeSet(const PointRange &X, Dimension axis=dimension) const
bool isFullyConvex(const RationalPolytope &P) const
PointRange FC(const PointRange &Z, EnvelopeAlgorithm algo=EnvelopeAlgorithm::DIRECT) const
bool isKConvex(const LatticePolytope &P, const Dimension k) const
static bool isSimplexFullDimensional(PointIterator itB, PointIterator itE)
static LatticePolytope makeSimplex(PointIterator itB, PointIterator itE)
LatticeSet Star(const PointRange &X, Dimension axis=dimension) const
LatticeSet StarCells(const PointRange &C, Dimension axis=dimension) const
PointRange U(Dimension i, const PointRange &X) const
SimplexType
The possible types for simplices.
@ UNITARY
When its edges form a unit parallelotope (det = +/- 1)
@ INVALID
When there are not the right number of vertices.
@ DEGENERATED
When the points of the simplex are not in general position.
Integer sizeStarCvxH(const PointRange &X) const
static SimplexType simplexType(std::initializer_list< Point > l)
PointRange FC_LatticeSet(const PointRange &Z) const
static void displaySimplex(std::ostream &out, PointIterator itB, PointIterator itE)
bool isFullyConvexFast(const PointRange &X) const
LatticePolytope CvxH(const PointRange &X) const
bool isFullyConvex(const PointRange &X, bool convex0=false) const
DigitalConvexity(const Self &other)=default
PointRange ExtrCvxH(const PointRange &X) const
bool isFullySubconvex(const Point &a, const Point &b, const CellGeometry &C) const
static LatticePolytope makeSimplex(std::initializer_list< Point > l)
bool is0Convex(const PointRange &X) const
DigitalConvexity()=default
static void eraseInterval(Interval I, std::vector< Interval > &V)
PointRange Extr(const PointRange &C) const
Size myDepthLastFCE
The number of iterations of the last FullyConvexEnvelope operation.
CellGeometry makeCellCover(const RationalPolytope &P, Dimension i=0, Dimension k=KSpace::dimension) const
static RationalPolytope makeRationalSimplex(std::initializer_list< Point > l)
std::vector< Point > PointRange
Counter::Interval Interval
DigitalConvexity(Clone< KSpace > K, bool safe=false)
DGtal::BoundedRationalPolytope< Space > RationalPolytope
bool isFullySubconvex(const Point &a, const Point &b, const LatticeSet &StarX) const
bool isFullyConvex(const LatticePolytope &P) const
DGtal::CellGeometry< KSpace > CellGeometry
bool isKSubconvex(const RationalPolytope &P, const CellGeometry &C, const Dimension k) const
static PointRange interiorPoints(const RationalPolytope &polytope)
PointRange relativeEnvelope(const PointRange &Z, const Predicate &PredY, EnvelopeAlgorithm algo=EnvelopeAlgorithm::DIRECT) const
static const Dimension dimension
bool isKSubconvex(const LatticePolytope &P, const CellGeometry &C, const Dimension k) const
PointRange envelope(const PointRange &Z, EnvelopeAlgorithm algo=EnvelopeAlgorithm::DIRECT) const
CellGeometry makeCellCover(const LatticePolytope &P, Dimension i=0, Dimension k=KSpace::dimension) const
static PointRange insidePoints(const RationalPolytope &polytope)
bool isFullySubconvex(const RationalPolytope &P, const CellGeometry &C) const
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< TKSpace >))
PointRange relativeEnvelope(const PointRange &Z, const PointRange &Y, EnvelopeAlgorithm algo=EnvelopeAlgorithm::DIRECT) const
bool isKSubconvex(const Point &a, const Point &b, const CellGeometry &C, const Dimension k) const
DigitalConvexity< TKSpace > Self
bool isKConvex(const RationalPolytope &P, const Dimension k) const
Self & operator=(const Self &other)=default
PointRange toPointRange(const LatticeSet &L) const
static PointRange filter(const PointRange &E, const Predicate &Pred)
DGtal::LatticeSetByIntervals< Space > LatticeSet
DigitalConvexity(Point lo, Point hi, bool safe=false)
DGtal::BoundedLatticePolytope< Space > LatticePolytope
bool isFullySubconvex(const LatticePolytope &P, const LatticeSet &StarX) const
LatticeSet Skel(const LatticeSet &C) const
bool isFullySubconvex(const LatticePolytope &P, const CellGeometry &C) const
void selfDisplay(std::ostream &out) const
std::unordered_set< Point > PointSet
bool isFullySubconvex(const PointRange &Y, const LatticeSet &StarX) const
LatticeSet StarCvxH(const PointRange &X, Dimension axis=dimension) const
PointRange ExtrSkel(const LatticeSet &C) const
static void displaySimplex(std::ostream &out, std::initializer_list< Point > l)
PointRange FC_direct(const PointRange &Z) const
KSpace myK
The cellular grid space where computations are done.
Size depthLastEnvelope() const
DGtal::BoundedLatticePolytopeCounter< Space > Counter
~DigitalConvexity()=default
const KSpace & space() const
DGtal::BoundedLatticePolytope< Space > Polytope
LatticePolytope makePolytope(const PointRange &X, bool make_minkowski_summable=false) const
CellGeometry makeCellCover(PointIterator itB, PointIterator itE, Dimension i=0, Dimension k=KSpace::dimension) const
static SimplexType simplexType(PointIterator itB, PointIterator itE)
static PointRange interiorPoints(const LatticePolytope &polytope)
TInteger Integer
Arithmetic ring induced by (+,-,*) and Integer numbers.
static const constexpr Dimension dimension
std::vector< Point > PointRange
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::uint32_t Dimension
Aim: This concept describes a cellular grid space in nD. In these spaces obtained by cartesian produc...