DGtal  1.2.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 771 of file BoundedLatticePolytope.h.

Member Typedef Documentation

◆ Integer

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

Definition at line 772 of file BoundedLatticePolytope.h.

◆ Point

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

Definition at line 774 of file BoundedLatticePolytope.h.

◆ Polytope

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

Definition at line 776 of file BoundedLatticePolytope.h.

◆ Space

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

Definition at line 773 of file BoundedLatticePolytope.h.

◆ Vector

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

Definition at line 775 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 789 of file BoundedLatticePolytope.h.

791  {
792  Vector ab = pts[ i ] - pts[ j ];
793  for ( int s = 0; s < 2; s++ )
794  for ( Dimension k = 0; k < dimension; ++k )
795  {
796  Vector n = ab.crossProduct( Point::base( k, (s == 0) ? 1 : -1 ) );
797  Integer b = n.dot( pts[ i ] );
798  std::size_t nb_in = 0;
799  for ( auto p : pts ) {
800  Integer v = n.dot( p );
801  if ( v < b ) nb_in++;
802  }
803  if ( nb_in == pts.size() - 2 ) {
804  P.cut( n, b, true, true );
805  }
806  }
807  }
DGtal::uint32_t Dimension
Definition: Common.h:137
FreemanChain< int >::Vector Vector

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 813 of file BoundedLatticePolytope.h.

814  {
815  return v1.crossProduct( v2 );
816  }

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 777 of file BoundedLatticePolytope.h.


The documentation for this struct was generated from the following file: