DGtal 1.4.0
|
Aim: A helper class to build polytopes from digital sets and to check digital k-convexity and full convexity. More...
#include <DGtal/geometry/volumes/DigitalConvexity.h>
Public Types | |
typedef DigitalConvexity< TKSpace > | Self |
typedef TKSpace | KSpace |
typedef KSpace::Integer | Integer |
typedef KSpace::Point | Point |
typedef KSpace::Vector | Vector |
typedef KSpace::Cell | Cell |
typedef KSpace::Space | Space |
typedef std::size_t | Size |
typedef DGtal::BoundedLatticePolytope< Space > | Polytope |
typedef DGtal::BoundedLatticePolytope< Space > | LatticePolytope |
typedef DGtal::BoundedRationalPolytope< Space > | RationalPolytope |
typedef DGtal::CellGeometry< KSpace > | CellGeometry |
typedef std::vector< Point > | PointRange |
typedef std::unordered_set< Point > | PointSet |
typedef DGtal::BoundedLatticePolytopeCounter< Space > | Counter |
typedef Counter::Interval | Interval |
typedef DGtal::LatticeSetByIntervals< Space > | LatticeSet |
Public Member Functions | |
Standard services (construction, initialization, assignment) | |
~DigitalConvexity ()=default | |
DigitalConvexity ()=default | |
DigitalConvexity (const Self &other)=default | |
DigitalConvexity (Clone< KSpace > K, bool safe=false) | |
DigitalConvexity (Point lo, Point hi, bool safe=false) | |
Self & | operator= (const Self &other)=default |
const KSpace & | space () const |
Cell geometry services | |
template<typename PointIterator > | |
CellGeometry | makeCellCover (PointIterator itB, PointIterator itE, Dimension i=0, Dimension k=KSpace::dimension) const |
CellGeometry | makeCellCover (const LatticePolytope &P, Dimension i=0, Dimension k=KSpace::dimension) const |
CellGeometry | makeCellCover (const RationalPolytope &P, Dimension i=0, Dimension k=KSpace::dimension) const |
Morphological services | |
LatticePolytope | makePolytope (const PointRange &X, bool make_minkowski_summable=false) const |
PointRange | U (Dimension i, const PointRange &X) const |
bool | is0Convex (const PointRange &X) const |
bool | isFullyConvex (const PointRange &X, bool convex0=false) const |
bool | isFullyConvexFast (const PointRange &X) const |
bool | isFullySubconvex (const PointRange &Y, const LatticeSet &StarX) const |
bool | isFullySubconvex (const Point &a, const Point &b, const Point &c, const LatticeSet &StarX) const |
bool | isKSubconvex (const Point &a, const Point &b, const CellGeometry &C, const Dimension k) const |
bool | isFullySubconvex (const Point &a, const Point &b, const CellGeometry &C) const |
bool | isFullySubconvex (const Point &a, const Point &b, const LatticeSet &StarX) const |
LatticePolytope | CvxH (const PointRange &X) const |
PointRange | ExtrCvxH (const PointRange &X) const |
LatticeSet | StarCvxH (const PointRange &X, Dimension axis=dimension) const |
LatticeSet | StarCvxH (const Point &a, const Point &b, const Point &c, Dimension axis=dimension) const |
Integer | sizeStarCvxH (const PointRange &X) const |
LatticeSet | Star (const PointRange &X, Dimension axis=dimension) const |
LatticeSet | StarCells (const PointRange &C, Dimension axis=dimension) const |
PointRange | Extr (const PointRange &C) const |
PointRange | Extr (const LatticeSet &C) const |
LatticeSet | Skel (const LatticeSet &C) const |
PointRange | ExtrSkel (const LatticeSet &C) const |
LatticeSet | toLatticeSet (const PointRange &X, Dimension axis=dimension) const |
PointRange | toPointRange (const LatticeSet &L) const |
Convexity services for lattice polytopes | |
bool | isKConvex (const LatticePolytope &P, const Dimension k) const |
bool | isFullyConvex (const LatticePolytope &P) const |
bool | isKSubconvex (const LatticePolytope &P, const CellGeometry &C, const Dimension k) const |
bool | isFullySubconvex (const LatticePolytope &P, const CellGeometry &C) const |
bool | isFullySubconvex (const LatticePolytope &P, const LatticeSet &StarX) const |
Convexity services for rational polytopes | |
bool | isKConvex (const RationalPolytope &P, const Dimension k) const |
bool | isFullyConvex (const RationalPolytope &P) const |
bool | isKSubconvex (const RationalPolytope &P, const CellGeometry &C, const Dimension k) const |
bool | isFullySubconvex (const RationalPolytope &P, const CellGeometry &C) const |
Interface services | |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Static Public Member Functions | |
Lattice and rational polytope services | |
static PointRange | insidePoints (const LatticePolytope &polytope) |
static PointRange | interiorPoints (const LatticePolytope &polytope) |
static PointRange | insidePoints (const RationalPolytope &polytope) |
static PointRange | interiorPoints (const RationalPolytope &polytope) |
Static Public Attributes | |
static const Dimension | dimension = KSpace::dimension |
Protected Attributes | |
KSpace | myK |
The cellular grid space where computations are done. | |
bool | mySafe |
Size | myDepthLastFCE |
The number of iterations of the last FullyConvexEnvelope operation. | |
Private Member Functions | |
BOOST_CONCEPT_ASSERT ((concepts::CCellularGridSpaceND< TKSpace >)) | |
PointRange | FC_direct (const PointRange &Z) const |
PointRange | FC_LatticeSet (const PointRange &Z) const |
Static Private Member Functions | |
static void | eraseInterval (Interval I, std::vector< Interval > &V) |
template<typename Predicate > | |
static PointRange | filter (const PointRange &E, const Predicate &Pred) |
Simplex services | |
enum class | SimplexType { INVALID , DEGENERATED , UNITARY , COMMON } |
The possible types for simplices. More... | |
template<typename PointIterator > | |
static LatticePolytope | makeSimplex (PointIterator itB, PointIterator itE) |
static LatticePolytope | makeSimplex (std::initializer_list< Point > l) |
template<typename PointIterator > | |
static RationalPolytope | makeRationalSimplex (Integer d, PointIterator itB, PointIterator itE) |
static RationalPolytope | makeRationalSimplex (std::initializer_list< Point > l) |
template<typename PointIterator > | |
static bool | isSimplexFullDimensional (PointIterator itB, PointIterator itE) |
static bool | isSimplexFullDimensional (std::initializer_list< Point > l) |
template<typename PointIterator > | |
static SimplexType | simplexType (PointIterator itB, PointIterator itE) |
static SimplexType | simplexType (std::initializer_list< Point > l) |
template<typename PointIterator > | |
static void | displaySimplex (std::ostream &out, PointIterator itB, PointIterator itE) |
static void | displaySimplex (std::ostream &out, std::initializer_list< Point > l) |
Convex envelope services | |
enum class | EnvelopeAlgorithm { DIRECT , LATTICE_SET } |
PointRange | FC (const PointRange &Z, EnvelopeAlgorithm algo=EnvelopeAlgorithm::DIRECT) const |
PointRange | envelope (const PointRange &Z, EnvelopeAlgorithm algo=EnvelopeAlgorithm::DIRECT) const |
PointRange | relativeEnvelope (const PointRange &Z, const PointRange &Y, EnvelopeAlgorithm algo=EnvelopeAlgorithm::DIRECT) const |
template<typename Predicate > | |
PointRange | relativeEnvelope (const PointRange &Z, const Predicate &PredY, EnvelopeAlgorithm algo=EnvelopeAlgorithm::DIRECT) const |
Size | depthLastEnvelope () const |
Aim: A helper class to build polytopes from digital sets and to check digital k-convexity and full convexity.
Description of template class 'DigitalConvexity'
It is a model of boost::CopyConstructible, boost::DefaultConstructible, boost::Assignable.
TKSpace | an arbitrary model of CCellularGridSpaceND. |
Definition at line 77 of file DigitalConvexity.h.
typedef KSpace::Cell DGtal::DigitalConvexity< TKSpace >::Cell |
Definition at line 87 of file DigitalConvexity.h.
typedef DGtal::CellGeometry< KSpace > DGtal::DigitalConvexity< TKSpace >::CellGeometry |
Definition at line 93 of file DigitalConvexity.h.
typedef DGtal::BoundedLatticePolytopeCounter< Space > DGtal::DigitalConvexity< TKSpace >::Counter |
Definition at line 96 of file DigitalConvexity.h.
typedef KSpace::Integer DGtal::DigitalConvexity< TKSpace >::Integer |
Definition at line 84 of file DigitalConvexity.h.
typedef Counter::Interval DGtal::DigitalConvexity< TKSpace >::Interval |
Definition at line 97 of file DigitalConvexity.h.
typedef TKSpace DGtal::DigitalConvexity< TKSpace >::KSpace |
Definition at line 83 of file DigitalConvexity.h.
typedef DGtal::BoundedLatticePolytope< Space > DGtal::DigitalConvexity< TKSpace >::LatticePolytope |
Definition at line 91 of file DigitalConvexity.h.
typedef DGtal::LatticeSetByIntervals< Space > DGtal::DigitalConvexity< TKSpace >::LatticeSet |
Definition at line 98 of file DigitalConvexity.h.
typedef KSpace::Point DGtal::DigitalConvexity< TKSpace >::Point |
Definition at line 85 of file DigitalConvexity.h.
typedef std::vector<Point> DGtal::DigitalConvexity< TKSpace >::PointRange |
Definition at line 94 of file DigitalConvexity.h.
typedef std::unordered_set<Point> DGtal::DigitalConvexity< TKSpace >::PointSet |
Definition at line 95 of file DigitalConvexity.h.
typedef DGtal::BoundedLatticePolytope< Space > DGtal::DigitalConvexity< TKSpace >::Polytope |
Definition at line 90 of file DigitalConvexity.h.
typedef DGtal::BoundedRationalPolytope< Space > DGtal::DigitalConvexity< TKSpace >::RationalPolytope |
Definition at line 92 of file DigitalConvexity.h.
typedef DigitalConvexity<TKSpace> DGtal::DigitalConvexity< TKSpace >::Self |
Definition at line 82 of file DigitalConvexity.h.
typedef std::size_t DGtal::DigitalConvexity< TKSpace >::Size |
Definition at line 89 of file DigitalConvexity.h.
typedef KSpace::Space DGtal::DigitalConvexity< TKSpace >::Space |
Definition at line 88 of file DigitalConvexity.h.
typedef KSpace::Vector DGtal::DigitalConvexity< TKSpace >::Vector |
Definition at line 86 of file DigitalConvexity.h.
|
strong |
Choice of algorithm for computing the fully convex envelope of a digital set.
Enumerator | |
---|---|
DIRECT | Slightly faster but quite ugly big function |
LATTICE_SET | Slightly slower function but decomposes well the algorithm |
Definition at line 684 of file DigitalConvexity.h.
|
strong |
The possible types for simplices.
Definition at line 237 of file DigitalConvexity.h.
|
default |
Destructor.
|
default |
Constructor.
|
default |
Copy constructor.
other | the object to clone. |
DGtal::DigitalConvexity< TKSpace >::DigitalConvexity | ( | Clone< KSpace > | K, |
bool | safe = false ) |
Constructor from cellular space.
K | any cellular grid space. |
safe | when 'true' performs convex hull computations with arbitrary precision integer (if available), otherwise chooses a compromise between speed and precision (int64_t). |
DGtal::DigitalConvexity< TKSpace >::DigitalConvexity | ( | Point | lo, |
Point | hi, | ||
bool | safe = false ) |
Constructor from lower and upper points.
lo | the lowest point of the domain (bounding box for computations). |
hi | the highest point of the domain (bounding box for computations). |
safe | when 'true' performs convex hull computations with arbitrary precision integer (if available), otherwise chooses a compromise between speed and precision (int64_t). |
|
private |
|
inline |
Given a range of distinct points X, computes the tightiest polytope that enclosed it. Note that this polytope may contain more lattice points than the given input points.
X | any range of pairwise distinct points |
Definition at line 522 of file DigitalConvexity.h.
References DGtal::DigitalConvexity< TKSpace >::makePolytope().
Size DGtal::DigitalConvexity< TKSpace >::depthLastEnvelope | ( | ) | const |
FC^*(Z):=FC(FC(....FC(Z)...))
, i.e. the last call to DigitalConvexity::envelope or DigitalConvexity::relativeEnvelope . Referenced by SCENARIO(), and SCENARIO().
|
static |
Displays information about the simplex formed by the given range [itB,itE) of lattice points.
PointIterator | any model of forward iterator on Point. |
[in,out] | out | the output stream where information is outputed. |
itB | the start of the range of n+1 points defining the simplex. | |
itE | past the end the range of n+1 points defining the simplex. |
|
static |
Displays information about simplex formed by the given list l of lattice points.
[in,out] | out | the output stream where information is outputed. |
l | any list of lattice points. |
PointRange DGtal::DigitalConvexity< TKSpace >::envelope | ( | const PointRange & | Z, |
EnvelopeAlgorithm | algo = EnvelopeAlgorithm::DIRECT ) const |
Computes the fully convex envelope of Z, i.e. \( FC^*(Z):=FC(FC( \ldots FC(Z) \ldots )) \), for Z a range of points, until stabilization of the iterative process.
Z | any range of points (must be sorted). |
algo | the chosen method of computation. |
Referenced by checkCvxHPlusHypercubeFullConvexity(), checkProjectionFullConvexity(), checkSkelStarCvxHFullConvexity(), main(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), and SCENARIO().
|
staticprivate |
Erase the interval I from the intervals in V such that the integer in I are not part of V anymore.
[in] | I | is a closed interval |
[in,out] | V | is a sorted list of closed intervals |
PointRange DGtal::DigitalConvexity< TKSpace >::Extr | ( | const LatticeSet & | C | ) | const |
C | a range of cells represented as a lattice set. |
PointRange DGtal::DigitalConvexity< TKSpace >::Extr | ( | const PointRange & | C | ) | const |
C | a range of cells represented with points in Khalimsky coordinates. |
PointRange DGtal::DigitalConvexity< TKSpace >::ExtrCvxH | ( | const PointRange & | X | ) | const |
Given a range of distinct points X, computes the vertices of the tightiest polytope that enclosed it.
X | any range of pairwise distinct points |
CvxH(X)
.PointRange DGtal::DigitalConvexity< TKSpace >::ExtrSkel | ( | const LatticeSet & | C | ) | const |
C | a range of cells represented as a lattice set. |
PointRange DGtal::DigitalConvexity< TKSpace >::FC | ( | const PointRange & | Z, |
EnvelopeAlgorithm | algo = EnvelopeAlgorithm::DIRECT ) const |
Computes FC(Z):=Extr(Skel(Star(CvxH(Z))))
, for Z a range of points
Z | any range of points (must be sorted). |
algo | the chosen method of computation. |
|
private |
Computes FC(Z):=Extr(Skel(Star(CvxH(Z))))
, for Z a range of points
Z | any range of points (must be sorted). |
|
private |
Computes FC(Z):=Extr(Skel(Star(CvxH(Z))))
, for Z a range of points
Z | any range of points (must be sorted). |
|
staticprivate |
Filters the points of E and outputs only the ones that satisfies the given predicate Pred.
Predicate | the type of a predicate Point -> boolean |
[in] | E | any range of point |
[in] | Pred | the predicate Point -> boolean |
|
static |
polytope | any lattice polytope. |
Referenced by SCENARIO().
|
static |
polytope | any rational polytope. |
|
static |
polytope | any lattice polytope. |
|
static |
polytope | any rational polytope. |
bool DGtal::DigitalConvexity< TKSpace >::is0Convex | ( | const PointRange & | X | ) | const |
Tells if a given point range X is digitally 0-convex, i.e. \( \mathrm{Cvxh}(X) \cap \mathbb{Z}^d = X \). It works for arbitrary set of points in arbitrary dimenion.
X | any range of pairwise distinct points |
Referenced by checkFullConvexityCharacterization(), DGtal::NeighborhoodConvexityAnalyzer< TKSpace, K >::is0Convex(), DGtal::NeighborhoodConvexityAnalyzer< TKSpace, K >::isComplementary0Convex(), SCENARIO(), SCENARIO(), and SCENARIO().
bool DGtal::DigitalConvexity< TKSpace >::isFullyConvex | ( | const LatticePolytope & | P | ) | const |
Tells if a given polytope P is fully digitally convex. The digital 0-convexity is the usual property \( Conv( P \cap Z^d ) = P \cap Z^d) \). Otherwise the property asks that the points inside P touch as many k-cells that the convex hull of P, for any valid dimension k.
P | any lattice polytope such that P.canBeSummed() == true . |
bool DGtal::DigitalConvexity< TKSpace >::isFullyConvex | ( | const PointRange & | X, |
bool | convex0 = false ) const |
Tells if a given point range X is fully digitally convex. The test uses the morphological characterization of full convexity. It is slightly slower than testing full convexity on simplices, but it works for arbitrary set of points in arbitrary dimenion.
X | any range of pairwise distinct points |
convex0 | when 'true' indicates that X is known to be digitally 0-convex, otherwise the method will check it also. |
Referenced by DGtal::SymmetricConvexExpander< TKSpace, TPointPredicate >::advance(), checkCvxHPlusHypercubeFullConvexity(), checkFullConvexityCharacterization(), checkSkelStarCvxHFullConvexity(), DGtal::NeighborhoodConvexityAnalyzer< TKSpace, K >::isComplementaryFullyConvex(), DGtal::NeighborhoodConvexityAnalyzer< TKSpace, K >::isFullyConvex(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), and SCENARIO().
bool DGtal::DigitalConvexity< TKSpace >::isFullyConvex | ( | const RationalPolytope & | P | ) | const |
Tells if a given polytope P is fully digitally convex. The digital 0-convexity is the usual property \( Conv( P \cap Z^d ) = P \cap Z^d) \). Otherwise the property asks that the points inside P touch as many k-cells that the convex hull of P, for any valid dimension k.
P | any rational polytope such that P.canBeSummed() == true . |
bool DGtal::DigitalConvexity< TKSpace >::isFullyConvexFast | ( | const PointRange & | X | ) | const |
Tells if a given point range X is fully digitally convex. The test uses the morphological characterization of full convexity and a fast way to compute lattice points within a polytope. It works for arbitrary set of points in arbitrary dimenion.
X | any range of pairwise distinct points |
Referenced by SCENARIO(), SCENARIO(), and SCENARIO().
bool DGtal::DigitalConvexity< TKSpace >::isFullySubconvex | ( | const LatticePolytope & | P, |
const CellGeometry & | C ) const |
Tells if a given polytope P is digitally fully subconvex to some cell cover C. The digital 0-subconvexity is the usual property \( Conv( P \cap Z^d ) \subset C \cap Z^d) \). Otherwise the property asks that the k-cells intersected by the convex hull of P is a subset of the k-cells of C.
P | any lattice polytope such that P.canBeSummed() == true . |
C | any cell cover geometry (i.e. a cubical complex). |
bool DGtal::DigitalConvexity< TKSpace >::isFullySubconvex | ( | const LatticePolytope & | P, |
const LatticeSet & | StarX ) const |
Tells if a given polytope P is digitally fully subconvex to some lattice set Star_X, i.e. the cell cover of some set X represented by lattice points.
P | any lattice polytope such that P.canBeSummed() == true . |
StarX | any lattice set representing an open cubical complex. |
bool DGtal::DigitalConvexity< TKSpace >::isFullySubconvex | ( | const Point & | a, |
const Point & | b, | ||
const CellGeometry & | C ) const |
Tells if a given segment from a to b is digitally fully subconvex (i.e. tangent) to some cell cover C. The digital 0-subconvexity is the usual property \( Conv( P \cap Z^d ) \subset C \cap Z^d) \). Otherwise the property asks that the k-cells intersected by the convex hull of the segment is a subset of the k-cells of C.
a | any point |
b | any point |
C | any cell cover geometry (i.e. a cubical complex). |
bool DGtal::DigitalConvexity< TKSpace >::isFullySubconvex | ( | const Point & | a, |
const Point & | b, | ||
const LatticeSet & | StarX ) const |
Tells if a given segment from a to b is digitally fully subconvex (i.e. tangent) to some open complex StarX.
a | any point |
b | any point |
StarX | any lattice set representing an open cubical complex. |
bool DGtal::DigitalConvexity< TKSpace >::isFullySubconvex | ( | const Point & | a, |
const Point & | b, | ||
const Point & | c, | ||
const LatticeSet & | StarX ) const |
Tells if the non-degenerated 3D triangle a,b,c is digitally fully subconvex to some lattice set Star_X, i.e. the cell cover of some set X represented by lattice points.
a | any 3D point (distinct from the two others) |
b | any 3D point (distinct from the two others) |
c | any 3D point (distinct from the two others) |
StarX | any lattice set representing an open cubical complex. |
bool DGtal::DigitalConvexity< TKSpace >::isFullySubconvex | ( | const PointRange & | Y, |
const LatticeSet & | StarX ) const |
Tells if a given set of points Y is digitally fully subconvex to some lattice set Star_X, i.e. the cell cover of some set X represented by lattice points.
Y | any set of points |
StarX | any lattice set representing an open cubical complex. |
P.canBeSummed() == true
. Referenced by main(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), and SCENARIO().
bool DGtal::DigitalConvexity< TKSpace >::isFullySubconvex | ( | const RationalPolytope & | P, |
const CellGeometry & | C ) const |
Tells if a given polytope P is digitally fully subconvex to some cell cover C. The digital 0-subconvexity is the usual property \( Conv( P \cap Z^d ) \subset C \cap Z^d) \). Otherwise the property asks that the k-cells intersected by the convex hull of P is a subset of the k-cells of C.
P | any rational polytope such that P.canBeSummed() == true . |
C | any cell cover geometry (i.e. a cubical complex). |
bool DGtal::DigitalConvexity< TKSpace >::isKConvex | ( | const LatticePolytope & | P, |
const Dimension | k ) const |
Tells if a given polytope P is digitally k-convex. The digital 0-convexity is the usual property \( Conv( P \cap Z^d ) = P \cap Z^d) \). Otherwise the property asks that the points inside P touch as many k-cells that the convex hull of P.
P | any lattice polytope such that P.canBeSummed() == true . |
k | the dimension for which the digital k-convexity is checked, 0 <= k <= KSpace::dimension. |
Referenced by SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), and SCENARIO().
bool DGtal::DigitalConvexity< TKSpace >::isKConvex | ( | const RationalPolytope & | P, |
const Dimension | k ) const |
Tells if a given polytope P is digitally k-convex. The digital 0-convexity is the usual property \( Conv( P \cap Z^d ) = P \cap Z^d) \). Otherwise the property asks that the points inside P touch as many k-cells that the convex hull of P.
P | any rational polytope such that P.canBeSummed() == true . |
k | the dimension for which the digital k-convexity is checked, 0 <= k <= KSpace::dimension. |
bool DGtal::DigitalConvexity< TKSpace >::isKSubconvex | ( | const LatticePolytope & | P, |
const CellGeometry & | C, | ||
const Dimension | k ) const |
Tells if a given polytope P is digitally k-subconvex of some cell cover C. The digital 0-subconvexity is the usual property \( Conv( P \cap Z^d ) \subset C \cap Z^d) \). Otherwise the property asks that the k-cells intersected by the convex hull of P is a subset of the k-cells of C.
P | any lattice polytope such that P.canBeSummed() == true . |
C | any cell cover geometry (i.e. a cubical complex). |
k | the dimension for which the digital k-convexity is checked, 0 <= k <= KSpace::dimension. |
bool DGtal::DigitalConvexity< TKSpace >::isKSubconvex | ( | const Point & | a, |
const Point & | b, | ||
const CellGeometry & | C, | ||
const Dimension | k ) const |
Tells if a given segment from a to b is digitally k-subconvex (i.e. k-tangent) to some cell cover C. The digital 0-subconvexity is the usual property \( Conv( P \cap Z^d ) \subset C \cap Z^d) \). Otherwise the property asks that the k-cells intersected by the convex hull of the segment is a subset of the k-cells of C.
a | any point |
b | any point |
C | any cell cover geometry (i.e. a cubical complex). |
k | the dimension for which the digital k-convexity is checked, 0 <= k <= KSpace::dimension. |
bool DGtal::DigitalConvexity< TKSpace >::isKSubconvex | ( | const RationalPolytope & | P, |
const CellGeometry & | C, | ||
const Dimension | k ) const |
Tells if a given polytope P is digitally k-subconvex of some cell cover C. The digital 0-subconvexity is the usual property \( Conv( P \cap Z^d ) \subset C \cap Z^d) \). Otherwise the property asks that the k-cells intersected by the convex hull of P is a subset of the k-cells of C.
P | any rational polytope such that P.canBeSummed() == true . |
C | any cell cover geometry (i.e. a cubical complex). |
k | the dimension for which the digital k-convexity is checked, 0 <= k <= KSpace::dimension. |
|
static |
Checks if the given range [itB,itE) of lattice points form a full dimensional simplex, i.e. it must contain Space::dimension+1 points in general position.
PointIterator | any model of forward iterator on Point. |
itB | the start of the range of n+1 points defining the simplex. |
itE | past the end the range of n+1 points defining the simplex. |
Referenced by main(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), and SCENARIO().
|
static |
Checks if the given list of lattice points l form a full dimensional simplex, i.e. it must contain Space::dimension+1 points in general position.
l | any list of d+1 points in general positions. |
bool DGtal::DigitalConvexity< TKSpace >::isValid | ( | ) | const |
Checks the validity/consistency of the object. If the polytope has been default constructed, it is invalid.
CellGeometry DGtal::DigitalConvexity< TKSpace >::makeCellCover | ( | const LatticePolytope & | P, |
Dimension | i = 0, | ||
Dimension | k = KSpace::dimension ) const |
Builds the cell geometry containing all the j-cells touching the lattice polytope P, for i <= j <= k. It conbains thus all the j-cells intersecting the convex hull of P.
P | any lattice polytope such that P.canBeSummed() == true . |
i | the first dimension for which the cell cover is computed. |
k | the last dimension for which the cell cover is computed. |
CellGeometry DGtal::DigitalConvexity< TKSpace >::makeCellCover | ( | const RationalPolytope & | P, |
Dimension | i = 0, | ||
Dimension | k = KSpace::dimension ) const |
Builds the cell geometry containing all the j-cells touching the rational polytope P, for i <= j <= k. It conbains thus all the j-cells intersecting the convex hull of P.
P | any rational polytope such that P.canBeSummed() == true . |
i | the first dimension for which the cell cover is computed. |
k | the last dimension for which the cell cover is computed. |
CellGeometry DGtal::DigitalConvexity< TKSpace >::makeCellCover | ( | PointIterator | itB, |
PointIterator | itE, | ||
Dimension | i = 0, | ||
Dimension | k = KSpace::dimension ) const |
Builds the cell geometry containing all the j-cells touching a point of [itB,itE), for i <= j <= k.
PointIterator | any model of input iterator on Points. |
itB | start of a range of arbitrary points. |
itE | past the end of a range of arbitrary points. |
i | the first dimension for which the cell cover is computed. |
k | the last dimension for which the cell cover is computed. |
Referenced by main(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), and SCENARIO().
LatticePolytope DGtal::DigitalConvexity< TKSpace >::makePolytope | ( | const PointRange & | X, |
bool | make_minkowski_summable = false ) const |
Given a range of distinct points X, computes the tightiest polytope that enclosed it. Note that this polytope may contain more lattice points than the given input points.
X | any range of pairwise distinct points | |
[in] | make_minkowski_summable | Other constraints are added so that we can perform axis aligned Minkowski sums on this polytope. Useful in 2D/3D for checking digital k-convexity (see moduleDigitalConvexity). |
Referenced by checkCvxHPlusHypercubeFullConvexity(), checkFullConvexityCharacterization(), DGtal::DigitalConvexity< TKSpace >::CvxH(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), and SCENARIO().
|
static |
Constructs a rational polytope from a rational simplex given as a range [itB,itE) of lattice points. Note that the range must contain Space::dimension+1 points or less in general position.
PointIterator | any model of forward iterator on Point. |
d | the common denominator of all given lattice point coordinates. |
itB | the start of the range of no more than n+1 points defining the simplex. |
itE | past the end the range of no more than n+1 points defining the simplex. |
[itB,itE) = { (3,2), (1,7), (6,6) }
and the denominator d = 4
, then your polytope has vertices { (3/4,2/4), (1/4,7/4), (6/4,6/4) }
. Referenced by SCENARIO(), and SCENARIO().
|
static |
Constructs a rational polytope from a simplex given as an initializer_list.
l | any list where the first point give the denominator and then no more than d+1 points in general positions. |
l = { (4,x), (3,2), (1,7), (6,6) }
, then the denominator is d = 4
and your polytope has vertices { (3/4,2/4), (1/4,7/4), (6/4,6/4) }
.
|
static |
Constructs a lattice polytope from a simplex given as a range [itB,itE) of lattice points. Note that the range must contain Space::dimension+1 points or less in general position.
PointIterator | any model of forward iterator on Point. |
itB | the start of the range of no more than n+1 points defining the simplex. |
itE | past the end the range of no more than n+1 points defining the simplex. |
Referenced by main(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), and SCENARIO().
|
static |
Constructs a lattice polytope from a simplex given as an initializer_list.
l | any list of no more than d+1 points in general positions. |
|
default |
Assignment.
other | the object to copy. |
PointRange DGtal::DigitalConvexity< TKSpace >::relativeEnvelope | ( | const PointRange & | Z, |
const PointRange & | Y, | ||
EnvelopeAlgorithm | algo = EnvelopeAlgorithm::DIRECT ) const |
Computes the fully convex envelope of Z relative to fully convex digital set Y, i.e. \( FC^*_Y(Z):=FC_Y(FC_Y( \ldots FC_Y(Z) \ldots )) \) for Z a range of points, until stabilization of the iterative process.
Z | any range of points (must be sorted). |
Y | any range of points (must be sorted) that is fully convex. |
algo | the chosen method of computation. |
Referenced by main(), SCENARIO(), and SCENARIO().
PointRange DGtal::DigitalConvexity< TKSpace >::relativeEnvelope | ( | const PointRange & | Z, |
const Predicate & | PredY, | ||
EnvelopeAlgorithm | algo = EnvelopeAlgorithm::DIRECT ) const |
Computes the fully convex envelope of Z relative to fully convex digital set Y defined by a corresponding predicate PredY. It computes \( FC^*_Y(Z):=FC_Y(FC_Y( \ldots FC_Y(Z) \ldots )) \) for Z a range of points, until stabilization of the iterative process.
Predicate | the type of a predicate Point -> boolean |
Z | any range of points (must be sorted). |
PredY | a Point predicate such that PredY(p)==true iff p belongs to Y. |
algo | the chosen method of computation. |
void DGtal::DigitalConvexity< TKSpace >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
|
static |
Returns the type of simplex formed by the given range [itB,itE) of lattice points.
PointIterator | any model of forward iterator on Point. |
itB | the start of the range of n+1 points defining the simplex. |
itE | past the end the range of n+1 points defining the simplex. |
Referenced by SCENARIO(), and SCENARIO().
|
static |
Returns the type of simplex formed by the given list l of lattice points.
l | any list of lattice points. |
Integer DGtal::DigitalConvexity< TKSpace >::sizeStarCvxH | ( | const PointRange & | X | ) | const |
Computes the number of cells in Star(CvxH(X)) for X a digital set.
X | any range of lattice points |
LatticeSet DGtal::DigitalConvexity< TKSpace >::Skel | ( | const LatticeSet & | C | ) | const |
C | a range of cells represented as a lattice set. |
const KSpace & DGtal::DigitalConvexity< TKSpace >::space | ( | ) | const |
Referenced by DGtal::NeighborhoodConvexityAnalyzer< TKSpace, K >::NeighborhoodConvexityAnalyzer(), and DGtal::NeighborhoodConvexityAnalyzer< TKSpace, K >::space().
LatticeSet DGtal::DigitalConvexity< TKSpace >::Star | ( | const PointRange & | X, |
Dimension | axis = dimension ) const |
Builds the cell complex Star(X) for X a digital set, represented as a lattice set (stacked row representation).
X | any range of lattice points |
axis | specifies the projection axis for the row representation if below space dimension, otherwise chooses the axis that minimizes memory/computations. |
Star(X)
.LatticeSet DGtal::DigitalConvexity< TKSpace >::StarCells | ( | const PointRange & | C, |
Dimension | axis = dimension ) const |
Builds the cell complex Star(C) for C a range of cells, represented as a lattice set (stacked row representation).
C | a range of cells represented with points in Khalimsky coordinates. |
axis | specifies the projection axis for the row representation if below space dimension, otherwise chooses the axis that minimizes memory/computations. |
Star(C)
.LatticeSet DGtal::DigitalConvexity< TKSpace >::StarCvxH | ( | const Point & | a, |
const Point & | b, | ||
const Point & | c, | ||
Dimension | axis = dimension ) const |
Builds the cell complex Star(CvxH({a,b,c}))
for a,b,c
a non-degenerate 3D triangle, represented as a lattice set (stacked row representation).
a | any 3D point (distinct from the two others) |
b | any 3D point (distinct from the two others) |
c | any 3D point (distinct from the two others) |
axis | specifies the projection axis for the row representation if below space dimension, otherwise chooses the axis that minimizes memory/computations. |
abc
, represented as a lattice set (cells are represented with Khalimsky coordinates). If the triangle is degenerate (a,b,c not distinct or aligned), then it returns an empty range of cells.LatticeSet DGtal::DigitalConvexity< TKSpace >::StarCvxH | ( | const PointRange & | X, |
Dimension | axis = dimension ) const |
Builds the cell complex Star(CvxH(X)) for X a digital set, represented as a lattice set (stacked row representation).
X | any range of lattice points |
axis | specifies the projection axis for the row representation if below space dimension, otherwise chooses the axis that minimizes memory/computations. |
Referenced by checkSkelStarCvxHFullConvexity(), SCENARIO(), SCENARIO(), SCENARIO(), and SCENARIO().
LatticeSet DGtal::DigitalConvexity< TKSpace >::toLatticeSet | ( | const PointRange & | X, |
Dimension | axis = dimension ) const |
Builds the lattice set (stacked row representation) associated to the given range of points.
X | any range of lattice points |
axis | specifies the projection axis for the row representation if below space dimension, otherwise chooses the axis that minimizes memory/computations. |
PointRange DGtal::DigitalConvexity< TKSpace >::toPointRange | ( | const LatticeSet & | L | ) | const |
Builds the range of lattice points associated to the given lattice set.
L | any lattice set. |
PointRange DGtal::DigitalConvexity< TKSpace >::U | ( | Dimension | i, |
const PointRange & | X ) const |
Performs the digital Minkowski sum of X along direction i
i | any valid dimension |
X | any sorted range of digital points |
Referenced by checkCvxHPlusHypercubeFullConvexity().
|
static |
Definition at line 100 of file DigitalConvexity.h.
|
mutableprotected |
The number of iterations of the last FullyConvexEnvelope operation.
Definition at line 922 of file DigitalConvexity.h.
|
protected |
The cellular grid space where computations are done.
Definition at line 914 of file DigitalConvexity.h.
|
protected |
when 'true' performs convex hull computations with arbitrary precision integer (if available), otherwise chooses a compromise between speed and precision (int64_t).
Definition at line 919 of file DigitalConvexity.h.