Voronoi3DInterface Class Reference

#include <voronoi3d.h>

Detailed Description

Voronoi3D provides functions for creating a 3D Voronoi representation of points.

Public Member Functions

MAXON_METHOD Result< void > Init (const Range< Vector > &workSpace)
 
MAXON_METHOD Result< void > CopyFrom (const Voronoi3DInterface *src, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::FIT_TO_SIZE)
 
MAXON_METHOD Bool IsReadyButPendingChanges ()
 
MAXON_METHOD Bool IsReady ()
 
MAXON_METHOD Result< void > SetPoints (const BaseArray< Vector > &points)
 
MAXON_METHOD Result< void > AddPoint (const Vector &pointIn)
 
MAXON_METHOD Result< void > AddPoints (const BaseArray< Vector > &points)
 
MAXON_METHOD Result< void > CalcCells ()
 
MAXON_METHOD Result< void > CalcTetrahedralization ()
 
MAXON_METHOD void SetForClipping (Bool clipping)
 
MAXON_METHOD Int GetCellCount ()
 
const MAXON_METHOD BaseArray< Vector > & GetVoronoiPointPositions () const
 
const MAXON_METHOD BaseArray< Vector > & GetInputPoints () const
 
MAXON_METHOD ResultRef< BaseArray< Bool > > GetBorderCellFlags ()
 
MAXON_METHOD ResultRef< BaseArray< CellData > > GetCellDataStructure ()
 
MAXON_METHOD ResultRef< BaseArray< Char > > GetCellHasVolume ()
 
MAXON_METHOD Result< void > ScaleCell (Int cellIndex, Float scaleValue)
 
MAXON_METHOD Result< void > ScaleAllCells (Float scaleValue)
 
MAXON_METHOD ResultRef< Delaunay3DRef > GetDelaunayTetrizer ()
 
MAXON_METHOD void Flush ()
 
MAXON_METHOD Result< void > SetCellFuseGroup (BaseArray< Int > &fuseIndices)
 
MAXON_METHOD Result< void > FuseCells (BaseArray< Pair< Int, Int >> &joinList)
 
MAXON_METHOD Result< void > CreateInvertedVoronoiCell ()
 

Static Public Member Functions

static MAXON_METHOD Voronoi3DInterfaceAlloc (MAXON_SOURCE_LOCATION_DECLARATION)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (Voronoi3DInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.voronoi3d")
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( Voronoi3DInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.interface.voronoi3d"   
)
private

◆ Alloc()

◆ Init()

MAXON_METHOD Result<void> Init ( const Range< Vector > &  workSpace)

◆ CopyFrom()

Copies the contents of src into this object.

Parameters
[in]srcThe object to copy from.
[in]resizeFlagsResize flag for collections.
Returns
OK on success.

◆ IsReadyButPendingChanges()

MAXON_METHOD Bool IsReadyButPendingChanges ( )

Checks if the Voronoi data structure is ready, even through the data might need recalculation.

Returns
True if a Voronoi data structure is ready.

◆ IsReady()

MAXON_METHOD Bool IsReady ( )

Checks if the current object state is the finished data with no pending changes.

Returns
True if all calculations were performed and no pending changes.

◆ SetPoints()

MAXON_METHOD Result<void> SetPoints ( const BaseArray< Vector > &  points)

Sets a list of points as Voronoi sites. Only these will be used, and old points will be reset

Parameters
[in]pointsPoints to set for this Voronoi object.
Returns
OK on success.

◆ AddPoint()

MAXON_METHOD Result<void> AddPoint ( const Vector pointIn)

Add a single point to the current set of points.

Parameters
[in]pointInPoint to add for this Voronoi object.
Returns
OK on success.

◆ AddPoints()

MAXON_METHOD Result<void> AddPoints ( const BaseArray< Vector > &  points)

Adds a list of points as Voronoi sites to the current set of points.

Parameters
[in]pointsPoints to add for this Voronoi object.
Returns
OK on success.

◆ CalcCells()

MAXON_METHOD Result<void> CalcCells ( )

Performs a Voronoi calculation on the current set of points.

Returns
OK on success.

◆ CalcTetrahedralization()

MAXON_METHOD Result<void> CalcTetrahedralization ( )

Performs the pre-step of calculating a Delaunay tetrahedralization. if CalcCells() is called after this, the calcualted tetrahedralization will be reused. If CalcCells() is called without this being called, it will perform it automatically.

Returns
OK on success.

◆ SetForClipping()

MAXON_METHOD void SetForClipping ( Bool  clipping)

Set a flag that will trigger some extra calculations in die Voronoi algorithm.

◆ GetCellCount()

MAXON_METHOD Int GetCellCount ( )

Gets the amount of cells.

Returns
The amount of cells.

◆ GetVoronoiPointPositions()

const MAXON_METHOD BaseArray<Vector>& GetVoronoiPointPositions ( ) const

Gets the point positions

Returns
Reference to the list holding the site positions.

◆ GetInputPoints()

const MAXON_METHOD BaseArray<Vector>& GetInputPoints ( ) const

Gets the point positions

Returns
Reference to the list holding the site positions.

◆ GetBorderCellFlags()

MAXON_METHOD ResultRef<BaseArray<Bool> > GetBorderCellFlags ( )

Gets the flag list of that defines if a cell is a border cell. This is only set if the algorithm was set for clipping.

Returns
Reference to the list holding the border flags.

◆ GetCellDataStructure()

MAXON_METHOD ResultRef<BaseArray<CellData> > GetCellDataStructure ( )

Gets the final data structure of the Voronoi 3D diagram.

Returns
Reference to the list holding the full cell data.

◆ GetCellHasVolume()

MAXON_METHOD ResultRef<BaseArray<Char> > GetCellHasVolume ( )

Gets a list of flags, that defines for every cell, if it still has a volume. This will be true for every start cell and can only be false if a cell got scaled.

Returns
Reference to the list holding the flag if a cell still has volume.

◆ ScaleCell()

MAXON_METHOD Result<void> ScaleCell ( Int  cellIndex,
Float  scaleValue 
)

Scales one cell (cellIndex) in the Voronoi data structure

Parameters
[in]cellIndexThe index of the cell to scale
[in]scaleValueScale amount
Returns
OK on success.

◆ ScaleAllCells()

MAXON_METHOD Result<void> ScaleAllCells ( Float  scaleValue)

Scales all cells in the Voronoi data structure.

Parameters
[in]scaleValueScale amount.
Returns
OK on success.

◆ GetDelaunayTetrizer()

MAXON_METHOD ResultRef<Delaunay3DRef> GetDelaunayTetrizer ( )

Gets the internal Delaunay3D tetrahedralization class.

Returns
Reference to the internal Delaunay3D.

◆ Flush()

MAXON_METHOD void Flush ( )

Resets the object for a fresh calculation.

◆ SetCellFuseGroup()

MAXON_METHOD Result<void> SetCellFuseGroup ( BaseArray< Int > &  fuseIndices)

Sets a list of indices to be one group. These points will be fused to one cell in generation. If an index is set to fuse in an earlier call, it will be ignored. This needs to be called after points are set or it will not have any effect.

Parameters
[in]fuseIndicesThe list of indices to be fused.
Returns
OK on success.

◆ FuseCells()

MAXON_METHOD Result<void> FuseCells ( BaseArray< Pair< Int, Int >> &  joinList)

Fuses the cells declared in a list of neighbor pairs into each other.

Parameters
[in]joinListThe neighbor pairs of cells that should be fused.
Returns
OK on success.

◆ CreateInvertedVoronoiCell()

MAXON_METHOD Result<void> CreateInvertedVoronoiCell ( )

Inverts the whole Voronoi data structure. this is done by inverting all faces of the cells and fusing all into one cell.

Returns
OK on success.