CellData Class Reference

#include <celldata.h>

详细描述

CellData struct is a datacontainer that represents a single Voronoi Cell.

公共成员函数

  MAXON_DISALLOW_COPY_AND_ASSIGN ( CellData )
  CellData ()=default
  CellData ( CellData && src )=default
  MAXON_OPERATOR_MOVE_ASSIGNMENT ( CellData )
  ~CellData ()=default
Result < void >  CopyFrom (const CellData & src , COLLECTION_RESIZE_FLAGS resizeFlags= COLLECTION_RESIZE_FLAGS::FIT_TO_SIZE )
void  重置 ()
void  Flush ()
Result < Bool ScaleCell ( Float scaleValue)
Result < Bool FixGeometry ()
BaseArray < 向量 > &  GetVertices ()
BaseArray < CellEdge > &  GetEdges ()
BaseArray < Int > &  GetFaces ()
BaseArray < Int32 > &  GetAdjacentCells ()
const BaseArray < 向量 > &  GetVertices () const
const BaseArray < CellEdge > &  GetEdges () const
const BaseArray < Int > &  GetFaces () const
const BaseArray < Int32 > &  GetAdjacentCells () const
Bool   IsComplex () const
Bool   TestPointWithCell (const 向量 &point) const
Result < void >  MergeCells (const BaseArray < Int > &thisCellFaces, const CellData &neighbourCell, const BaseArray < Int > &otherCellFaces)
Result < void >  FuseCells ( Int thisCellIndex, CellData &neighbourCell, Int otherCellIndex)
向量   CreateCellFaceNormal ( Int faceIndex) const
Result < void >  AddCellData (const CellData &otherCell)
Range < 向量 GetBoundingBox () const

私有成员函数

void  MarkAllUsedPoints ( BaseArray < Int > &pointUseless, Int mark= NOTOK )
void  MarkAllDoublePoints ( BaseArray < Int > &pointUseless, Bool &pointRemoved, Float epsilonOverride=0.0)
Result < Bool MarkAllColinearPoints ( BaseArray < Int > &pointUseless, Bool &pointRemoved, Float epsilonOverride=0.0)
Result < Bool MarkAllUselessPoints ( BaseArray < Int > &pointUseless, Bool &pointRemoved)
Result < Bool ReCreateCellWithOnlyUsefulPoints ( BaseArray < Int > &pointUseless)
Result < void >  CalcAllFaceNormals ( BaseArray < 向量 > &faceNormals)
Bool   SetupReverseEdges ()
Result < void >  CleanupUnusedPoints ()
Bool   TestCurrentDataStructure ( BaseArray < Char > &faceRemoved)
Result < void >  ExpandCellByValue (const BaseArray < 向量 > &planeNormals, const BaseArray < Int32 > &edgeToFaceBelonging, Float offset, BaseArray < 向量 > &pointDisplacements)
Result < Bool ShrinkCellByValue (const BaseArray < 向量 > &planeNormals, Float offset)
Result < Bool CutCellOnPlane (const Pair < 向量 , 向量 > &plane, Int32 planeNeighborIndex= NOTOK )
Result < Bool CutFaceOnPlane ( Int faceIndex, const Pair < 向量 , 向量 > &plane, const BaseArray < Float > &pointToCutPlaneDistance, const BaseArray < Int > &edgeIntesection, const BaseArray < Int > &pointTranslateMap, BaseArray < CellEdge > &newEdges, BaseArray < CellEdge > &newFaceEdges)
Result < Bool ProcessInsideFaceAndAddToEdges (const BaseArray < CellEdge > &newFaceEdges, Int pointCount, BaseArray < CellEdge > &newEdges)
Result < Int IntersectEdgeOnPlane (const Pair < 向量 , 向量 > &planeBaseArray, Int edgeIndex, BaseArray < 向量 > &newPoints)
Result < void >  MergePointsInCutData ( BaseArray < 向量 > &newPoints, BaseArray < CellEdge > &newEdges, BaseArray < Int > &newFaces, BaseArray < CellEdge > &newFaceEdges)
Result < void >  RemoveIsolatedPoints ()
Result < void >  FusePoints ( BaseArray < Int > &affectedPoints)
Result < void >  RemoveFace ( Int faceIndex, BaseArray < Int > &affectedPoints)

Private Attributes

BaseArray < Int _verticesPreIndex
BaseArray < 向量 _vertices
BaseArray < CellEdge _edges
BaseArray < Int _faces
BaseArray < Int32 _adjacentCell
Bool   _isComplex

Friends

class  Voronoi3DImpl

构造函数 & 析构函数文档编制

◆  CellData() [1/2]

CellData ( )
default

◆  CellData() [2/2]

CellData ( CellData &&  src )
default

◆  ~CellData()

~ CellData ( )
default

成员函数文档编制

◆  MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( CellData   )

◆  MAXON_OPERATOR_MOVE_ASSIGNMENT()

MAXON_OPERATOR_MOVE_ASSIGNMENT ( CellData   )

◆  CopyFrom()

Result <void> CopyFrom ( const CellData src ,
COLLECTION_RESIZE_FLAGS   resizeFlags = COLLECTION_RESIZE_FLAGS::FIT_TO_SIZE  
)

Copies the contents of src into this object.

参数
[in] src The object to copy from.
[in] resizeFlags Resize flag for collections.
返回
OK on success.

◆  Reset()

void Reset ( )

Resets this cell to an empty cell.

◆  Flush()

void Flush ( )

Resets this cell to an empty cell (keeps memory).

◆  ScaleCell()

Result < Bool > ScaleCell ( Float   scaleValue )

Scales the current cell by a specific value.

参数
[in] scaleValue the amout the cell will be scaled by.
返回
if the scaling succeded.

◆  FixGeometry()

Result < Bool > FixGeometry ( )

This cell checks the current cell data structure and optimizes it.

返回
true if everything worked out, otherwise false.

◆  GetVertices() [1/2]

BaseArray < 向量 >& GetVertices ( )

Gets the vertex list of this cell (writable).

返回
Reference to vertex array.

◆  GetEdges() [1/2]

BaseArray < CellEdge >& GetEdges ( )

Gets the edge list of this cell (writable).

返回
Reference to edge array.

◆  GetFaces() [1/2]

BaseArray < Int >& GetFaces ( )

Gets the face list of this cell (writable).

返回
Reference to face array.

◆  GetAdjacentCells() [1/2]

BaseArray < Int32 >& GetAdjacentCells ( )

Gets the adjacent cell list of this cell (writable).

返回
Reference to the adjacent cell array.

◆  GetVertices() [2/2]

const BaseArray < 向量 >& GetVertices ( ) const

Gets the vertex list of this cell (not writable).

返回
Constant reference to vertex array.

◆  GetEdges() [2/2]

const BaseArray < CellEdge >& GetEdges ( ) const

Gets the edge list of this cell (not writable).

返回
Constant reference to edge array.

◆  GetFaces() [2/2]

const BaseArray < Int >& GetFaces ( ) const

Gets the face list of this cell (not writable).

返回
Constant reference to face array.

◆  GetAdjacentCells() [2/2]

const BaseArray < Int32 >& GetAdjacentCells ( ) const

Gets the adjacent cell list of this cell (not writable).

返回
Constant reference to adjacent cell array.

◆  IsComplex()

Bool IsComplex ( ) const

Returns if this cell is complex (most likely not convex)

返回
Reference to face array.

◆  TestPointWithCell()

Bool TestPointWithCell ( const 向量 point ) const

Tests if a passed point is inside of the cell.

参数
[in] point Point to test if it is inside.
返回
True if point is inside cell, otherwise false.

◆  MergeCells()

Result <void> MergeCells ( const BaseArray < Int > &  thisCellFaces ,
const CellData neighbourCell ,
const BaseArray < Int > &  otherCellFaces  
)

Merges another cell into this one.

参数
[in] thisCellFaces The faces of this cell that should be removed.
[in] neighbourCell The other cell to fuse into this one.
[in] otherCellFaces The faces of the other cell to remove.
返回
OK on success.

◆  FuseCells()

Result <void> FuseCells ( Int   thisCellIndex ,
CellData neighbourCell ,
Int   otherCellIndex  
)

Fuses another cell into this one. The wall between the cells is removed if they are neighbors.

参数
[in] thisCellIndex The external index of this cell.
[in] neighbourCell The neighbor cell that should be fused.
[in] otherCellIndex The external index of the neighbor cell.
返回
OK on success.

◆  CreateCellFaceNormal()

向量 CreateCellFaceNormal ( Int   faceIndex ) const

Calculates the Normal of a pointloop face of the cell.

参数
[in] faceIndex The index of the cell to calculate the normal for.
返回
The normal of the face.

◆  AddCellData()

Result <void> AddCellData ( const CellData otherCell )

Adds the data of a different cell to this one. Indices are translated.

参数
[in] otherCell The other cell whose data should be added
返回
OK on success.

◆  GetBoundingBox()

Range < 向量 > GetBoundingBox ( ) const

Calculates and returns the Axis Aligned Bounding Box of the cell.

返回
The Bounding Box of the cell

◆  MarkAllUsedPoints()

void MarkAllUsedPoints ( BaseArray < Int > &  pointUseless ,
Int   mark = NOTOK  
)
private

◆  MarkAllDoublePoints()

void MarkAllDoublePoints ( BaseArray < Int > &  pointUseless ,
Bool pointRemoved ,
Float   epsilonOverride = 0.0  
)
private

◆  MarkAllColinearPoints()

Result < Bool > MarkAllColinearPoints ( BaseArray < Int > &  pointUseless ,
Bool pointRemoved ,
Float   epsilonOverride = 0.0  
)
private

◆  MarkAllUselessPoints()

Result < Bool > MarkAllUselessPoints ( BaseArray < Int > &  pointUseless ,
Bool pointRemoved  
)
private

◆  ReCreateCellWithOnlyUsefulPoints()

Result < Bool > ReCreateCellWithOnlyUsefulPoints ( BaseArray < Int > &  pointUseless )
private

◆  CalcAllFaceNormals()

Result <void> CalcAllFaceNormals ( BaseArray < 向量 > &  faceNormals )
private

◆  SetupReverseEdges()

Bool SetupReverseEdges ( )
private

◆  CleanupUnusedPoints()

Result <void> CleanupUnusedPoints ( )
private

◆  TestCurrentDataStructure()

Bool TestCurrentDataStructure ( BaseArray < Char > &  faceRemoved )
private

◆  ExpandCellByValue()

Result <void> ExpandCellByValue ( const BaseArray < 向量 > &  planeNormals ,
const BaseArray < Int32 > &  edgeToFaceBelonging ,
Float   offset ,
BaseArray < 向量 > &  pointDisplacements  
)
private

◆  ShrinkCellByValue()

Result < Bool > ShrinkCellByValue ( const BaseArray < 向量 > &  planeNormals ,
Float   offset  
)
private

◆  CutCellOnPlane()

Result < Bool > CutCellOnPlane ( const Pair < 向量 , 向量 > &  plane ,
Int32   planeNeighborIndex = NOTOK  
)
private

◆  CutFaceOnPlane()

Result < Bool > CutFaceOnPlane ( Int   faceIndex ,
const Pair < 向量 , 向量 > &  plane ,
const BaseArray < Float > &  pointToCutPlaneDistance ,
const BaseArray < Int > &  edgeIntesection ,
const BaseArray < Int > &  pointTranslateMap ,
BaseArray < CellEdge > &  newEdges ,
BaseArray < CellEdge > &  newFaceEdges  
)
private

◆  ProcessInsideFaceAndAddToEdges()

Result < Bool > ProcessInsideFaceAndAddToEdges ( const BaseArray < CellEdge > &  newFaceEdges ,
Int   pointCount ,
BaseArray < CellEdge > &  newEdges  
)
private

◆  IntersectEdgeOnPlane()

Result < Int > IntersectEdgeOnPlane ( const Pair < 向量 , 向量 > &  planeBaseArray ,
Int   edgeIndex ,
BaseArray < 向量 > &  newPoints  
)
private

◆  MergePointsInCutData()

Result <void> MergePointsInCutData ( BaseArray < 向量 > &  newPoints ,
BaseArray < CellEdge > &  newEdges ,
BaseArray < Int > &  newFaces ,
BaseArray < CellEdge > &  newFaceEdges  
)
private

◆  RemoveIsolatedPoints()

Result <void> RemoveIsolatedPoints ( )
private

◆  FusePoints()

Result <void> FusePoints ( BaseArray < Int > &  affectedPoints )
private

◆  RemoveFace()

Result <void> RemoveFace ( Int   faceIndex ,
BaseArray < Int > &  affectedPoints  
)
private

Friends And Related Function Documentation

◆  Voronoi3DImpl

friend class Voronoi3DImpl friend

Member Data Documentation

◆  _verticesPreIndex

BaseArray < Int > _verticesPreIndex
private

◆  _vertices

BaseArray < 向量 > _vertices
private

◆  _edges

BaseArray < CellEdge > _edges
private

◆  _faces

BaseArray < Int > _faces
private

◆  _adjacentCell

BaseArray < Int32 > _adjacentCell
private

◆  _isComplex

Bool _isComplex
private