MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ vertex_form()

MAYAFLUX_API Geometry::Form< std::monostate > MayaFlux::Portal::Forma::vertex_form ( const VertexGeometryInputs & input)
nodiscard

A Form with no state that draws ordered vertices exactly as written.

Positions are NDC, as Forma::slice and submit take them, so nothing maps them. The hit region is derived from the vertices: inside the triangles for triangle topologies, the circumscribing box otherwise.

Definition at line 61 of file StaticGeometry.cpp.

62{
63 std::vector<glm::vec2> positions;
64 positions.reserve(input.vertices.size());
65 for (const Kakshya::Vertex& vertex : input.vertices)
66 positions.emplace_back(vertex.position.x, vertex.position.y);
67
68 const Containment hit = containment_of(positions, input.topology);
69 const size_t capacity = input.vertices.size() * sizeof(Kakshya::Vertex);
71 [vertices = input.vertices](const std::monostate&, std::vector<uint8_t>& out) {
72 Geometry::write_verts(out, vertices);
73 },
74 hit);
75 return Geometry::Form<std::monostate> { std::move(fn), input.topology, capacity };
76}
GeometryFn< T > geometry_with_containment(std::function< void(const T &, std::vector< uint8_t > &)> draw, Containment region)
A geometry function that draws a value and claims a fixed containment.
Kinesis::HitRegion2D Containment
The spatial fields of an Element as one value: Kinesis::HitRegion2D.
Containment containment_of(std::span< const glm::vec2 > positions, Graphics::PrimitiveTopology topology)
Hit region derived from placed vertex positions.
Type-neutral vertex carrying the universal 68-byte attribute layout.
A geometry function plus everything its realization requires.
Definition Geometry.hpp:83

References containment_of(), geometry_with_containment(), MayaFlux::Kakshya::Vertex::position, MayaFlux::Portal::Forma::VertexGeometryInputs::topology, and MayaFlux::Portal::Forma::VertexGeometryInputs::vertices.

Referenced by vertex_geometry_form(), and MayaFlux::Portal::Forma::Detail::DocumentWalk< Source, Access >::vertex_placer().

Here is the call graph for this function:
Here is the caller graph for this function: