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

◆ apply_point_control()

void MayaFlux::Nodes::Network::GraphicsOperator::apply_point_control ( Control & control,
PointAttribute attribute )
protected

Write a control into every point's color or size when it is due.

For an operator whose data is PointVertex. A number or node applies to every point, and a network source gives one value per point and is skipped unless its node count matches the point count, as with apply_one_to_one.

Definition at line 61 of file GraphicsOperator.cpp.

62{
63 if (!control.due()) {
64 return;
65 }
66 control.settle();
67
68 const size_t point_count = get_point_count();
69 if (control.per_element() && control.element_count() != point_count) {
70 return;
71 }
72
73 for (size_t i = 0; i < point_count; ++i) {
74 const auto value = control.at(i);
75 if (!value) {
76 continue;
77 }
78 if (auto* point = static_cast<PointVertex*>(get_data_at(i))) {
79 write_point(*point, attribute, *value);
80 }
81 }
82}
virtual void * get_data_at(size_t global_index)=0
Get mutable access to point at global index.
virtual size_t get_point_count() const =0
Get source point count (before topology expansion).
Kakshya::PointVertex PointVertex
Definition VertexSpec.hpp:8

References MayaFlux::Nodes::Network::Control::at(), MayaFlux::Nodes::Network::Control::due(), MayaFlux::Nodes::Network::Control::element_count(), get_data_at(), get_point_count(), MayaFlux::Nodes::Network::Control::per_element(), and MayaFlux::ControlValue::settle().

Referenced by MayaFlux::Nodes::Network::PhysicsOperator::apply_controls(), and get_data_at().

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