Main MRPT website > C++ reference for MRPT 1.9.9
TColorManager.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #ifndef TCOLORMANAGER_H
11 #define TCOLORMANAGER_H
12 
13 #include <mrpt/utils/TColor.h>
14 #include <mrpt/utils/mrpt_macros.h>
15 #include <utility>
16 #include <set>
17 #include <cstdlib>
18 #include <iostream>
19 
20 namespace mrpt
21 {
22 namespace utils
23 {
24 // TODO - finish this.
25 /**\brief Manage R, G, B color triads and ask class instance of the next
26  * unique RGB combination.
27  */
29 {
30  public:
31  /**\brief Constructor */
33  /**\brief Destructor */
35  /**\brief Get the next RGB triad in TColorf form.
36  *
37  * Method automatically advances the current counters for RGB.
38  */
40  /**\brief Get the next RGB triad in TColor form.
41  *
42  * Method automatically advances the current counters for RGB.
43  */
46  std::set<mrpt::utils::TColor> used_colors;
47  /** Indicates if the standard colors are to be returned first.
48  */
50  /** Indicates if the standard colors have already been used.
51  *
52  * This is a cached version of the value returned from the
53  * checkStdColorsUsed method.
54  *
55  * \note Standard colors are: red, green, blue
56  *
57  * \sa checkStdColorsUsed
58  */
60  /**\brief Check if the standard colors have already been used.
61  *
62  * \ret True if they have indeed been used.
63  */
64  bool checkStdColorsUsed();
65 
68 
70 
71  private:
72  // color triad with which to advance the current TColor instance
74 
75  /**\brief Reset all class properties to their default values
76  *
77  * Method called in the constructor of the class
78  */
79  void reset();
80  void advanceRGBCounters();
81  /**\brief Mark the given color as used. */
83 };
84 }
85 } // end of namespaces
86 
87 #endif /* end of include guard: TCOLORMANAGER_H */
std::set< mrpt::utils::TColor > used_colors
Definition: TColorManager.h:46
unsigned char uint8_t
Definition: rptypes.h:41
GLuint color
Definition: glext.h:8300
Manage R, G, B color triads and ask class instance of the next unique RGB combination.
Definition: TColorManager.h:28
mrpt::utils::TColorf getNextTColorf()
Get the next RGB triad in TColorf form.
bool checkStdColorsUsed()
Check if the standard colors have already been used.
A RGB color - 8bit.
Definition: TColor.h:25
bool have_used_standard_colors
Indicates if the standard colors have already been used.
Definition: TColorManager.h:59
mrpt::utils::TColor color_step_triad
Definition: TColorManager.h:73
void reset()
Reset all class properties to their default values.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
mrpt::utils::TColor curr_color
Definition: TColorManager.h:45
A RGB color - floats in the range [0,1].
Definition: TColor.h:78
mrpt::utils::TColor getNextTColor()
Get the next RGB triad in TColor form.
void markColorAsUsed(mrpt::utils::TColor color)
Mark the given color as used.
bool use_standard_colors_first
Indicates if the standard colors are to be returned first.
Definition: TColorManager.h:49
TColorManager(bool use_standard_colors_first=true)
Constructor.



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019