DGtal  1.3.beta
Public Member Functions | Data Fields
DGtal::QuickHull< TKernel >::Facet Struct Reference

#include <DGtal/geometry/tools/QuickHull.h>

Public Member Functions

 Facet ()=default
 
 Facet (const Facet &)=default
 
 Facet (Facet &&)=default
 
Facetoperator= (Facet &&)=default
 
Facetoperator= (const Facet &)=default
 
 Facet (const HalfSpace &aH, Index b)
 
void clear ()
 
void addPointOn (Index p)
 
void display (std::ostream &out) const
 
void addNeighbor (Index n)
 
void subNeighbor (Index n)
 
void swap (Facet &other)
 
Size variableMemory () const
 

Data Fields

HalfSpace H
 the facet geometry More...
 
IndexRange neighbors
 neighbor facets More...
 
IndexRange outside_set
 outside set, i.e. points above this facet More...
 
IndexRange on_set
 on set, i.e. points on this facet, sorted More...
 
Index below
 index of point that is below this facet More...
 

Detailed Description

template<typename TKernel>
struct DGtal::QuickHull< TKernel >::Facet

A facet is d-1 dimensional convex cell lying on the boundary of a full dimensional convex set. Its supporting hyperplane defines an half-space touching and enclosing the convex set.

Definition at line 160 of file QuickHull.h.

Constructor & Destructor Documentation

◆ Facet() [1/4]

template<typename TKernel >
DGtal::QuickHull< TKernel >::Facet::Facet ( )
default

◆ Facet() [2/4]

template<typename TKernel >
DGtal::QuickHull< TKernel >::Facet::Facet ( const Facet )
default

◆ Facet() [3/4]

template<typename TKernel >
DGtal::QuickHull< TKernel >::Facet::Facet ( Facet &&  )
default

◆ Facet() [4/4]

template<typename TKernel >
DGtal::QuickHull< TKernel >::Facet::Facet ( const HalfSpace aH,
Index  b 
)
inline

Definition at line 172 of file QuickHull.h.

173  : H( aH ), below( b ) {}

Member Function Documentation

◆ addNeighbor()

template<typename TKernel >
void DGtal::QuickHull< TKernel >::Facet::addNeighbor ( Index  n)
inline

Definition at line 201 of file QuickHull.h.

202  {
203  const auto it = std::find( neighbors.cbegin(), neighbors.cend(), n );
204  if ( it == neighbors.cend() ) neighbors.push_back( n );
205  }

References DGtal::QuickHull< TKernel >::Facet::neighbors.

◆ addPointOn()

template<typename TKernel >
void DGtal::QuickHull< TKernel >::Facet::addPointOn ( Index  p)
inline

Definition at line 183 of file QuickHull.h.

184  {
185  const auto it = std::find( on_set.cbegin(), on_set.cend(), p );
186  if ( it == on_set.cend() ) on_set.push_back( p );
187  }

References DGtal::QuickHull< TKernel >::Facet::on_set.

◆ clear()

template<typename TKernel >
void DGtal::QuickHull< TKernel >::Facet::clear ( )
inline

◆ display()

template<typename TKernel >
void DGtal::QuickHull< TKernel >::Facet::display ( std::ostream &  out) const
inline

Definition at line 188 of file QuickHull.h.

189  {
190  const auto N = H.internalNormal();
191  out << "[Facet iN=(" << N[0];
192  for ( Dimension i = 1; i < N.dimension; i++ ) out << "," << N[ i ];
193  out << ") c=" << H.internalIntercept() << " b=" << below << " n={";
194  for ( auto&& n : neighbors ) out << " " << n;
195  out << " } #out=" << outside_set.size();
196  out << " on={";
197  for ( auto&& n : on_set ) out << " " << n;
198  out << " }]" << std::endl;
199  }

References DGtal::QuickHull< TKernel >::Facet::below, DGtal::QuickHull< TKernel >::Facet::H, DGtal::QuickHull< TKernel >::Facet::neighbors, DGtal::QuickHull< TKernel >::Facet::on_set, and DGtal::QuickHull< TKernel >::Facet::outside_set.

Referenced by DGtal::QuickHull< TKernel >::processFacet().

◆ operator=() [1/2]

template<typename TKernel >
Facet& DGtal::QuickHull< TKernel >::Facet::operator= ( const Facet )
default

◆ operator=() [2/2]

template<typename TKernel >
Facet& DGtal::QuickHull< TKernel >::Facet::operator= ( Facet &&  )
default

◆ subNeighbor()

template<typename TKernel >
void DGtal::QuickHull< TKernel >::Facet::subNeighbor ( Index  n)
inline

Definition at line 206 of file QuickHull.h.

207  {
208  auto it = std::find( neighbors.begin(), neighbors.end(), n );
209  if ( it != neighbors.end() ) {
210  std::swap( *it, neighbors.back() );
211  neighbors.pop_back();
212  }
213  }

References DGtal::QuickHull< TKernel >::Facet::neighbors.

◆ swap()

template<typename TKernel >
void DGtal::QuickHull< TKernel >::Facet::swap ( Facet other)
inline

Definition at line 214 of file QuickHull.h.

215  {
216  if ( this != &other ) {
217  std::swap( H, other.H );
218  neighbors.swap ( other.neighbors );
219  outside_set.swap( other.outside_set );
220  on_set.swap ( other.on_set );
221  std::swap( below, other.below );
222  }
223  }

References DGtal::QuickHull< TKernel >::Facet::below, DGtal::QuickHull< TKernel >::Facet::H, DGtal::QuickHull< TKernel >::Facet::neighbors, DGtal::QuickHull< TKernel >::Facet::on_set, and DGtal::QuickHull< TKernel >::Facet::outside_set.

◆ variableMemory()

template<typename TKernel >
Size DGtal::QuickHull< TKernel >::Facet::variableMemory ( ) const
inline

Definition at line 224 of file QuickHull.h.

225  {
226  Size M;
227  M += neighbors.capacity() * sizeof( Index );
228  M += outside_set.capacity() * sizeof( Index );
229  M += on_set.capacity() * sizeof( Index );
230  return M;
231  }

References DGtal::QuickHull< TKernel >::Facet::neighbors, DGtal::QuickHull< TKernel >::Facet::on_set, and DGtal::QuickHull< TKernel >::Facet::outside_set.

Field Documentation

◆ below

template<typename TKernel >
Index DGtal::QuickHull< TKernel >::Facet::below

◆ H

template<typename TKernel >
HalfSpace DGtal::QuickHull< TKernel >::Facet::H

◆ neighbors

template<typename TKernel >
IndexRange DGtal::QuickHull< TKernel >::Facet::neighbors

◆ on_set

template<typename TKernel >
IndexRange DGtal::QuickHull< TKernel >::Facet::on_set

◆ outside_set

template<typename TKernel >
IndexRange DGtal::QuickHull< TKernel >::Facet::outside_set

The documentation for this struct was generated from the following file:
DGtal::QuickHull::Facet::H
HalfSpace H
the facet geometry
Definition: QuickHull.h:161
DGtal::QuickHull::Facet::neighbors
IndexRange neighbors
neighbor facets
Definition: QuickHull.h:162
DGtal::Dimension
DGtal::uint32_t Dimension
Definition: Common.h:137
DGtal::QuickHull::HalfSpace
Kernel::HalfSpace HalfSpace
Definition: QuickHull.h:150
Size
HalfEdgeDataStructure::Size Size
Definition: testHalfEdgeDataStructure.cpp:50
DGtal::QuickHull::Facet::below
Index below
index of point that is below this facet
Definition: QuickHull.h:165
DGtal::QuickHull::UNASSIGNED
@ UNASSIGNED
Definition: QuickHull.h:155
DGtal::QuickHull::Index
std::size_t Index
Definition: QuickHull.h:146
DGtal::QuickHull::Facet::outside_set
IndexRange outside_set
outside set, i.e. points above this facet
Definition: QuickHull.h:163
DGtal::QuickHull::Facet::on_set
IndexRange on_set
on set, i.e. points on this facet, sorted
Definition: QuickHull.h:164