Wildmeshing Toolkit
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
wmtk::components::tracking::VolumeMap Class Reference

The map between the first and the last state of a tet mesh's volume, region by region, rebuilt from its surface history and its volume history (history::VolumeHistory). More...

#include <VolumeMap.hpp>

Classes

struct  Faces
 
struct  OpMap
 One operation's map: patch pairs applied in turn, each to the points in its tets. More...
 
struct  Shared
 

Public Member Functions

 VolumeMap (const history::SurfaceHistory &surface, history::VolumeHistory volume, const VolumeMapOptions &options={})
 
 VolumeMap (VolumeMap &&) noexcept
 
std::vector< VolumePoint > to_output (std::vector< VolumePoint > points) const
 Points of the first state, mapped onto the last.
 
std::vector< VolumePoint > to_input (std::vector< VolumePoint > points) const
 Points of the last state, mapped onto the first.
 
const history::VolumeHistory & history () const
 
std::optional< uint32_t > region_of (std::vector< int64_t > tags) const
 The region of a tag set, if the history has it.
 
std::optional< uint32_t > region_of_groups (const std::set< std::string > &names) const
 
const SurfaceMap & surface_map () const
 
VolumeMapStats stats () const
 What building and using the map found so far.
 
void build_all () const
 Builds every operation's map, for the stats.
 
std::vector< std::string > op_kinds (size_t k) const
 

Private Member Functions

std::vector< VolumePoint > map (std::vector< VolumePoint > points, bool forward) const
 
std::shared_ptr< const OpMap > op (size_t k) const
 

Private Attributes

history::VolumeHistory m_volume
 
VolumeMapOptions m_options
 
SurfaceMap m_surface
 
std::vector< std::unique_ptr< Faces > > m_faces
 
std::vector< std::pair< Eigen::Vector3d, Eigen::Vector3d > > m_boxes
 
Eigen::Vector3d m_grid_lo = Eigen::Vector3d::Zero()
 
Eigen::Vector3d m_grid_hi = Eigen::Vector3d::Zero()
 
double m_grid_cell = 1
 
std::unique_ptr< Shared > m_shared
 

Detailed Description

The map between the first and the last state of a tet mesh's volume, region by region, rebuilt from its surface history and its volume history (history::VolumeHistory).

An operation that does not change the tracked surface leaves every region where it is: the identity in space. One that does gets a local map on the tets around it, built per region from pairs of patches (before -> after): each patch embedded star-shaped – its real geometry when it is, else a fallback embedding (see volume::spherical) – and points carried along rays from the centres by the boundary map, the identity on the faces the operation keeps and the surface map's local map (SurfaceMap, CollapsePatch::removed_star) on the tracked faces it changes. Both sides of the surface use the same surface map, so they agree on it. A collapse whose side has a chord goes through a decomposition (split, collapse, unsplit), a swap that cannot be one pair through an exact split and a collapse.

The const queries – to_output(), to_input(), build_all(), op_kinds(), stats() – may be called on one map from several threads at once: what they share, the operations built and kept and the stats, is kept under a mutex, and each call counts its points' stats apart and adds them at its end.

Member Function Documentation

◆ op()

std::shared_ptr< const VolumeMap::OpMap > wmtk::components::tracking::VolumeMap::op ( size_t  k) const
private

Operation k's map, from the cache or built; nothing if it cannot be built. The stats count each operation once, however often it is built.

◆ op_kinds()

std::vector< std::string > wmtk::components::tracking::VolumeMap::op_kinds ( size_t  k) const

The kinds of the patch pairs operation k's map is made of ("single", "move", "swap side", a decomposition's steps, ...); none if it cannot be built. For tests and reports.

◆ region_of_groups()

std::optional< uint32_t > wmtk::components::tracking::VolumeMap::region_of_groups ( const std::set< std::string > &  names) const

The region of a tet a mesh file lists in the groups names – the tags' labels (VolumeHistory::tag_names), as io::collect_tags gives them; none, or "ambient" when no tag has that label, for a tet with no tag – if the history has it.

Member Data Documentation

◆ m_faces

std::vector<std::unique_ptr<Faces> > wmtk::components::tracking::VolumeMap::m_faces
private

Per volume edit: its tracked faces before and after, and the box of its positions, before and after it, which a point must be in to be in its tets.

◆ m_grid_lo

Eigen::Vector3d wmtk::components::tracking::VolumeMap::m_grid_lo = Eigen::Vector3d::Zero()
private

The grid a call finds the points in an operation's box with: over the boxes of all the operations – a point outside them is in none – its cells as wide as the median box.


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