MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / aggregate

Method aggregate

source/MRMesh/MRColorMapAggregator.cpp:87–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85
86template<typename Tag>
87typename ColorMapAggregator<Tag>::ColorMap ColorMapAggregator<Tag>::aggregate( const ElementBitSet& elementBitSet )
88{
89 if ( elementBitSet.none() )
90 return {};
91 int last = elementBitSet.find_last();
92 if ( needUpdate_ )
93 updateAggregated_( last + 1 );
94 else if ( last >= aggregatedColorMap_.size() )
95 aggregatedColorMap_.resize( last + 1, defaultColor_ );
96
97 ColorMap res( elementBitSet.size() );
98 for ( const auto& e : elementBitSet )
99 res[e] = aggregatedColorMap_[e];
100
101 return res;
102}
103
104template<typename Tag>
105bool ColorMapAggregator<Tag>::checkInputData_( const PartialColorMap& partitialColorMap )

Callers 1

TESTFunction · 0.80

Calls 4

noneMethod · 0.80
find_lastMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45

Tested by 1

TESTFunction · 0.64