Wildmeshing Toolkit
Loading...
Searching...
No Matches
RationalPositions.h
1#pragma once
2
3#include <atomic>
4#include <cstddef>
5#include <vector>
6
7namespace wmtk {
8
21{
22public:
23 virtual ~RationalPositions() = default;
24
37 size_t round_all_vertices();
38
55
56protected:
58 virtual std::vector<size_t> all_vertex_ids() const = 0;
60 virtual bool vertex_is_rounded(const size_t vid) const = 0;
63 virtual bool round_vertex(const size_t vid) = 0;
64
72 std::atomic<bool> m_all_rounded = false;
73};
74
75} // namespace wmtk
The rounded/exact bookkeeping shared by every mesh that keeps both coordinates.
Definition RationalPositions.h:21
virtual bool vertex_is_rounded(const size_t vid) const =0
Whether this vertex's double position is currently trusted.
bool round_and_check_all_rounded()
Run the sweep, then report whether the mesh is now fully rounded.
Definition RationalPositions.cpp:37
virtual bool round_vertex(const size_t vid)=0
size_t round_all_vertices()
Try to round every un-rounded vertex; returns the number reclaimed.
Definition RationalPositions.cpp:7
std::atomic< bool > m_all_rounded
True when every vertex is known to be rounded.
Definition RationalPositions.h:72
virtual std::vector< size_t > all_vertex_ids() const =0
Every live vertex, in the mesh's own iteration order.