LiquidFun
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Public Member Functions | List of all members
b2VoronoiDiagram Class Reference

A field representing the nearest generator from each point. More...

#include <b2VoronoiDiagram.h>

Classes

class  NodeCallback
 Callback used by GetNodes(). More...
 

Public Member Functions

 b2VoronoiDiagram (b2StackAllocator *allocator, int32 generatorCapacity)
 
void AddGenerator (const b2Vec2 &center, int32 tag, bool necessary)
 
void Generate (float32 radius, float32 margin)
 
void GetNodes (NodeCallback &callback) const
 

Detailed Description

A field representing the nearest generator from each point.

Member Function Documentation

void b2VoronoiDiagram::AddGenerator ( const b2Vec2 &  center,
int32  tag,
bool  necessary 
)

Add a generator.

Parameters
theposition of the generator.
atag used to identify the generator in callback functions.
whetherto callback for nodes associated with the generator.
void b2VoronoiDiagram::Generate ( float32  radius,
float32  margin 
)

Generate the Voronoi diagram. It is rasterized with a given interval in the same range as the necessary generators exist.

Parameters
theinterval of the diagram.
marginfor which the range of the diagram is extended.
void b2VoronoiDiagram::GetNodes ( NodeCallback &  callback) const

Enumerate all nodes that contain at least one necessary generator.

Parameters
acallback function object called for each node.

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