DGtal  1.1.0
Public Types | Static Public Member Functions | Static Public Attributes
DGtal::detail::BoundedLatticePolytopeSpecializer< 3, TInteger > Struct Template Reference

Aim: 3D specialization for BoundedLatticePolytope to add dimension specific static methods. More...

#include <DGtal/geometry/volumes/BoundedLatticePolytope.h>

Public Types

typedef TInteger Integer
 
typedef SpaceND< 3, IntegerSpace
 
typedef Space::Point Point
 
typedef Space::Vector Vector
 
typedef BoundedLatticePolytope< SpacePolytope
 

Static Public Member Functions

static void addEdgeConstraint (Polytope &P, unsigned int i, unsigned int j, const std::vector< Point > &pts)
 
static Vector crossProduct (const Vector &v1, const Vector &v2)
 

Static Public Attributes

static const Dimension dimension = Space::dimension
 

Detailed Description

template<typename TInteger>
struct DGtal::detail::BoundedLatticePolytopeSpecializer< 3, TInteger >

Aim: 3D specialization for BoundedLatticePolytope to add dimension specific static methods.

Description of template class 'BoundedLatticePolytopeSpecializer'

Template Parameters
TIntegerany model of integer.

Definition at line 757 of file BoundedLatticePolytope.h.

Member Typedef Documentation

◆ Integer

template<typename TInteger >
typedef TInteger DGtal::detail::BoundedLatticePolytopeSpecializer< 3, TInteger >::Integer

Definition at line 758 of file BoundedLatticePolytope.h.

◆ Point

template<typename TInteger >
typedef Space::Point DGtal::detail::BoundedLatticePolytopeSpecializer< 3, TInteger >::Point

Definition at line 760 of file BoundedLatticePolytope.h.

◆ Polytope

template<typename TInteger >
typedef BoundedLatticePolytope< Space > DGtal::detail::BoundedLatticePolytopeSpecializer< 3, TInteger >::Polytope

Definition at line 762 of file BoundedLatticePolytope.h.

◆ Space

template<typename TInteger >
typedef SpaceND< 3, Integer> DGtal::detail::BoundedLatticePolytopeSpecializer< 3, TInteger >::Space

Definition at line 759 of file BoundedLatticePolytope.h.

◆ Vector

template<typename TInteger >
typedef Space::Vector DGtal::detail::BoundedLatticePolytopeSpecializer< 3, TInteger >::Vector

Definition at line 761 of file BoundedLatticePolytope.h.

Member Function Documentation

◆ addEdgeConstraint()

template<typename TInteger >
static void DGtal::detail::BoundedLatticePolytopeSpecializer< 3, TInteger >::addEdgeConstraint ( Polytope P,
unsigned int  i,
unsigned int  j,
const std::vector< Point > &  pts 
)
inlinestatic

This method add extremal constraints for simplex edges. Each constraint is a half-space bounded by the edge and one axis. Such constraints are useful when computing the Minkowski sum.

Parameters
[in,out]Pany polytope.
[in]iany index in the vector of points pts.
[in]jany index in the vector of points pts.
[in]ptsa vector of points defining a simplex.

Definition at line 775 of file BoundedLatticePolytope.h.

777  {
778  Vector ab = pts[ i ] - pts[ j ];
779  for ( int s = 0; s < 2; s++ )
780  for ( Dimension k = 0; k < dimension; ++k )
781  {
782  Vector n = ab.crossProduct( Point::base( k, (s == 0) ? 1 : -1 ) );
783  Integer b = n.dot( pts[ i ] );
784  int nb_in = 0;
785  for ( auto p : pts ) {
786  Integer v = n.dot( p );
787  if ( v < b ) nb_in++;
788  }
789  if ( nb_in == pts.size() - 2 ) {
790  P.cut( n, b, true, true );
791  }
792  }
793  }

References DGtal::PointVector< dim, Integer >::base(), DGtal::PointVector< dim, TEuclideanRing, TContainer >::crossProduct(), DGtal::BoundedLatticePolytope< TSpace >::cut(), and DGtal::detail::BoundedLatticePolytopeSpecializer< N, TInteger >::dimension.

◆ crossProduct()

template<typename TInteger >
static Vector DGtal::detail::BoundedLatticePolytopeSpecializer< 3, TInteger >::crossProduct ( const Vector v1,
const Vector v2 
)
inlinestatic

Generic method for cross product, only implemented in 3D.

Parameters
v1any vector
v2any vector
Returns
their cross product.

Definition at line 799 of file BoundedLatticePolytope.h.

800  {
801  return v1.crossProduct( v2 );
802  }

References DGtal::PointVector< dim, TEuclideanRing, TContainer >::crossProduct().

Field Documentation

◆ dimension

template<typename TInteger >
const Dimension DGtal::detail::BoundedLatticePolytopeSpecializer< 3, TInteger >::dimension = Space::dimension
static

Definition at line 763 of file BoundedLatticePolytope.h.


The documentation for this struct was generated from the following file:
DGtal::Dimension
DGtal::uint32_t Dimension
Definition: Common.h:133
DGtal::detail::BoundedLatticePolytopeSpecializer< 3, TInteger >::dimension
static const Dimension dimension
Definition: BoundedLatticePolytope.h:763
Vector
FreemanChain< int >::Vector Vector
Definition: testCombinDSS.cpp:60
DGtal::detail::BoundedLatticePolytopeSpecializer< 3, TInteger >::Integer
TInteger Integer
Definition: BoundedLatticePolytope.h:758