Records a tracked complex: some of the faces of a mesh, or some of its edges, which the mesh gives no ids of their own – the tracked faces of a tet mesh (N = 3), the tracked edges of a triangle mesh (N = 2).
More...
|
| | TrackedRecorder (const std::vector< Cell > &faces, Positions position, Orient orient, const std::vector< MeshFeature > &features={}) |
| |
| std::vector< MeshFeature > | features () const |
| |
| std::vector< uint64_t > | mesh_vertex_ids () const |
| |
| std::array< size_t, 2 > | commit (Change &&c) |
| |
|
void | renumber (const std::vector< size_t > &old_to_new) |
| | The mesh renumbered its vertices: old_to_new[v], size_t(-1) for a vertex gone.
|
| |
| size_t | resync (const std::vector< Cell > &faces) |
| |
|
Stats | stats () const |
| |
|
const History< N > & | history () const |
| | Not synchronised: read once the mesh is done.
|
| |
|
History< N > & | history () |
| |
|
const BasicReplay< N > & | complex () const |
| | The complex as it is now.
|
| |
| std::optional< uint64_t > | face_id (const Cell &t) const |
| |
|
std::optional< uint64_t > | vertex_id (size_t v) const |
| | The vertex of the complex a mesh vertex is, if it is on it. Not synchronised.
|
| |
| std::vector< uint64_t > | vertex_ids (const std::vector< size_t > &vs) const |
| |
|
|
std::optional< uint64_t > | live (size_t v) const |
| |
|
std::optional< uint64_t > | lookup (const Cell &t) const |
| |
|
uint64_t | fresh_vertex (size_t v) |
| |
|
std::optional< Edit > | as_split (const Change &c, const std::vector< Cell > &before, const std::vector< Cell > &removed, const std::vector< Cell > &added, std::vector< uint64_t > &fresh) |
| |
|
std::optional< Edit > | as_collapse (Change &c, const std::vector< Cell > &before, const std::vector< Cell > &after) |
| |
|
std::optional< Edit > | as_swap (const std::vector< Cell > &removed, const std::vector< Cell > &added) |
| |
|
void | record (Edit &&e, const std::vector< size_t > &written, const std::vector< uint64_t > &fresh) |
| | Records e – applies it, then the moves of written and of fresh vertices.
|
| |
|
Edit | replacement (const std::vector< Cell > &removed, const std::vector< Cell > &added, std::vector< uint64_t > &fresh) |
| | The replace_faces edit taking away removed and adding added (mesh ids, sorted).
|
| |
template<int N>
class wmtk::history::TrackedRecorder< N >
Records a tracked complex: some of the faces of a mesh, or some of its edges, which the mesh gives no ids of their own – the tracked faces of a tet mesh (N = 3), the tracked edges of a triangle mesh (N = 2).
The complex gets ids here: one for each mesh vertex on it, one for each face (triangle or segment), so the history is in the terms a TriMesh records in (History, replayed by BasicReplay) and a renumbering of the mesh changes nothing in it. At each commit an operation reports the tracked faces around it before and after, by mesh vertex ids. The recorder finds the edit that takes the one to the other – an edge split, an edge collapse, an edge swap – checks that it gives exactly the faces after, and records it; a change no edit fits it records as it is (EditKind::replace_faces), which a map cannot follow. A face keeps the corner order it had, through the edits' rules; one that only a replace_faces makes takes the order orient gives.
Features (History::features) are carried by the edits' rules alone; the mesh must keep them by the same rules. On curves a feature point keeps its vertex on the complex without any segment, so a collapse that removes one is recorded even when no segment changes.
Commits may come concurrently from operations whose regions do not overlap. They are serialised here, while each operation still holds its locks, so the order of the edits is a valid serial order of the run, as for BasicRecorder.