DGtal 2.1.0
Loading...
Searching...
No Matches
BoundedLatticePolytopeCounter.h
1
17#pragma once
18
31#if defined(BoundedLatticePolytopeCounter_RECURSES)
32#error Recursive header files inclusion detected in BoundedLatticePolytopeCounter.h
33#else // defined(BoundedLatticePolytopeCounter_RECURSES)
35#define BoundedLatticePolytopeCounter_RECURSES
36
37
38#if !defined BoundedLatticePolytopeCounter_h
40#define BoundedLatticePolytopeCounter_h
41
43// Inclusions
44#include <iostream>
45#include <map>
46#include "DGtal/kernel/IntegralIntervals.h"
47#include "DGtal/geometry/volumes/BoundedLatticePolytope.h"
49
50namespace DGtal
51{
52
54 // template class BoundedLatticePolytopeCounter
65 template < typename TSpace >
67 {
69 public:
71 typedef TSpace Space;
73 using Integer = typename Polytope::Integer;
74 using Point = typename Polytope::Point;
75 using Vector = typename Polytope::Vector;
78 using Domain = typename Polytope::Domain;
82 using Interval = typename Intervals::Interval;
83 using PointRange = std::vector< Point >;
84 static const Dimension dimension = Space::dimension;
85
87 using LatticeSetByInterval = std::map< Point, Interval >;
88
90 using LatticeSetByIntervals = std::map< Point, Intervals >;
91
94
98
102 void init( const Polytope* ptrP );
103
117
131
141
151
161
174
181
193
197
199 Point lowerBound() const { return myLower; }
201 Point upperBound() const { return myUpper; }
202
203
204 // --------------------------- protected datas -----------------------------------
211 };
212
213} // namespace DGtal
214
215
217// Includes inline functions.
218#include "BoundedLatticePolytopeCounter.ih"
219
220// //
222
223#endif // !defined BoundedLatticePolytopeCounter_h
224
225#undef BoundedLatticePolytopeCounter_RECURSES
226#endif // else defined(BoundedLatticePolytopeCounter_RECURSES)
227
Aim: Useful to compute quickly the lattice points within a polytope, i.e. a convex polyhedron.
LatticeSetByInterval getLatticeCells(Dimension a) const
LatticeSetByInterval getLatticeSet(Dimension a) const
typename Polytope::InequalityVector InequalityVector
typename Polytope::InequalityMatrix InequalityMatrix
Interval interiorIntersectionIntervalAlongAxis(Point p, Dimension a) const
std::map< Point, Interval > LatticeSetByInterval
Internal type used to represent a convex lattice point set.
const Polytope * myPolytope
The associated polytope.
BoundedLatticePolytopeCounter(const Polytope &P)
void getInteriorPointsAlongAxis(PointRange &pts, Dimension a) const
BoundedLatticePolytopeCounter< TSpace > Self
Point myUpper
The upper point of the tight bounding box to the associated polytope.
Point myLower
The lower point of the tight bounding box to the associated polytope.
Interval intersectionIntervalAlongAxis(Point p, Dimension a) const
void init(const Polytope *ptrP)
BOOST_CONCEPT_ASSERT((concepts::CSpace< TSpace >))
Integer countAlongAxis(Dimension a) const
void getPointsAlongAxis(PointRange &pts, Dimension a) const
Integer countInteriorAlongAxis(Dimension a) const
std::map< Point, Intervals > LatticeSetByIntervals
Internal type used to represent any lattice point set.
BoundedLatticePolytopeCounter()=default
Default constructor.
Aim: Represents an nD lattice polytope, i.e. a convex polyhedron bounded with vertices with integer c...
ClosedIntegerHalfPlane< Space > HalfSpace
std::vector< Integer > InequalityVector
std::pair< Integer, Integer > Interval
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::uint32_t Dimension
Definition Common.h:119
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines.
Definition CSpace.h:106