LibCarna Version 3.4.0
Loading...
Searching...
No Matches
RotatingColor.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2016 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 *
11 * Copyright (C) 2021 - 2025 Leonid Kostrykin
12 *
13 */
14
15#ifndef ROTATINGCOLOR_H_6014714286
16#define ROTATINGCOLOR_H_6014714286
17
23#include <LibCarna/LibCarna.hpp>
25
26namespace LibCarna
27{
28
29namespace base
30{
31
32
33
34// ----------------------------------------------------------------------------------
35// RotatingColor
36// ----------------------------------------------------------------------------------
37
43class LIBCARNA RotatingColor
44{
45
46public:
47
52 {
53 blue = ( 1 << 0 ),
54 green = ( 1 << 1 ),
55 red = ( 1 << 2 ),
56
57 orange = red | green,
58 teal = green | blue,
59 violet = red | blue,
60 white = red | green | blue
61 };
62
66 RotatingColor( ColorIdentifier initialColor = blue );
67
72
77
82 {
84 ++( *this );
85 return rc;
86 }
87
91 operator const Color&() const
92 {
93 return color;
94 }
95
99 void reset();
100
101private:
102
103 unsigned int nextColor;
104 Color color;
105
106}; // RotatingColor
107
108
109
110} // namespace LibCarna :: base
111
112} // namespace LibCarna
113
114#endif // ROTATINGCOLOR_H_6014714286
Defines LibCarna::base::Color.
Contains forward-declarations.
Represents an association.
Represents a color. Objects from this class are copyable and assignable.
Definition Color.hpp:45
Supplies colors from a predefined, distinctive palette.
RotatingColor & operator++()
Pre-increments the color.
const ColorIdentifier initialColor
Holds the initial color.
RotatingColor operator++(int)
Post-increments the color.
RotatingColor(ColorIdentifier initialColor=blue)
Instantiates.
void reset()
Resets s.t. the current color becomes the initial again.
ColorIdentifier
Identifies supported colors.