Manage R, G, B color triads and ask class instance of the next unique RGB combination.
Definition at line 26 of file TColorManager.h.
#include <mrpt/utils/TColorManager.h>
Public Member Functions | |
TColorManager (bool use_standard_colors_first=true) | |
Constructor. More... | |
~TColorManager () | |
Destructor. More... | |
mrpt::utils::TColorf | getNextTColorf () |
Get the next RGB triad in TColorf form. More... | |
mrpt::utils::TColor | getNextTColor () |
Get the next RGB triad in TColor form. More... | |
bool | checkStdColorsUsed () |
Check if the standard colors have already been used. More... | |
Public Attributes | |
mrpt::utils::TColor | curr_color |
std::set< mrpt::utils::TColor > | used_colors |
bool | use_standard_colors_first |
Indicates if the standard colors are to be returned first. More... | |
bool | have_used_standard_colors |
Indicates if the standard colors have already been used. More... | |
uint8_t | color_step |
const uint8_t | color_thresh |
bool | have_exceeded_colors |
Private Member Functions | |
void | reset () |
Reset all class properties to their default values. More... | |
void | advanceRGBCounters () |
void | markColorAsUsed (mrpt::utils::TColor color) |
Mark the given color as used. More... | |
Private Attributes | |
mrpt::utils::TColor | color_step_triad |
TColorManager::TColorManager | ( | bool | use_standard_colors_first = true | ) |
Constructor.
Definition at line 16 of file TColorManager.cpp.
References reset(), and use_standard_colors_first.
TColorManager::~TColorManager | ( | ) |
Destructor.
Definition at line 24 of file TColorManager.cpp.
|
private |
Definition at line 68 of file TColorManager.cpp.
References ASSERT_, mrpt::utils::TColor::B, mrpt::utils::TColor::blue, color_step, color_step_triad, curr_color, mrpt::utils::TColor::green, have_used_standard_colors, mrpt::utils::TColor::red, THROW_EXCEPTION, and use_standard_colors_first.
Referenced by getNextTColor().
bool TColorManager::checkStdColorsUsed | ( | ) |
Check if the standard colors have already been used.
True if they have indeed been used.
Definition at line 123 of file TColorManager.cpp.
References mrpt::utils::TColor::blue, mrpt::utils::TColor::green, mrpt::utils::TColor::red, and used_colors.
TColor TColorManager::getNextTColor | ( | ) |
Get the next RGB triad in TColor form.
Method automatically advances the current counters for RGB.
Definition at line 26 of file TColorManager.cpp.
References advanceRGBCounters(), mrpt::utils::TColor::blue, color_thresh, curr_color, mrpt::utils::TColor::green, have_exceeded_colors, have_used_standard_colors, markColorAsUsed(), mrpt::utils::TColor::red, use_standard_colors_first, and used_colors.
Referenced by getNextTColorf().
TColorf TColorManager::getNextTColorf | ( | ) |
Get the next RGB triad in TColorf form.
Method automatically advances the current counters for RGB.
Definition at line 64 of file TColorManager.cpp.
References getNextTColor().
Referenced by mrpt::graphs::detail::CMRVisualizer< CPOSE, MAPS_IMPLEMENTATION, TMRSlamNodeAnnotations, EDGE_ANNOTATIONS >::drawEdges(), and mrpt::graphs::detail::CMRVisualizer< CPOSE, MAPS_IMPLEMENTATION, TMRSlamNodeAnnotations, EDGE_ANNOTATIONS >::drawNodePoints().
|
private |
Mark the given color as used.
Definition at line 102 of file TColorManager.cpp.
References ASSERT_, and used_colors.
Referenced by getNextTColor().
|
private |
Reset all class properties to their default values.
Method called in the constructor of the class
Definition at line 112 of file TColorManager.cpp.
References color_step_triad, curr_color, have_exceeded_colors, have_used_standard_colors, use_standard_colors_first, and used_colors.
Referenced by TColorManager().
uint8_t mrpt::utils::TColorManager::color_step |
Definition at line 65 of file TColorManager.h.
Referenced by advanceRGBCounters().
|
private |
Definition at line 72 of file TColorManager.h.
Referenced by advanceRGBCounters(), and reset().
const uint8_t mrpt::utils::TColorManager::color_thresh |
Definition at line 66 of file TColorManager.h.
Referenced by getNextTColor().
mrpt::utils::TColor mrpt::utils::TColorManager::curr_color |
Definition at line 44 of file TColorManager.h.
Referenced by advanceRGBCounters(), getNextTColor(), and reset().
bool mrpt::utils::TColorManager::have_exceeded_colors |
Definition at line 68 of file TColorManager.h.
Referenced by getNextTColor(), and reset().
bool mrpt::utils::TColorManager::have_used_standard_colors |
Indicates if the standard colors have already been used.
This is a cached version of the value returned from the checkStdColorsUsed method.
Definition at line 58 of file TColorManager.h.
Referenced by advanceRGBCounters(), getNextTColor(), and reset().
bool mrpt::utils::TColorManager::use_standard_colors_first |
Indicates if the standard colors are to be returned first.
Definition at line 48 of file TColorManager.h.
Referenced by advanceRGBCounters(), getNextTColor(), reset(), and TColorManager().
std::set<mrpt::utils::TColor> mrpt::utils::TColorManager::used_colors |
Definition at line 45 of file TColorManager.h.
Referenced by checkStdColorsUsed(), getNextTColor(), markColorAsUsed(), and reset().
Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019 |