Main MRPT website > C++ reference for MRPT 1.5.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 { namespace utils {
21 
22 // TODO - finish this.
23 /**\brief Manage R, G, B color triads and ask class instance of the next
24  * unique RGB combination.
25  */
26 struct TColorManager {
27  public:
28 
29  /**\brief Constructor */
31  bool use_standard_colors_first=true);
32  /**\brief Destructor */
34  /**\brief Get the next RGB triad in TColorf form.
35  *
36  * Method automatically advances the current counters for RGB.
37  */
39  /**\brief Get the next RGB triad in TColor form.
40  *
41  * Method automatically advances the current counters for RGB.
42  */
45  std::set<mrpt::utils::TColor> used_colors;
46  /** Indicates if the standard colors are to be returned first.
47  */
49  /** Indicates if the standard colors have already been used.
50  *
51  * This is a cached version of the value returned from the
52  * checkStdColorsUsed method.
53  *
54  * \note Standard colors are: red, green, blue
55  *
56  * \sa checkStdColorsUsed
57  */
59  /**\brief Check if the standard colors have already been used.
60  *
61  * \ret True if they have indeed been used.
62  */
63  bool checkStdColorsUsed();
64 
67 
69 
70  private:
71  // color triad with which to advance the current TColor instance
73 
74  /**\brief Reset all class properties to their default values
75  *
76  * Method called in the constructor of the class
77  */
78  void reset();
79  void advanceRGBCounters();
80  /**\brief Mark the given color as used. */
82 };
83 
84 } } // end of namespaces
85 
86 #endif /* end of include guard: TCOLORMANAGER_H */
std::set< mrpt::utils::TColor > used_colors
Definition: TColorManager.h:45
unsigned char uint8_t
Definition: rptypes.h:43
GLuint color
Definition: glext.h:7093
Manage R, G, B color triads and ask class instance of the next unique RGB combination.
Definition: TColorManager.h:26
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:26
bool have_used_standard_colors
Indicates if the standard colors have already been used.
Definition: TColorManager.h:58
mrpt::utils::TColor color_step_triad
Definition: TColorManager.h:72
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:44
A RGB color - floats in the range [0,1].
Definition: TColor.h:80
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:48
TColorManager(bool use_standard_colors_first=true)
Constructor.



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020