29 std::vector<glm::vec3>>;
40 return std::holds_alternative<std::vector<glm::vec3>>(
values);
52 [](
const auto& vec) {
return vec.size(); },
63 return vec.size() *
sizeof(
typename std::decay_t<
decltype(vec)>::value_type);
71 [[nodiscard]]
const void*
data()
const
74 [](
const auto& vec) ->
const void* {
return vec.data(); },
81 [[nodiscard]]
const std::vector<float>*
as_scalar()
const {
return std::get_if<std::vector<float>>(&
values); }
82 [[nodiscard]]
const std::vector<glm::vec3>*
as_vector()
const {
return std::get_if<std::vector<glm::vec3>>(&
values); }
84 [[nodiscard]] std::vector<float>*
as_scalar() {
return std::get_if<std::vector<float>>(&
values); }
85 [[nodiscard]] std::vector<glm::vec3>*
as_vector() {
return std::get_if<std::vector<glm::vec3>>(&
values); }
126 for (
const auto& field :
fields) {
127 if (field.name ==
name) {
150 for (
size_t i = 0; i <
fields.size(); ++i) {
154 for (
size_t j = i + 1; j <
fields.size(); ++j) {
Kinesis::Lattice3D lattice
bool is_consistent() const
Check that every field is densely populated over the lattice.
const VolumeField * find(const std::string &name) const
Resolve a field by name.
size_t cell_count() const
Cells in the lattice, which every field's element_count() must equal.
std::vector< VolumeField > fields
A lattice and every field sampled over it, held in host memory.
std::vector< float > * as_scalar()
const std::vector< glm::vec3 > * as_vector() const
Kinesis::LatticeSemantics semantics
std::variant< std::vector< float >, std::vector< glm::vec3 > > ValueStorage
size_t byte_size() const
Total byte size of value storage, dispatched on variant.
const std::vector< float > * as_scalar() const
Typed accessors.
const void * data() const
Raw data pointer, dispatched on variant.
bool is_vector() const
Whether the active variant holds vectors rather than scalars.
std::vector< glm::vec3 > * as_vector()
size_t element_count() const
Number of cells represented, dispatched on variant.
One named quantity sampled over a lattice, held in host memory.
size_t cell_count() const noexcept
Total cell count.
A regular subdivision of an AABB3D into a cell count per axis.
Interpretation attached to one named quantity sampled over a lattice.