Carna Version 3.3.3
Loading...
Searching...
No Matches
RotatingColor.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2015 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 */
11
12#ifndef ROTATINGCOLOR_H_6014714286
13#define ROTATINGCOLOR_H_6014714286
14
19#include <Carna/Carna.h>
20#include <Carna/base/Color.h>
21
22namespace Carna
23{
24
25namespace base
26{
27
28
29
30// ----------------------------------------------------------------------------------
31// RotatingColor
32// ----------------------------------------------------------------------------------
33
40class CARNA_LIB RotatingColor
41{
42
43public:
44
49 {
50 blue = ( 1 << 0 ),
51 green = ( 1 << 1 ),
52 red = ( 1 << 2 ),
53
54 orange = red | green,
55 teal = green | blue,
56 violet = red | blue,
57 white = red | green | blue
58 };
59
63 RotatingColor( ColorIdentifier initialColor = blue );
64
69
74
79 {
81 ++( *this );
82 return rc;
83 }
84
88 operator const Color&() const
89 {
90 return color;
91 }
92
96 void reset();
97
98private:
99
100 unsigned int nextColor;
101 Color color;
102
103}; // RotatingColor
104
105
106
107} // namespace Carna :: base
108
109} // namespace Carna
110
111#endif // ROTATINGCOLOR_H_6014714286
Defines Carna::base::Color.
Represents an association.
Definition Association.h:45
Represents a color. Objects from this class are copyable and assignable.
Definition Color.h:42
Supplies colors from a predefined, distinctive palette.
void reset()
Resets s.t. the current color becomes the initial again.
RotatingColor & operator++()
Pre-increments the color.
const ColorIdentifier initialColor
Holds the initial color.
RotatingColor operator++(int)
Post-increments the color.
ColorIdentifier
Identifies supported colors.
RotatingColor(ColorIdentifier initialColor=blue)
Instantiates.