VertexHandle Invalid { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Invalid property of the HalfEdgeMesh.VertexHandle class provides a static reference to an invalid vertex handle. This is useful for representing a vertex handle that does not correspond to any valid vertex in the mesh, often used as a sentinel value or for error checking.

Usage

Use the Invalid property when you need to initialize a vertex handle to a known invalid state or when checking if a vertex handle is valid. This can help prevent errors when working with mesh data structures by providing a clear way to identify uninitialized or invalid vertex handles.

Example

// Example of using the Invalid property
HalfEdgeMesh.VertexHandle vertexHandle = HalfEdgeMesh.VertexHandle.Invalid;

// Check if a vertex handle is valid
if (!vertexHandle.IsValid)
{
    // Handle the invalid vertex case
    // This could involve logging an error, skipping processing, etc.
}