DGtal  1.4.2
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 
50 namespace 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;
79  using HalfSpace = typename Polytope::HalfSpace;
80  using BigInteger = typename Polytope::BigInteger;
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 
160  void getPointsAlongAxis( PointRange& pts, Dimension a ) const;
161 
172 
179 
191 
195 
197  Point lowerBound() const { return myLower; }
199  Point upperBound() const { return myUpper; }
200 
201 
202  // --------------------------- protected datas -----------------------------------
209  };
210 
211 } // namespace DGtal
212 
213 
215 // Includes inline functions.
216 #include "BoundedLatticePolytopeCounter.ih"
217 
218 // //
220 
221 #endif // !defined BoundedLatticePolytopeCounter_h
222 
223 #undef BoundedLatticePolytopeCounter_RECURSES
224 #endif // else defined(BoundedLatticePolytopeCounter_RECURSES)
225 
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< Vector > InequalityMatrix
std::vector< Integer > InequalityVector
HyperRectDomain< Space > Domain
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:136
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines.
Definition: CSpace.h:106