Delaunay3DInterface Class Reference

#include <delaunay3d.h>

Public Member Functions

MAXON_METHOD Result< void > CopyFrom (const Delaunay3DInterface *src, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::FIT_TO_SIZE)
 
MAXON_METHOD Result< void > Init (const Range< Vector > &workSpace)
 
MAXON_METHOD Result< void > CalculateDelaunayTetrahedralization ()
 
MAXON_METHOD Bool IsInitialized ()
 
MAXON_METHOD Result< void > AddPointsIntoTetrahedralization (const BaseArray< Vector > &newPointsIn)
 
MAXON_METHOD Result< void > AddPointIntoTetrahedralization (const Vector &newPointIn)
 
const MAXON_METHOD BaseArray< Tetrahedron > & GetTetrahedrons (Int &arrayCount, Int &pointCount) const
 
const MAXON_METHOD BaseArray< Tetrahedron > & GetTetrahedrons () const
 
const MAXON_METHOD BaseArray< Int32 > & GetPointsToTetConnections () const
 
const MAXON_METHOD BaseArray< Vector > & GetPoints () const
 
MAXON_METHOD ResultRef< BaseArray< Vector > > GetPointsWrite ()
 
Result< void > GetTetrahedronCopy (BaseArray< Tetrahedron > &arrayIn, Int &tetCount, Int &pointCount) const
 
MAXON_METHOD Int GetTetrahedronCount () const
 
MAXON_METHOD Int GetPointCount () const
 
MAXON_METHOD Result< void > Reset ()
 
MAXON_METHOD void Flush ()
 
MAXON_METHOD Result< BoolFindTetIndexContainingPoint (const Vector &point, Int32 &foundTetIndex, Int32 &onFace1, Int32 &onFace2) const
 
MAXON_METHOD Result< BoolFindTetContainingPoint (const Vector &point, Int32 &foundTetIndex) const
 

Static Public Member Functions

static MAXON_METHOD Delaunay3DInterfaceAlloc (MAXON_SOURCE_LOCATION_DECLARATION)
 
static MAXON_METHOD Float OrientDet (const Vector &planePointA, const Vector &planePointB, const Vector &planePointC, const Vector &testPoint)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (Delaunay3DInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.delaunay3d")
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( Delaunay3DInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.interface.delaunay3d"   
)
private

◆ Alloc()

◆ CopyFrom()

Copies the content of another Delaunay3D Object into this one (copy and assign is not allowed)

Parameters
[in]srcThe Delaunay3D Object to copy from.
[in]resizeFlagsResize flag for internal list copies. recommended is default.
Returns
OK on success.

◆ Init()

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

The Initialization function for Delaunay3D. Needs to be called before points can be added into the tetrahedralization.

Parameters
[in]workSpaceThe space in which the input points will be in. Should not be too big for numeric reasons.
Returns
OK on success.

◆ CalculateDelaunayTetrahedralization()

MAXON_METHOD Result<void> CalculateDelaunayTetrahedralization ( )

Updates the Tetrahedralization if new points have been added. This triggers the final calculation or update of the tetrahedralization.

Returns
OK on success.

◆ IsInitialized()

MAXON_METHOD Bool IsInitialized ( )

Checks if Init() has been called. THREADSAFE.

Returns
true if Init() has beed called, false otherwise.

◆ AddPointsIntoTetrahedralization()

MAXON_METHOD Result<void> AddPointsIntoTetrahedralization ( const BaseArray< Vector > &  newPointsIn)

Adds a BaseArray of points into the tetrahedralization. CalculateDelaunayTetrahedralization() needs to be called afterwards to calculate the insertion.

Parameters
[in]newPointsInThe list of points, that will be added into the tetrahedralization.
Returns
OK on success.

◆ AddPointIntoTetrahedralization()

MAXON_METHOD Result<void> AddPointIntoTetrahedralization ( const Vector newPointIn)

Adds a single point into the tetrahedralization. CalculateDelaunayTetrahedralization() needs to be called afterwards to calculate the insertion.

Parameters
[in]newPointInThe point that will be added into the tetrahedralization.
Returns
OK on success.

◆ GetTetrahedrons() [1/2]

const MAXON_METHOD BaseArray<Tetrahedron>& GetTetrahedrons ( Int arrayCount,
Int pointCount 
) const

Gets a constant reference to the tetrahedrons list. THREADSAFE.

Parameters
[out]arrayCountWill be filled with the amount of tetrahedrons in the array reference.
[out]pointCountWill be filled with the amount of points inserted into the teterahedralization.
Returns
A constant reference to a BaseArray<Tetrahedron> with the tetrahedrons, that make up the tetrahedralization.

◆ GetTetrahedrons() [2/2]

const MAXON_METHOD BaseArray<Tetrahedron>& GetTetrahedrons ( ) const

Gets a constant reference to the tetrahedrons list. THREADSAFE.

Returns
A constant reference to a BaseArray<Tetrahedron> with the tetrahedrons, that make up the tetrahedralization.

◆ GetPointsToTetConnections()

const MAXON_METHOD BaseArray<Int32>& GetPointsToTetConnections ( ) const

Gets a constant reference to the connection of one of the points to an arbitrary adjacent tetrahedron. This can be used to greatly increase the calculation speed of a Voronoi conversion. THREADSAFE.

Returns
A constant reference to a BaseArray<Int32> with the tetrahedron index to the point at the same array position as added.

◆ GetPoints()

const MAXON_METHOD BaseArray<Vector>& GetPoints ( ) const

Gets a constant reference to the list of points, that are set for the Delaunay tetrahedralization. THREADSAFE.

Returns
A constant reference to a BaseArray<Vector> with the points of the tetrahedralization.

◆ GetPointsWrite()

MAXON_METHOD ResultRef<BaseArray<Vector> > GetPointsWrite ( )

Gets a reference to the list of points, that are set for the Delaunay tetrahedralization (writable). THREADSAFE.

Returns
A reference to a BaseArray<Vector> with the points of the tetrahedralization.

◆ GetTetrahedronCopy()

Result<void> GetTetrahedronCopy ( BaseArray< Tetrahedron > &  arrayIn,
Int tetCount,
Int pointCount 
) const

Gets a copy of the tetrahedrons making up the tetrahedralization. THREADSAFE.

Parameters
[out]arrayInWill be filled with the tetrahedron information.
[out]tetCountWill be filled with the amount of tetrahedrons.
[out]pointCountWill be filled with the amount of points.
Returns
OK on success.

◆ GetTetrahedronCount()

MAXON_METHOD Int GetTetrahedronCount ( ) const

Gets the current amount of tetrahedrons. THREADSAFE.

Returns
Amount of tetrahedrons.

◆ GetPointCount()

MAXON_METHOD Int GetPointCount ( ) const

Gets the current amount of points THREADSAFE.

Returns
Amount of points that were added.

◆ Reset()

MAXON_METHOD Result<void> Reset ( )

Resets the Delaunay object for a reuse with the same initialization.

Returns
OK on success.

◆ OrientDet()

static MAXON_METHOD Float OrientDet ( const Vector planePointA,
const Vector planePointB,
const Vector planePointC,
const Vector testPoint 
)
static

Static helper method to calculate the precise orientation of a point, in reference to a plane. the plane is spanned by planePointA, planePointB and planePointC. the tested point is testPoint. THREADSAFE.

Parameters
[in]planePointAPoint one of plane.
[in]planePointBPoint two of plane.
[in]planePointCPoint three of plane.
[in]testPointPoint to test for.
Returns
The determinant of the calculation. The sign of the result gives information about the side the point was is on.

◆ Flush()

MAXON_METHOD void Flush ( )

Resets all data structures for a new calculation. Needs to be reinitialized before its reused.

◆ FindTetIndexContainingPoint()

MAXON_METHOD Result<Bool> FindTetIndexContainingPoint ( const Vector point,
Int32 foundTetIndex,
Int32 onFace1,
Int32 onFace2 
) const

Returns the index of the tetrahedron the input point is in. THREADSAFE.

Parameters
[in]pointThe point position to search the tetrahedron index for.
[out]foundTetIndexThe index of the tetrahedron that the point was in.
[out]onFace1Is set if the point is on one of the tetrahedrons faces.
[out]onFace2Is set if the point is on one of the tetrahedron edges (there for on two faces).
Returns
True if the point was inside a tetrahedron, false otherwise or on error.

◆ FindTetContainingPoint()

MAXON_METHOD Result<Bool> FindTetContainingPoint ( const Vector point,
Int32 foundTetIndex 
) const

Returns the index of the tetrahedron the input point is in. THREADSAFE.

Parameters
[in]pointThe point position to search the tetrahedron index for.
[out]foundTetIndexThe index of the tetrahedron that the point was in.
Returns
True if the point was inside a tetrahedron, false otherwise or on error.