MyGAL
Classes | Public Member Functions | Friends | List of all members
mygal::Diagram< T > Class Template Reference

Data structure representing a partitioning of the space. More...

#include <Diagram.h>

Classes

struct  Face
 Structure representing a cell in the diagram. More...
 
struct  HalfEdge
 Half-edge of a face. More...
 
struct  Site
 Point associated with a face of the partitioning. More...
 
struct  Vertex
 Vertex of a face. More...
 

Public Member Functions

 Diagram (const Diagram &)=delete
 
Diagramoperator= (const Diagram &)=delete
 
 Diagram (Diagram &&)=default
 Default move constructor. More...
 
Diagramoperator= (Diagram &&)=default
 Default move assignment operator. More...
 
const std::vector< Site > & getSites () const
 Get sites. More...
 
const SitegetSite (std::size_t i) const
 Get a site. More...
 
std::size_t getNbSites () const
 Get the number of sites. More...
 
const std::vector< Face > & getFaces () const
 Get faces. More...
 
const FacegetFace (std::size_t i) const
 Get a face. More...
 
const std::list< Vertex > & getVertices () const
 Get vertices. More...
 
const std::list< HalfEdge > & getHalfEdges () const
 Get half-edges. More...
 
bool intersect (Box< T > box)
 Compute the intersection between the diagram and a box. More...
 
std::vector< Vector2< T > > computeLloydRelaxation () const
 Compute a Lloyd relaxation. More...
 
Triangulation computeTriangulation () const
 Compute the triangulation induced by the diagram. More...
 

Friends

template<typename >
class FortuneAlgorithm
 

Detailed Description

template<typename T>
class mygal::Diagram< T >

Data structure representing a partitioning of the space.

Author
Pierre Vigier

Definition at line 33 of file Box.h.

Constructor & Destructor Documentation

◆ Diagram()

template<typename T>
mygal::Diagram< T >::Diagram ( Diagram< T > &&  )
default

Default move constructor.

Member Function Documentation

◆ computeLloydRelaxation()

template<typename T>
std::vector<Vector2<T> > mygal::Diagram< T >::computeLloydRelaxation ( ) const
inline

Compute a Lloyd relaxation.

For each cell of the diagram, the algorithm computes the centroid of this cell.

The diagram must be bounded before calling this method.

Returns
Vector of centroids of the cells

Definition at line 328 of file Diagram.h.

◆ computeTriangulation()

template<typename T>
Triangulation mygal::Diagram< T >::computeTriangulation ( ) const
inline

Compute the triangulation induced by the diagram.

If the diagram is a Voronoi diagram then the output of this method is a Delaunay triangulation.

This method can be called even if the diagram is not bounded.

Returns
The triangulation induced by the diagram

Definition at line 363 of file Diagram.h.

◆ getFace()

template<typename T>
const Face* mygal::Diagram< T >::getFace ( std::size_t  i) const
inline

Get a face.

Parameters
iIndex of the site associated with the requested face
Returns
Const pointer to the requested face

Definition at line 168 of file Diagram.h.

◆ getFaces()

template<typename T>
const std::vector<Face>& mygal::Diagram< T >::getFaces ( ) const
inline

Get faces.

Returns
Const reference to the vector of faces of the diagram

Definition at line 156 of file Diagram.h.

◆ getHalfEdges()

template<typename T>
const std::list<HalfEdge>& mygal::Diagram< T >::getHalfEdges ( ) const
inline

Get half-edges.

Returns
Const reference to the list of half-edges of the diagram

Definition at line 188 of file Diagram.h.

◆ getNbSites()

template<typename T>
std::size_t mygal::Diagram< T >::getNbSites ( ) const
inline

Get the number of sites.

Returns
The number of sites

Definition at line 146 of file Diagram.h.

◆ getSite()

template<typename T>
const Site* mygal::Diagram< T >::getSite ( std::size_t  i) const
inline

Get a site.

Parameters
iIndex of the requested site
Returns
Const pointer to the requested site

Definition at line 136 of file Diagram.h.

◆ getSites()

template<typename T>
const std::vector<Site>& mygal::Diagram< T >::getSites ( ) const
inline

Get sites.

Returns
Const reference to the vector of sites of the diagram

Definition at line 124 of file Diagram.h.

◆ getVertices()

template<typename T>
const std::list<Vertex>& mygal::Diagram< T >::getVertices ( ) const
inline

Get vertices.

Returns
Const reference to the list of vertices of the diagram

Definition at line 178 of file Diagram.h.

◆ intersect()

template<typename T>
bool mygal::Diagram< T >::intersect ( Box< T >  box)
inline

Compute the intersection between the diagram and a box.

The diagram must be bounded before calling this method.

Returns
True if no error occurs during intersection, false otherwise

Definition at line 202 of file Diagram.h.

◆ operator=()

template<typename T>
Diagram& mygal::Diagram< T >::operator= ( Diagram< T > &&  )
default

Default move assignment operator.


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