Wildmeshing Toolkit
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
wmtk::history::History< N > Struct Template Reference

A complex and the edits it went through, in commit order. More...

#include <History.hpp>

Public Types

using Face = std::array< uint64_t, N >
 A face's corners: a triangle's three, a segment's two.
 
using Feature = std::array< uint64_t, N - 1 >
 

Public Member Functions

void save (const std::string &path) const
 
std::vector< uint8_t > to_bytes () const
 The bytes of a history file, in memory: what a component's memory route returns.
 

Static Public Member Functions

static History load (const std::string &path)
 
static History from_bytes (const std::vector< uint8_t > &bytes)
 

Public Attributes

std::vector< Eigen::Vector3d > vertices
 The snapshot: every vertex and face slot, live or not.
 
std::vector< uint8_t > vertex_alive
 
std::vector< Face > faces
 
std::vector< uint8_t > face_alive
 
std::vector< Feature > features
 
std::vector< Edit > edits
 
std::string metadata
 Free-form text saved with the history; the recording application's parameters, say.
 
std::vector< uint64_t > output_vertex_ids
 
std::vector< uint64_t > input_vertex_ids
 

Detailed Description

template<int N>
struct wmtk::history::History< N >

A complex and the edits it went through, in commit order.

Two kinds of complex, by the number of corners N of a face:

Replaying the edits from the snapshot (Replay.hpp) reproduces every later state, ids included, which is what a map between the first and the last state is built from. SurfaceHistory and CurveHistory name the two (Fwd.hpp).

Member Typedef Documentation

◆ Feature

template<int N>
using wmtk::history::History< N >::Feature = std::array<uint64_t, N - 1>

A feature: a cell one dimension down from the faces, which the operations keep – an edge of a surface, a point of a curve network.

Member Function Documentation

◆ save()

template<int N>
void wmtk::history::History< N >::save ( const std::string &  path) const

To and from a history file (read_history, write_history). Loading throws if the file holds the other kind of complex (see face_size()).

Member Data Documentation

◆ features

template<int N>
std::vector<Feature> wmtk::history::History< N >::features

Features, which a map must take onto themselves, each with its vertices sorted. The edits carry them along by fixed rules, so only the snapshot lists them:

  • a surface's feature edges (label boundaries, say): a split feature edge leaves two feature halves, a collapse renames the removed endpoint's feature edges to the survivor, a swap never takes one;
  • a curve network's feature points (its junctions and ends, points of the input): a split makes none, a collapse of one renames it to the survivor. A feature point keeps its vertex alive without any segment: it may lie off the curves.

◆ input_vertex_ids

template<int N>
std::vector<uint64_t> wmtk::history::History< N >::input_vertex_ids

The id the mesh the history starts from gives each vertex of the first state – for a history that starts at a tet mesh's tracked surface rather than at input files, so that a point on it is named by the mesh's three vertices, as output_vertex_ids names one on the last. Empty when the first state is the input files' faces, as read.

◆ output_vertex_ids

template<int N>
std::vector<uint64_t> wmtk::history::History< N >::output_vertex_ids

The id the application's output gives each vertex of the last state, kNoVertex for one it does not write – for an application whose output numbers vertices its own way: a tet mesh's, whose tracked surface is no element of the output, so a point on it is named by the output's three vertices; a triangle mesh's, whose tracked curves are named by two. Empty when the last state's ids are the output's own, as a TriMesh application's are.


The documentation for this struct was generated from the following files: