MeshLib C++ Docs
Loading...
Searching...
No Matches
MRColorMapAggregator.h
Go to the documentation of this file.
1#pragma once
2#include "MRMeshFwd.h"
3#include "MRVector.h"
4#include "MRColor.h"
5#include "MRId.h"
6#include "MRBitSet.h"
7
8
9namespace MR
10{
13
18template<typename Tag>
20{
21public:
23 using ElementBitSet = TaggedBitSet<Tag>;
24
25 ColorMapAggregator() = default;
26
28 MRMESH_API void setDefaultColor( const Color& color );
29
36
38 MRMESH_API void pushBack( const PartialColorMap& partitialColorMap );
39
41 MRMESH_API void insert( int i, const PartialColorMap& partitialColorMap );
42
44 MRMESH_API void replace( int i, const PartialColorMap& partitialColorMap );
45
47 MRMESH_API void reset();
48
50 size_t getColorMapNumber() { return dataSet_.size(); };
51
53 const PartialColorMap& getPartialColorMap( int i ) { return dataSet_[i]; }
54
56 MRMESH_API void erase( int i, int n = 1 );
57
59 enum class AggregateMode
60 {
61 Overlay,
63 };
64
66 MRMESH_API void setMode( AggregateMode mode );
67
69 MRMESH_API ColorMap aggregate( const ElementBitSet& elementBitSet );
70private:
71 Color defaultColor_;
72
73 std::vector<PartialColorMap> dataSet_;
74
75 ColorMap aggregatedColorMap_;
76 bool needUpdate_{ true };
78
80 bool checkInputData_( const PartialColorMap& partitialColorMap );
81 void updateAggregated_( int newSize );
82};
83
84}
Class for aggregate several color map in one Color maps are aggregated according order.
Definition MRColorMapAggregator.h:20
MRMESH_API void setDefaultColor(const Color &color)
set default (background) color
TaggedBitSet< Tag > ElementBitSet
Definition MRColorMapAggregator.h:23
const PartialColorMap & getPartialColorMap(int i)
get partial color map map by index
Definition MRColorMapAggregator.h:53
size_t getColorMapNumber()
get number of accumulated color maps
Definition MRColorMapAggregator.h:50
MRMESH_API void pushBack(const PartialColorMap &partitialColorMap)
add color map after all (more priority)
ColorMap colorMap
Definition MRColorMapAggregator.h:33
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
ColorMapAggregator()=default
AggregateMode
color map aggregating mode
Definition MRColorMapAggregator.h:60
MRMESH_API void insert(int i, const PartialColorMap &partitialColorMap)
insert color map before element #i (0 - minimum priority)
ElementBitSet elements
color map
Definition MRColorMapAggregator.h:34
MRMESH_API void replace(int i, const PartialColorMap &partitialColorMap)
replace color map in #i position
MRMESH_API void reset()
reset all accumulated color map
@ Blending
result element color is element color of more priority color map (or default color,...
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
partial color map
Definition MRColorMapAggregator.h:32
Definition MRColor.h:12