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

Implementation of Fortune's algorithm. More...

#include <FortuneAlgorithm.h>

Public Member Functions

 FortuneAlgorithm (std::vector< Vector2< T >> points)
 Constructor of FortuneAlgorithm. More...
 
void construct ()
 Execute Fortune's algorithm to construct the diagram. More...
 
bool bound (Box< T > box)
 Bound the Voronoi diagram. More...
 
Diagram< T > getDiagram ()
 Return the constructed diagram. More...
 

Detailed Description

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

Implementation of Fortune's algorithm.

Template Parameters
TFloating point type (float, double or long double) to use in the algorithm
Author
Pierre Vigier

Definition at line 36 of file Box.h.

Constructor & Destructor Documentation

◆ FortuneAlgorithm()

template<typename T >
mygal::FortuneAlgorithm< T >::FortuneAlgorithm ( std::vector< Vector2< T >>  points)
inlineexplicit

Constructor of FortuneAlgorithm.

The points must all be unique.

Parameters
pointsCoordinates of the sites that will be used to generate the Voronoi diagram

Definition at line 53 of file FortuneAlgorithm.h.

Member Function Documentation

◆ bound()

template<typename T >
bool mygal::FortuneAlgorithm< T >::bound ( Box< T >  box)
inline

Bound the Voronoi diagram.

The method FortuneAlgorithm::construct must be called before this one to construct the diagram.

The algorithm does not guarantee that the box passed as parameter will be used for bounding. It only guarantees that the used box contains the one passed as parameter.

Parameters
boxSmallest box to use for bounding
Returns
True if no error occurs during intersection, false otherwise

Definition at line 95 of file FortuneAlgorithm.h.

◆ construct()

template<typename T >
void mygal::FortuneAlgorithm< T >::construct ( )
inline

Execute Fortune's algorithm to construct the diagram.

At the end of this method, the diagram is unbounded. The method FortuneAlgorithm::bound shoud be called to bound the diagram.

Definition at line 64 of file FortuneAlgorithm.h.

◆ getDiagram()

template<typename T >
Diagram<T> mygal::FortuneAlgorithm< T >::getDiagram ( )
inline

Return the constructed diagram.

The diagram is moved thus the method can only be called once.

Returns
Diagram constructed by the class

Definition at line 135 of file FortuneAlgorithm.h.


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