81 std::vector<uint64_t> v;
82 std::vector<uint64_t> faces;
102 static_assert(N == 2 || N == 3,
"a history is of triangles or of segments");
104 using Face = std::array<uint64_t, N>;
111 std::vector<uint8_t> vertex_alive;
112 std::vector<Face> faces;
113 std::vector<uint8_t> face_alive;
126 std::vector<Edit> edits;
149 void save(
const std::string& path)
const;
150 static History load(
const std::string& path);
152 std::vector<uint8_t>
to_bytes()
const;
153 static History from_bytes(
const std::vector<uint8_t>& bytes);
162std::vector<uint8_t>
read_history(
const std::filesystem::path& path);
165void write_history(
const std::filesystem::path& path,
const std::vector<uint8_t>& bytes);
169int face_size(
const std::string& path);
170int face_size(
const std::vector<uint8_t>& bytes);
191 const std::vector<std::vector<uint64_t>>& sources);
210 void append(
Edit&& e);
214 void rebase(std::vector<Eigen::Vector3d> positions);
222 History<N> m_history;
223 std::vector<Eigen::Vector3d> m_known;
224 std::vector<uint8_t> m_known_valid;
Collects the edits of operations that may commit concurrently.
Definition History.hpp:206
const History< N > & history() const
Not synchronised: read it once the recording mesh is done.
Definition History.hpp:217
void rebase(std::vector< Eigen::Vector3d > positions)
Definition History.cpp:260
The history types by name, for headers that only hold them (History.hpp defines them).
Definition BinaryIO.hpp:16
std::vector< uint8_t > read_history(const std::filesystem::path &path)
The bytes of a history file, as History::from_bytes takes them – or VolumeHistory::from_bytes,...
Definition History.cpp:426
void write_history(const std::filesystem::path &path, const std::vector< uint8_t > &bytes)
Definition History.cpp:439
EditKind
The kinds of edit a complex goes through.
Definition History.hpp:27
@ move_vertices
Only vertex positions change (smoothing, or a sweep outside any operation).
@ consolidate
Live vertices and faces renumbered by rank, in id order.
void append_embedded(History< N > &h, const History< N > &next, const std::vector< std::vector< uint64_t > > &sources)
h, then next, which starts on a complex lying on h's last state: the same surface or curves,...
Definition History.cpp:296
constexpr uint64_t kNoVertex
No vertex: in a relabel, the slot of one that goes.
Definition History.hpp:69
bool append(History< N > &h, const History< N > &next)
The history of a pipeline: h, then next, which starts where h ends – the same complex,...
Definition History.cpp:268
One committed operation.
Definition History.hpp:79
std::vector< VertexMove > moves
The position, after the operation, of every live vertex it wrote.
Definition History.hpp:84
A complex and the edits it went through, in commit order.
Definition History.hpp:101
std::array< uint64_t, N > Face
A face's corners: a triangle's three, a segment's two.
Definition History.hpp:104
std::vector< uint64_t > output_vertex_ids
Definition History.hpp:138
std::array< uint64_t, N - 1 > Feature
Definition History.hpp:107
std::vector< uint64_t > input_vertex_ids
Definition History.hpp:145
std::string metadata
Free-form text saved with the history; the recording application's parameters, say.
Definition History.hpp:129
std::vector< Eigen::Vector3d > vertices
The snapshot: every vertex and face slot, live or not.
Definition History.hpp:110
void save(const std::string &path) const
Definition History.cpp:323
std::vector< Feature > features
Definition History.hpp:124
std::vector< uint8_t > to_bytes() const
The bytes of a history file, in memory: what a component's memory route returns.
Definition History.cpp:341
Definition History.hpp:72