Carna  Version 3.3.2
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 
22 namespace Carna
23 {
24 
25 namespace base
26 {
27 
28 
29 
30 // ----------------------------------------------------------------------------------
31 // RotatingColor
32 // ----------------------------------------------------------------------------------
33 
40 class CARNA_LIB RotatingColor
41 {
42 
43 public:
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 
73  RotatingColor& operator++();
74 
79  {
80  RotatingColor rc = RotatingColor( *this );
81  ++( *this );
82  return rc;
83  }
84 
88  operator const Color&() const
89  {
90  return color;
91  }
92 
96  void reset();
97 
98 private:
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
Supplies colors from a predefined, distinctive palette.
Definition: RotatingColor.h:40
ColorIdentifier
Identifies supported colors.
Definition: RotatingColor.h:48
RotatingColor operator++(int)
Post-increments the color.
Definition: RotatingColor.h:78
Represents a color. Objects from this class are copyable and assignable.
Definition: Color.h:41
Defines Carna::base::Color.
const ColorIdentifier initialColor
Holds the initial color.
Definition: RotatingColor.h:68