Navigation
API > API/Runtime > API/Runtime/GeometryCore
| Name | FDelaunay2 |
| Type | class |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/CompGeom/Delaunay2.h |
| Include Path | #include "CompGeom/Delaunay2.h" |
Syntax
class FDelaunay2
Enums
Public
| Name | Remarks |
|---|---|
| EFillMode | Options for selecting what triangles to include in the output, for constrained Delaunay triangulation of polygons. |
| EResult | Indicates result of triangulation. |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bAutomaticallyFixEdgesToDuplicateVertices | bool | Option to automatically track duplicate vertices and treat edges that reference them as if they referenced the instance that was actually used in the triangulation Note: Cannot change this to 'true' after triangulation and then call ConstrainEdges; duplicate vertices will only be detected on their initial insertion | CompGeom/Delaunay2.h | |
| bKeepFastEdgeAdjacencyData | bool | Option to keep extra vertex->edge adjacency data; useful if you will call ConstrainEdges many times on the same triangulation. | CompGeom/Delaunay2.h | |
| bValidateEdges | bool | Option to validate that edges remain in the triangulation after multiple constraint edges passed in Only validates for the edges in the current call; if separate calls constrain additional edges, set this to 'false' and call HasEdges() on the full edge set TODO: Consider having the internal mesh remember what edges have been constrained, so we can set an error flag when constrained edges cross previous constrained edges | CompGeom/Delaunay2.h | |
| RandomStream | FRandomStream | Source for random permutations, used internally in the triangulation algorithm. | CompGeom/Delaunay2.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Result | EResult | CompGeom/Delaunay2.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool CanComputeVoronoiCells() |
CompGeom/Delaunay2.h | ||
bool ConstrainEdges
(
TArrayView< const TVector2< float > > Vertices, |
CompGeom/Delaunay2.h | ||
bool ConstrainEdges
(
TArrayView< const TVector2< double > > Vertices, |
Update an already-computed triangulation so the given edges are in the triangulation. | CompGeom/Delaunay2.h | |
void FixDuplicatesOnEdge
(
FIndex2i& Edge |
Remap any references to duplicate vertices to only reference the vertices used in the triangulation. | CompGeom/Delaunay2.h | |
TArray< FIndex3i > GetFilledTriangles
(
TArrayView< const FIndex2i > Edges, |
Return the triangles that are inside the given edges, removing the outer boundary triangles If a Winding-Number-based fill mode is used, assumes edges are oriented and tracks the winding number across edges | CompGeom/Delaunay2.h | |
bool GetFilledTriangles
(
TArray< FIndex3i >& TrianglesOut, |
Get (by reference) the triangles that are inside the given edges, removing the outside-boundary triangles and the inside-hole triangles | CompGeom/Delaunay2.h | |
bool GetFilledTriangles
(
TArray< FIndex3i >& TrianglesOut, |
Get (by reference) the triangles that are inside the given edges, removing the outer boundary triangles If a Winding-Number-based fill mode is used, assumes edges are oriented and tracks the winding number across edges | CompGeom/Delaunay2.h | |
bool GetFilledTrianglesGeneralizedWinding
(
TArray< FIndex3i >& TrianglesOut, |
CompGeom/Delaunay2.h | ||
bool GetFilledTrianglesGeneralizedWinding
(
TArray< FIndex3i >& TrianglesOut, |
Get (by reference) the triangles that are inside the given edges, using a generalized winding number method to determine which triangles are inside Not valid for EFillMode::Solid, will fall back to the above GetFilledTriangles method in that case. | CompGeom/Delaunay2.h | |
EResult GetResult() |
CompGeom/Delaunay2.h | ||
| Get the triangulation as an array of triangles Note: This creates a new array each call, because the internal data structure does not have a triangle array | CompGeom/Delaunay2.h | ||
| Get the triangulation as an array with a corresponding adjacency array, indicating the adjacent triangle on each triangle edge (-1 if no adjacent triangle) | CompGeom/Delaunay2.h | ||
TArray< TArray< FVector2d > > GetVoronoiCells
(
TArrayView< const FVector2d > Vertices, |
Get Voronoi diagram cells as dual of the Delaunay triangulation. | CompGeom/Delaunay2.h | |
TArray< TArray< FVector2f > > GetVoronoiCells
(
TArrayView< const FVector2f > Vertices, |
CompGeom/Delaunay2.h | ||
bool HasDuplicates() |
CompGeom/Delaunay2.h | ||
bool HasEdge
(
const FIndex2i& Edge, |
CompGeom/Delaunay2.h | ||
bool HasEdges
(
TArrayView< const FIndex2i > Edges |
CompGeom/Delaunay2.h | ||
bool IsConstrained() |
CompGeom/Delaunay2.h | ||
bool IsDelaunay
(
TArrayView< const FVector2d > Vertices, |
CompGeom/Delaunay2.h | ||
bool IsDelaunay
(
TArrayView< const FVector2f > Vertices, |
CompGeom/Delaunay2.h | ||
int32 RemapIfDuplicate
(
int32 Index |
CompGeom/Delaunay2.h | ||
bool Triangulate
(
TArrayView< const TVector2< float > > Vertices, |
CompGeom/Delaunay2.h | ||
bool Triangulate
(
TArrayView< const TVector2< double > > Vertices, |
TODO: it would often be useful to pass in sparse vertex data / Optional function to allow Triangulate to skip vertices. | CompGeom/Delaunay2.h | |
bool Triangulate
(
const TGeneralPolygon2< RealType >& GeneralPolygon, |
Triangulate a polygon, and optionally pass back the resulting triangles Uses a winding-number-based fill mode, and relies on the general polygon having correct orientations (Uses TGeneralPolygon2's OuterIsClockwise() to automatically choose between positive or negative winding) Note: TrianglesOut may be empty or incomplete if the input is self-intersecting. | CompGeom/Delaunay2.h | |
bool Triangulate
(
const TPolygon2< RealType >& Polygon, |
Triangulate a polygon, and optionally pass back the resulting triangles Uses the 'solid' fill mode, and fills the polygon regardless of the edge orientation Note: TrianglesOut may be empty or incomplete if the input is self-intersecting. | CompGeom/Delaunay2.h | |
bool Update
(
TArrayView< const TVector2< double > > Vertices, |
Update the triangulation incrementally, assuming Vertices are unchanged before FirstNewIndex, and nothing after FirstNewIndex has been inserted yet Note that updating with new vertices after constraining edges may remove previously-constrained edges, unless we also add a way to tag constrained edges | CompGeom/Delaunay2.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool ValidateResult
(
TArrayView< const FIndex2i > Edges |
Helper to perform standard validation on results after Triangulate or ConstrainEdges calls | CompGeom/Delaunay2.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static TArray< TArray< TVector2< RealType > > > ComputeVoronoiCells
(
TArrayView< const TVector2< RealType > > Sites, |
Compute Voronoi diagram cells | CompGeom/Delaunay2.h |