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

◆ add_segment_to_region()

void MayaFlux::Kakshya::RegionOrganizationProcessor::add_segment_to_region ( const std::string &  group_name,
size_t  region_index,
const std::vector< uint64_t > &  start_coords,
const std::vector< uint64_t > &  end_coords,
const std::unordered_map< std::string, std::any > &  attributes 
)

Adds a segment to an existing region.

Parameters
group_nameName of the group containing the region.
region_indexIndex of the region within the group.
start_coordsStarting coordinates of the segment.
end_coordsEnding coordinates of the segment.
attributesArbitrary metadata for the segment.

Definition at line 87 of file RegionProcessors.cpp.

92{
93 auto region_it = std::ranges::find_if(m_organized_regions, [&](const OrganizedRegion& region) {
94 return region.group_name == group_name && region.region_index == region_index;
95 });
96
97 if (region_it != m_organized_regions.end()) {
98 Region region(start_coords, end_coords, attributes);
99 RegionSegment segment(region);
100
101 region_it->segments.push_back(std::move(segment));
102
103 if (auto container = m_container_weak.lock()) {
104 cache_region_if_needed(region_it->segments.back(), container);
105 }
106 }
107}
virtual void cache_region_if_needed(const RegionSegment &segment, const std::shared_ptr< SignalSourceContainer > &container)
Cache a region's data if beneficial and not already cached.
std::vector< OrganizedRegion > m_organized_regions
std::weak_ptr< SignalSourceContainer > m_container_weak

References MayaFlux::Kakshya::RegionProcessorBase::cache_region_if_needed(), MayaFlux::Kakshya::OrganizedRegion::group_name, MayaFlux::Kakshya::RegionProcessorBase::m_container_weak, MayaFlux::Kakshya::RegionProcessorBase::m_organized_regions, and MayaFlux::Kakshya::OrganizedRegion::region_index.

+ Here is the call graph for this function: