|
OpenABF 2.1.0
|
Lightweight flat-array mesh for decimation. More...
Public Member Functions | |
| template<class MeshPtr > | |
| void | build (const MeshPtr &mesh, const std::vector< std::size_t > &pinIndices) |
| auto | num_alive_verts () const -> std::size_t |
| auto | num_alive_faces () const -> std::size_t |
| auto | try_collapse (std::size_t vRemove, std::size_t vKeep, std::vector< std::size_t > *outKeepNbrs=nullptr) -> std::optional< CollapseRecord< T > > |
| Try to collapse edge (vRemove → vKeep), returning a collapse record. | |
| auto | collapse_cost (std::size_t v0, std::size_t v1) const -> T |
| auto | is_alive (std::size_t v) const -> bool |
| auto | is_collapsible (std::size_t v) const -> bool |
| auto | vertex_neighbors (std::size_t v) const -> std::vector< std::size_t > |
| auto | snapshot () const -> HierarchyLevel< T > |
| auto | rebuild_and_get_edges () -> const std::vector< std::pair< std::size_t, std::size_t > > & |
Private Member Functions | |
| void | compute_quadrics_ () |
| void | build_edges_ () |
Static Private Member Functions | |
| static auto | computeBarycentric_ (const Vec< T, 3 > &a, const Vec< T, 3 > &b, const Vec< T, 3 > &c, const Vec< T, 3 > &p) -> std::array< T, 3 > |
Private Attributes | |
| std::vector< Vec< T, 3 > > | positions_ |
| std::vector< bool > | alive_ |
| std::vector< bool > | is_boundary_ |
| std::vector< bool > | is_pinned_ |
| std::vector< Quadric< T > > | quadrics_ |
| std::vector< std::array< std::size_t, 3 > > | faces_ |
| std::vector< bool > | face_alive_ |
| std::vector< std::vector< std::size_t > > | vert_faces_ |
| std::size_t | num_alive_verts_ {0} |
| std::size_t | num_alive_faces_ {0} |
| std::vector< std::pair< std::size_t, std::size_t > > | edges_ |
| std::vector< std::size_t > | scratch_shared_ |
| std::vector< std::size_t > | scratch_remove_ |
| std::vector< std::array< std::size_t, 3 > > | scratch_post_faces_ |
| std::vector< std::size_t > | scratch_nbrs_a_ |
| std::vector< std::size_t > | scratch_nbrs_b_ |
| std::vector< std::size_t > | scratch_shared_nbrs_ |
Lightweight flat-array mesh for decimation.
Copies vertex positions and face connectivity from a HalfEdgeMesh into flat vectors, builds adjacency structures, and supports half-edge collapse.
|
inline |
Build from a HalfEdgeMesh
|
inlineprivate |
Rebuild the unique-edge list from the live faces.
|
inline |
Compute collapse cost for edge (v0 → v1): Q_merged evaluated at v1
|
inlineprivate |
Recompute per-vertex QEM quadrics from the live faces (Garland-Heckbert).
|
inlinestaticprivate |
Compute barycentric coordinates of point p in triangle (a, b, c)
|
inline |
Check if a vertex is alive
|
inline |
Check if a vertex is collapsible (not pinned, alive)
|
inline |
Get number of alive faces
|
inline |
Get number of alive vertices
|
inline |
Rebuild the edge list from alive faces and return it
|
inline |
Take a snapshot of surviving vertices and faces for a hierarchy level
|
inline |
Try to collapse edge (vRemove → vKeep), returning a collapse record.
Returns nullopt if the collapse is invalid.
| outKeepNbrs | Optional out-vector. On a successful collapse it is overwritten with vKeep's post-collapse neighbor vertex indices (sorted, unique). Passing a caller- owned vector here lets the PQ-update path reuse the allocation across collapses instead of letting vertex_neighbors() allocate a fresh vector each time. |
|
inline |
Get alive neighbour vertices of v (sorted, deduped).
Production code path uses try_collapse's outKeepNbrs out-param to avoid this method's per-call allocation; this overload is retained only as the oracle for the HLSCMInternal.TryCollapse_* tests.
|
private |
Per-vertex alive flag; collapses set entries to false.
|
private |
Unique-edge list, rebuilt on demand by build_edges_().
|
private |
Per-face alive flag; collapses retire faces by setting entries to false.
|
private |
Face connectivity: each face is three vertex indices into positions_.
|
private |
Per-vertex boundary flag, copied from the source mesh.
|
private |
Per-vertex pinned flag; pinned vertices cannot be removed by collapse.
|
private |
Count of alive faces (kept current across collapses).
|
private |
Count of alive vertices (kept current across collapses).
|
private |
Per-vertex 3D positions, indexed by original vertex index.
|
private |
Per-vertex QEM quadrics accumulated from incident face planes.
|
private |
Scratch buffer: neighbor list of one endpoint.
|
private |
Scratch buffer: neighbor list of the other endpoint.
|
private |
Scratch buffer: post-collapse face rewrites.
|
private |
Scratch buffer: faces to retire on a collapse.
|
private |
Scratch buffer: neighbor indices shared between two endpoints.
|
private |
Scratch buffer: deduplicated union of scratch_nbrs_a_ and scratch_nbrs_b_.
|
private |
Per-vertex incident face list.