MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Survey.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace MayaFlux::Buffers {
6class VKBuffer;
7}
8
9namespace MayaFlux::Nexus {
10
11/**
12 * @brief Anchor of a buffer's geometry in its own stored coordinates.
13 *
14 * The position of the vertex at @p index, else the surface centroid, else the
15 * vertex mean for a mesh without faces. A point or path buffer reports the mean of
16 * its vertices; an InstanceNetworkBuffer, with no index, the centre of its bounds.
17 * Blocks for a ComputeMeshBuffer and for a buffer a field processor drives.
18 *
19 * @param buf Buffer to read.
20 * @param index Vertex to anchor at, if any.
21 * @return The anchor, or nullopt when no geometry can be read from the buffer.
22 */
23MAYAFLUX_API std::optional<glm::vec3> read_anchor(
24 const std::shared_ptr<Buffers::VKBuffer>& buf,
25 const std::optional<uint32_t>& index);
26
27/**
28 * @brief Bounds of a buffer's geometry in its own stored coordinates.
29 *
30 * A VolumeGridBuffer reports its lattice bounds. A NetworkGeometryBuffer reports
31 * its vertices, or those of one collection. The primary operator only knows the
32 * authored positions and the CPU updates it dispatched, so once the chain holds a
33 * GpuFieldOperator the bytes are downloaded from the device instead, as the spatial
34 * export does; before the device buffer exists the operator's bytes are used. A
35 * GeometryBuffer on a node other than a MeshWriterNode, a point or path node for
36 * example, reports the node's own vertices, downloaded from the device when a
37 * VertexFieldProcessor is on the buffer. An InstanceNetworkBuffer reports the union
38 * of its slots' bounds through the slot transforms as the CPU holds them; the eight
39 * corners are placed, so a rotated slot is bounded loosely, and a transform a GPU
40 * kernel drives is not seen. Other mesh buffers are read as read_anchor reads them.
41 * Blocks for a ComputeMeshBuffer and for a buffer a field processor drives: call it
42 * from a FRAME_ACCURATE metro or the main thread, never the graphics thread.
43 *
44 * @param buf Buffer to read.
45 * @param collection Collection of a NetworkGeometryBuffer to bound, if not all of it.
46 * Ignored for other buffers.
47 * @return The bounds, or nullopt when no geometry can be read from the buffer.
48 */
49MAYAFLUX_API std::optional<Kinesis::AABB3D> read_bounds(
50 const std::shared_ptr<Buffers::VKBuffer>& buf,
51 const std::optional<uint32_t>& collection = std::nullopt);
52
53/**
54 * @brief Where a buffer is drawn: the geometry transform of its primary render processor.
55 *
56 * The transform source if it has one, else the static transform, else identity.
57 * Takes stored coordinates to drawn coordinates.
58 *
59 * @param buf Buffer to read.
60 */
61MAYAFLUX_API glm::mat4 read_placement(const std::shared_ptr<Buffers::VKBuffer>& buf);
62
63} // namespace MayaFlux::Nexus
uint32_t index
Definition VKDevice.cpp:122
glm::mat4 read_placement(const std::shared_ptr< Buffers::VKBuffer > &buf)
Where a buffer is drawn: the geometry transform of its primary render processor.
Definition Survey.cpp:303
std::optional< glm::vec3 > read_anchor(const std::shared_ptr< Buffers::VKBuffer > &buf, const std::optional< uint32_t > &index)
Anchor of a buffer's geometry in its own stored coordinates.
Definition Survey.cpp:213
std::optional< Kinesis::AABB3D > read_bounds(const std::shared_ptr< Buffers::VKBuffer > &buf, const std::optional< uint32_t > &collection)
Bounds of a buffer's geometry in its own stored coordinates.
Definition Survey.cpp:256