cee::vis::OverlayCategoryLegend
-
class OverlayCategoryLegend : public OverlayItem
A color legend used to indicate the interpretation of the colors in the model.
For instance, a part color legend.
Any number of combinations of label and color can be specified.
See also
OverlayItem and View
Public Types
-
enum TickMarksPosition
Position of the legend tick marks.
Values:
-
enumerator LEFT
Draw tick marks on the left side of the color legend.
-
enumerator RIGHT
Draw tick marks on the right side of the color legend.
-
enumerator TOP
Draw tick marks above the color legend.
-
enumerator BOTTOM
Draw tick marks below the color legend.
-
enumerator FOLLOW_LAYOUT
Automatically position the tick marks left or right based on the color legend’s alignment in the view.
-
enumerator LEFT
Public Functions
-
OverlayCategoryLegend()
Constructs an overlay category legend.
-
OverlayCategoryLegend(Font *titleFont, Font *categoryFont)
Constructs an overlay category legend with custom fonts.
-
void setWidthToFitText()
Sets the width of the legend to fit the current text.
-
size_t categoryCount() const
Returns the number of categories.
-
void removeAllCategories()
Removes all categories from the legend.
-
void setTitle(const Str &title)
Sets the title of the legend.
Multiple lines can be specified by using the ‘\n’ separator
-
void setTextColor(const Color3f &color)
Sets the text color for the category labels. Also sets the border color for the category bar.
-
TickMarksPosition tickMarksPosition() const
Returns if the labels are drawn on the left side, right side or automatically based on view layout.
-
void setTickMarksPosition(TickMarksPosition position)
If set to true, the category colors will be drawn on the right side and the text will be right aligned on the left side.
-
bool drawBackground() const
Sets if a background should be drawn for the legend.
-
void setDrawBackground(bool drawBackground)
Returns true if a background is drawn for the legend.
-
void setBackgroundColor(const Color3f &color)
Sets the color of the legend background.
The legend does not draw the background by default. Set setDrawBackground(true) to draw a background behind the legend. This is useful when you need to improve the contrast between the tick value labels and the background. The background opacity is set using setBackgroundOpacity().
-
float backgroundOpacity() const
Returns the opacity of the legend background.
-
void setBackgroundOpacity(float opacity)
Sets the legend background opacity.
The legend does not draw the background by default. Set setDrawLegendBackground(true) to draw a background behind the legend.
-
enum TickMarksPosition