MeshLib Documentation
Loading...
Searching...
No Matches
MR::ColorMapAggregator< Tag > Class Template Reference

Class for aggregate several color map in one Color maps are aggregated according order. More...

#include <MRColorMapAggregator.h>

Classes

struct  PartialColorMap
 partial color map More...
 

Public Types

enum class  AggregateMode { Overlay , Blending }
 color map aggregating mode More...
 
using ColorMap = Vector<Color, Id<Tag>>
 
using ElementBitSet = TaggedBitSet<Tag>
 

Public Member Functions

 ColorMapAggregator ()=default
 
MRMESH_API void setDefaultColor (const Color &color)
 set default (background) color
 
MRMESH_API void pushBack (const PartialColorMap &partitialColorMap)
 add color map after all (more priority)
 
MRMESH_API void insert (int i, const PartialColorMap &partitialColorMap)
 insert color map before element #i (0 - minimum priority)
 
MRMESH_API void replace (int i, const PartialColorMap &partitialColorMap)
 replace color map in #i position
 
MRMESH_API void reset ()
 reset all accumulated color map
 
size_t getColorMapNumber ()
 get number of accumulated color maps
 
const PartialColorMapgetPartialColorMap (int i)
 get partial color map map by index
 
MRMESH_API void erase (int i, int n=1)
 erase n color map from #i
 
MRMESH_API void setMode (AggregateMode mode)
 set color map aggregating mode
 
MRMESH_API ColorMap aggregate (const ElementBitSet &elementBitSet)
 get aggregated color map for active elements
 

Detailed Description

template<typename Tag>
class MR::ColorMapAggregator< Tag >

Class for aggregate several color map in one Color maps are aggregated according order.

Member Typedef Documentation

◆ ColorMap

template<typename Tag >
using MR::ColorMapAggregator< Tag >::ColorMap = Vector<Color, Id<Tag>>

◆ ElementBitSet

template<typename Tag >
using MR::ColorMapAggregator< Tag >::ElementBitSet = TaggedBitSet<Tag>

Member Enumeration Documentation

◆ AggregateMode

template<typename Tag >
enum class MR::ColorMapAggregator::AggregateMode
strong

color map aggregating mode

Enumerator
Overlay 
Blending 

result element color is element color of more priority color map (or default color, if there isn't color map for this element)

result element color is blending colors of all color map in this element and default color (https://en.wikipedia.org/wiki/Alpha_compositing)

Constructor & Destructor Documentation

◆ ColorMapAggregator()

template<typename Tag >
MR::ColorMapAggregator< Tag >::ColorMapAggregator ( )
default

Member Function Documentation

◆ aggregate()

template<typename Tag >
MRMESH_API ColorMap MR::ColorMapAggregator< Tag >::aggregate ( const ElementBitSet & elementBitSet)

get aggregated color map for active elements

◆ erase()

template<typename Tag >
MRMESH_API void MR::ColorMapAggregator< Tag >::erase ( int i,
int n = 1 )

erase n color map from #i

◆ getColorMapNumber()

template<typename Tag >
size_t MR::ColorMapAggregator< Tag >::getColorMapNumber ( )
inline

get number of accumulated color maps

◆ getPartialColorMap()

template<typename Tag >
const PartialColorMap & MR::ColorMapAggregator< Tag >::getPartialColorMap ( int i)
inline

get partial color map map by index

◆ insert()

template<typename Tag >
MRMESH_API void MR::ColorMapAggregator< Tag >::insert ( int i,
const PartialColorMap & partitialColorMap )

insert color map before element #i (0 - minimum priority)

◆ pushBack()

template<typename Tag >
MRMESH_API void MR::ColorMapAggregator< Tag >::pushBack ( const PartialColorMap & partitialColorMap)

add color map after all (more priority)

◆ replace()

template<typename Tag >
MRMESH_API void MR::ColorMapAggregator< Tag >::replace ( int i,
const PartialColorMap & partitialColorMap )

replace color map in #i position

◆ reset()

template<typename Tag >
MRMESH_API void MR::ColorMapAggregator< Tag >::reset ( )

reset all accumulated color map

◆ setDefaultColor()

template<typename Tag >
MRMESH_API void MR::ColorMapAggregator< Tag >::setDefaultColor ( const Color & color)

set default (background) color

◆ setMode()

template<typename Tag >
MRMESH_API void MR::ColorMapAggregator< Tag >::setMode ( AggregateMode mode)

set color map aggregating mode


The documentation for this class was generated from the following file: