DGtal 1.3.0
Loading...
Searching...
No Matches
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 933 of file BoundedLatticePolytope.h.

Member Typedef Documentation

◆ Integer

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

Definition at line 934 of file BoundedLatticePolytope.h.

◆ Point

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

Definition at line 936 of file BoundedLatticePolytope.h.

◆ Polytope

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

Definition at line 938 of file BoundedLatticePolytope.h.

◆ Space

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

Definition at line 935 of file BoundedLatticePolytope.h.

◆ Vector

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

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

953 {
954 Vector ab = pts[ i ] - pts[ j ];
955 for ( int s = 0; s < 2; s++ )
956 for ( Dimension k = 0; k < dimension; ++k )
957 {
958 Vector n = ab.crossProduct( Point::base( k, (s == 0) ? 1 : -1 ) );
959 Integer b = n.dot( pts[ i ] );
960 std::size_t nb_in = 0;
961 for ( auto p : pts ) {
962 Integer v = n.dot( p );
963 if ( v < b ) nb_in++;
964 }
965 if ( nb_in == pts.size() - 2 ) {
966 P.cut( n, b, true, true );
967 }
968 }
969 }
static Self base(Dimension k, Component val=1)
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 975 of file BoundedLatticePolytope.h.

976 {
977 return v1.crossProduct( v2 );
978 }

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


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