18 std::string_view param,
19 const std::shared_ptr<NodeNetwork>& source)
23 if (source->get_node_count() != point_count) {
27 if (param ==
"color") {
28 for (
size_t i = 0; i < point_count; ++i) {
29 auto val = source->get_node_output(i);
35 float normalized = glm::clamp(
static_cast<float>(*val), 0.0F, 1.0F);
36 point->color = glm::vec3(normalized, 0.5F, 1.0F - normalized);
39 }
else if (param ==
"size") {
40 for (
size_t i = 0; i < point_count; ++i) {
41 auto val = source->get_node_output(i);
47 point->size = glm::clamp(
static_cast<float>(*val) * 10.0F, 1.0F, 50.0F);
virtual void * get_data_at(size_t global_index)=0
Get mutable access to point at global index.
void apply_one_to_one(std::string_view param, const std::shared_ptr< NodeNetwork > &source) override
Apply ONE_TO_ONE parameter mapping.
virtual size_t get_point_count() const =0
Get source point count (before topology expansion)
virtual size_t get_vertex_count() const =0
Get number of vertices (may differ from point count for topology/path)
virtual std::optional< Portal::Graphics::PrimitiveTopology > declared_topology() const
Topology this operator's vertex data is authored for, if it holds a node to ask.
virtual std::vector< DrawRun > topology_runs() const
Contiguous vertex spans grouped by primitive topology.
Vertex type for point primitives (POINT_LIST topology)
PrimitiveTopology topology
One contiguous span of vertices sharing a primitive topology.