cheshirekow  v0.1.0
edelsbrunner96::SimplexBase< Traits > Struct Template Reference

A simplex in the triangulation. A simplex is the convex hull of Ndim+1 points in R^NDim. More...

#include <edelsbrunner96/simplex.h>

Public Types

typedef std::bitset
< simplex::NUM_BITS
MarkedVec
 type for marked bit flags More...
 
typedef Traits::Point Point
 
typedef Traits::PointRef PointRef
 
typedef Traits::Scalar Scalar
 
typedef Traits::Simplex Simplex
 
typedef Traits::SimplexRef SimplexRef
 
typedef Traits::Storage Storage
 

Public Member Functions

Eigen::Matrix< typename
Traits::Scalar, Traits::NDim+1, 1 > 
BarycentricCoordinates (Storage &storage, const typename Traits::Point &xq) const
 Given a simplex as the convex hull of the points in V, compute the barycentric coordinates of the point xq. That is, find the vector lambda such that [v[0], v[1], ... v[n]][lambda] = xq and such that the elements of lambda sum to unity. More...
 
void ComputeCenter (Storage &storage)
 called after vertices are filled computes the circumcenter More...
 
bool Contains (Storage &storage, const typename Traits::Point &xq) const
 Interference test, return true if the query point lies inside the closed hull of the point set. More...
 
Eigen::Matrix< typename
Traits::Scalar, Traits::NDim, 1 > 
CoordinatesOf (Storage &storage, const typename Traits::Point &xq) const
 Given a simplex as the convex hull of the points in V, compute the coordinates of the point xq on the basis defined by [ (v[1] - v[0]), (v[2] - v[0]), ... (v[n] - v[0]) ]. More...
 
uint8_t IndexOf (PointRef v) const
 return the index of the specified vertex More...
 
SimplexRef NeighborAcross (PointRef q) const
 return the neighbor across the specified vertex More...
 
void SetNeighborAcross (PointRef q, SimplexRef n)
 set the neighbor across the specified vertex More...
 
template<typename... PointRefs>
void SetVertices (PointRefs...refs)
 Set the vertices of a simplex directly from a list of point refs. More...
 
template<typename Container >
void SetVertices (Container refs)
 Set the vertices of a simplex directly from a container of pointrefs. More...
 
void SetVertices (std::initializer_list< PointRef > refs)
 Set the vertices of a simplex directly from an initializer list of pointrefs. More...
 
 SimplexBase ()
 initializes version and flags; in debug mode, also zeros out arrays More...
 

Public Attributes

Point c
 circumcenter More...
 
MarkedVec marked
 flags for marking More...
 
std::array< SimplexRef,
Traits::NDim+1 > 
N
 neighbors, mapped to vertices More...
 
Scalar r2
 circumradius squared More...
 
std::array< PointRef,
Traits::NDim+1 > 
V
 
uint16_t version
 incremented when flipped More...
 

Detailed Description

template<class Traits>
struct edelsbrunner96::SimplexBase< Traits >

A simplex in the triangulation. A simplex is the convex hull of Ndim+1 points in R^NDim.

Template Parameters
Traitstraits class for simplices in the triangulation, must define, at least
  • Scalar number format, i.e. double, float
  • Point point type, i.e. Eigen::Vector
  • PointRef how to refer to a point in the point store, for instance Point*
  • PointDeref functor for dereferencing a PointRef into a Point&
  • Simplex the derived class of this type, used for defining the neighborhood in a triangulation
  • SimplexRef how to refer to a simplex in the simplex store, for instance Simplex*
  • SimplexDeref functor for dereferencing a SimplexRef into a Simplex&
  • NDim number of dimensions

As a matter of convenience (as well as an optimization) we index vertices, faces, and neighbor in a corresponding manner. The i'th face is opposite the i'th vertex. Likewise the i'th neighbor is the neighbor opposite the i'th face.

Furthermore, vertices are stored in sorted order.

Definition at line 89 of file simplex.h.

Member Typedef Documentation

template<class Traits >
typedef std::bitset<simplex::NUM_BITS> edelsbrunner96::SimplexBase< Traits >::MarkedVec

type for marked bit flags

Definition at line 98 of file simplex.h.

template<class Traits >
typedef Traits::Point edelsbrunner96::SimplexBase< Traits >::Point

Definition at line 91 of file simplex.h.

template<class Traits >
typedef Traits::PointRef edelsbrunner96::SimplexBase< Traits >::PointRef

Definition at line 92 of file simplex.h.

template<class Traits >
typedef Traits::Scalar edelsbrunner96::SimplexBase< Traits >::Scalar

Definition at line 90 of file simplex.h.

template<class Traits >
typedef Traits::Simplex edelsbrunner96::SimplexBase< Traits >::Simplex

Definition at line 93 of file simplex.h.

template<class Traits >
typedef Traits::SimplexRef edelsbrunner96::SimplexBase< Traits >::SimplexRef

Definition at line 94 of file simplex.h.

template<class Traits >
typedef Traits::Storage edelsbrunner96::SimplexBase< Traits >::Storage

Definition at line 95 of file simplex.h.

Constructor & Destructor Documentation

template<class Traits >
edelsbrunner96::SimplexBase< Traits >::SimplexBase ( )

initializes version and flags; in debug mode, also zeros out arrays

Definition at line 37 of file simplex.hpp.

Member Function Documentation

template<class Traits >
Eigen::Matrix< typename Traits::Scalar, Traits::NDim+1, 1 > edelsbrunner96::SimplexBase< Traits >::BarycentricCoordinates ( Storage storage,
const typename Traits::Point &  xq 
) const

Given a simplex as the convex hull of the points in V, compute the barycentric coordinates of the point xq. That is, find the vector lambda such that [v[0], v[1], ... v[n]][lambda] = xq and such that the elements of lambda sum to unity.

Definition at line 123 of file simplex.hpp.

template<class Traits >
void edelsbrunner96::SimplexBase< Traits >::ComputeCenter ( Storage storage)

called after vertices are filled computes the circumcenter

Definition at line 153 of file simplex.hpp.

template<class Traits >
bool edelsbrunner96::SimplexBase< Traits >::Contains ( Storage storage,
const typename Traits::Point &  xq 
) const

Interference test, return true if the query point lies inside the closed hull of the point set.

Definition at line 146 of file simplex.hpp.

template<class Traits >
Eigen::Matrix< typename Traits::Scalar, Traits::NDim, 1 > edelsbrunner96::SimplexBase< Traits >::CoordinatesOf ( Storage storage,
const typename Traits::Point &  xq 
) const

Given a simplex as the convex hull of the points in V, compute the coordinates of the point xq on the basis defined by [ (v[1] - v[0]), (v[2] - v[0]), ... (v[n] - v[0]) ].

Definition at line 103 of file simplex.hpp.

template<class Traits >
uint8_t edelsbrunner96::SimplexBase< Traits >::IndexOf ( PointRef  v) const
inline

return the index of the specified vertex

Definition at line 95 of file simplex.hpp.

template<class Traits >
Traits::SimplexRef edelsbrunner96::SimplexBase< Traits >::NeighborAcross ( PointRef  q) const
inline

return the neighbor across the specified vertex

binary searches V for the correct index

Definition at line 82 of file simplex.hpp.

template<class Traits >
void edelsbrunner96::SimplexBase< Traits >::SetNeighborAcross ( PointRef  q,
SimplexRef  n 
)
inline

set the neighbor across the specified vertex

binary searches V for the correct index

Definition at line 89 of file simplex.hpp.

template<class Traits >
template<typename... PointRefs>
void edelsbrunner96::SimplexBase< Traits >::SetVertices ( PointRefs...  refs)

Set the vertices of a simplex directly from a list of point refs.

Definition at line 51 of file simplex.hpp.

template<class Traits >
template<typename Container>
void edelsbrunner96::SimplexBase< Traits >::SetVertices ( Container  refs)

Set the vertices of a simplex directly from a container of pointrefs.

Definition at line 64 of file simplex.hpp.

template<class Traits >
void edelsbrunner96::SimplexBase< Traits >::SetVertices ( std::initializer_list< PointRef refs)

Set the vertices of a simplex directly from an initializer list of pointrefs.

Definition at line 73 of file simplex.hpp.

Member Data Documentation

template<class Traits >
Point edelsbrunner96::SimplexBase< Traits >::c

circumcenter

Definition at line 111 of file simplex.h.

template<class Traits >
MarkedVec edelsbrunner96::SimplexBase< Traits >::marked

flags for marking

Definition at line 100 of file simplex.h.

template<class Traits >
std::array<SimplexRef, Traits::NDim + 1> edelsbrunner96::SimplexBase< Traits >::N

neighbors, mapped to vertices

Definition at line 109 of file simplex.h.

template<class Traits >
Scalar edelsbrunner96::SimplexBase< Traits >::r2

circumradius squared

Definition at line 112 of file simplex.h.

template<class Traits >
std::array<PointRef, Traits::NDim + 1> edelsbrunner96::SimplexBase< Traits >::V

Definition at line 106 of file simplex.h.

template<class Traits >
uint16_t edelsbrunner96::SimplexBase< Traits >::version

incremented when flipped

vertices sorted

Definition at line 103 of file simplex.h.


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