48 std::vector<Eigen::Vector3d> positions;
49 std::vector<uint64_t> surface_before, surface_after;
51 std::vector<std::pair<uint32_t, Eigen::Vector3d>>
moved;
54 std::vector<std::array<uint32_t, 4>>
tets;
55 std::vector<uint32_t> regions;
58 std::vector<std::array<uint32_t, 4>> added;
59 std::vector<uint32_t> added_regions;
64 std::vector<std::array<uint32_t, 4>>
tets_after(
65 std::vector<uint32_t>* regions_after =
nullptr)
const;
76 bool operator==(
const SurfaceKey& o)
const {
return edits == o.edits && hash == o.hash; }
77 bool operator!=(
const SurfaceKey& o)
const {
return !(*
this == o); }
91 std::vector<std::vector<int64_t>>
regions;
108 void save(
const std::string& path)
const;
110 std::vector<uint8_t> to_bytes()
const;
111 static VolumeHistory from_bytes(
const std::vector<uint8_t>& bytes);
118 const std::vector<uint8_t>& bytes,
119 const std::string& name =
"the history given");
125 std::vector<std::array<size_t, 4>> tets;
126 std::vector<std::vector<int64_t>> tags;
127 std::vector<size_t> vertices;
128 std::vector<Eigen::Vector3d> positions;
129 std::vector<uint64_t> surface;
150 std::array<size_t, 2> surface_edits,
151 const std::vector<size_t>& op_vertices,
156 void renumber(
const std::vector<size_t>& old_to_new);
164 uint64_t surface_edit_offset,
166 const std::map<int64_t, std::string>& tag_names)
const;
169 size_t bytes()
const;
173 uint32_t
region_of(
const std::vector<int64_t>& tags);
175 mutable std::mutex m_mutex;
176 std::vector<std::vector<int64_t>> m_regions;
179 uint64_t m_next_id = 0;
184 std::unique_ptr<Encoder> m_encoder;
Records a VolumeHistory alongside a TrackedSurfaceRecorder. An operation captures the tets around it ...
Definition VolumeHistory.hpp:142
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.
Definition VolumeHistory.cpp:647
std::vector< uint8_t > m_bytes
The edits, encoded in the order they came (see VolumeHistory.cpp).
Definition VolumeHistory.hpp:181
VolumeHistory history() const
What was recorded, decoded, sorted by surface edit.
Definition VolumeHistory.cpp:661
std::vector< uint8_t > to_bytes(uint64_t surface_edit_offset, const SurfaceKey &surface, const std::map< int64_t, std::string > &tag_names) const
Definition VolumeHistory.cpp:675
size_t size() const
The edits recorded, and the bytes they take.
Definition VolumeHistory.cpp:688
uint32_t region_of(const std::vector< int64_t > &tags)
The region of a set of tags, sorted, each once; a new one if it is new. Under the lock.
Definition VolumeHistory.cpp:559
std::vector< uint64_t > m_id_of
Mesh vertex -> the recorder's id of it.
Definition VolumeHistory.hpp:178
The history types by name, for headers that only hold them (History.hpp defines them).
Definition BinaryIO.hpp:16
bool is_volume_history(const std::vector< uint8_t > &bytes, const std::string &name)
Definition VolumeHistory.cpp:422
SurfaceKey surface_key(const SurfaceHistory &h)
Definition VolumeHistory.cpp:440
VolumeOp
The tet operations a volume history records.
Definition VolumeHistory.hpp:19
A complex and the edits it went through, in commit order.
Definition History.hpp:101
Definition VolumeHistory.hpp:73
Definition VolumeHistory.hpp:124
One operation that changed the tracked surface of a tet mesh, as the tets around it saw it: the tets ...
Definition VolumeHistory.hpp:39
std::vector< uint32_t > op_vertices
collapse: {removed, kept}; smooth: {the vertex}; swaps: none.
Definition VolumeHistory.hpp:61
std::vector< std::array< uint32_t, 4 > > tets
Definition VolumeHistory.hpp:54
std::vector< uint32_t > removed
After it: those tets but removed (indices into tets), and added.
Definition VolumeHistory.hpp:57
std::vector< std::pair< uint32_t, Eigen::Vector3d > > moved
The vertices the operation moved, and where to.
Definition VolumeHistory.hpp:51
std::vector< Eigen::Vector3d > positions_after() const
The positions after the operation.
Definition VolumeHistory.cpp:492
uint64_t first_edit
The surface history's edits the operation made: [first_edit, first_edit + n_edits).
Definition VolumeHistory.hpp:42
std::vector< std::array< uint32_t, 4 > > tets_after(std::vector< uint32_t > *regions_after=nullptr) const
The tets after the operation, with their regions.
Definition VolumeHistory.cpp:473
std::vector< uint64_t > vertices
Definition VolumeHistory.hpp:47
The tets around every operation that changed a tet mesh's tracked surface, which, with the surface hi...
Definition VolumeHistory.hpp:89
std::vector< std::vector< int64_t > > regions
The regions, each the set of tags of its tets, sorted.
Definition VolumeHistory.hpp:91
uint64_t surface_edit_offset
Definition VolumeHistory.hpp:100
std::vector< VolumeEdit > edits
In the order of the surface edits they made.
Definition VolumeHistory.hpp:97
std::optional< SurfaceKey > surface
Definition VolumeHistory.hpp:103
void save(const std::string &path) const
Definition VolumeHistory.cpp:538
std::map< int64_t, std::string > tag_names
Definition VolumeHistory.hpp:95
Definition VolumeHistory.cpp:549