Colormap class.
More...
|
| void | addColor (double value, ImColor color) |
| | Add a color with value.
|
| | Colormap () |
| | Constructor.
|
| ImColor | getColor (double value, const ImColor &defaultColor) const |
| | Gets the color for the given value.
|
| const std::vector< std::pair< double, ImColor > > & | getColormap () const |
| | Return the map.
|
| int64_t | getId () const |
| | Return the id of the colormap.
|
| void | removeColor (size_t idx) |
| | Remove the entry at the index (if past the last index or empty, NoOp)
|
|
| bool | discrete |
| | Whether to have discrete changes of the colors or continuous.
|
| std::string | name |
| | Name of the Colormap.
|
| size_t | version |
| | Version, to tell nodes that the colormap was updated.
|
|
| void | render () const |
| | Renders the colormap.
|
| void | render (const ImRect &bounds) const |
| | Renders the colormap.
|
|
| std::vector< std::pair< double, ImColor > > | colormap |
| | Sorted list of value/color combinations (value is active if lookup is greater or equal)
|
| int64_t | id |
| | Unique id of the colormap.
|
Colormap class.
Definition at line 47 of file Colormap.hpp.
◆ Colormap()
| NAV::Colormap::Colormap |
( |
| ) |
|
◆ addColor()
| void NAV::Colormap::addColor |
( |
double | value, |
|
|
ImColor | color ) |
Add a color with value.
- Parameters
-
Definition at line 36 of file Colormap.cpp.
◆ getColor()
| ImColor NAV::Colormap::getColor |
( |
double | value, |
|
|
const ImColor & | defaultColor ) const |
|
nodiscard |
Gets the color for the given value.
- Parameters
-
| [in] | value | Value to look for |
| [in] | defaultColor | Default color to display if no enty in the colormap matches |
- Returns
- The color for the value or the given defaultColor if nothing matches
Definition at line 51 of file Colormap.cpp.
◆ getColormap()
| const std::vector< std::pair< double, ImColor > > & NAV::Colormap::getColormap |
( |
| ) |
const |
|
nodiscard |
◆ getId()
| int64_t NAV::Colormap::getId |
( |
| ) |
const |
|
nodiscard |
Return the id of the colormap.
Definition at line 73 of file Colormap.cpp.
◆ removeColor()
| void NAV::Colormap::removeColor |
( |
size_t | idx | ) |
|
Remove the entry at the index (if past the last index or empty, NoOp)
- Parameters
-
Definition at line 44 of file Colormap.cpp.
◆ render() [1/2]
| void NAV::Colormap::render |
( |
| ) |
const |
|
private |
Renders the colormap.
- Note
- Code from Implot library
Definition at line 83 of file Colormap.cpp.
◆ render() [2/2]
| void NAV::Colormap::render |
( |
const ImRect & | bounds | ) |
const |
|
private |
Renders the colormap.
- Parameters
-
| [in] | bounds | Bounds where to draw the rect |
- Note
- Code from Implot library
Definition at line 93 of file Colormap.cpp.
◆ from_json
Converts the provided json object into a struct.
- Parameters
-
| [in] | j | Json object with the vector values |
| [out] | cmap | Struct to return |
Definition at line 225 of file Colormap.cpp.
◆ NAV::ColormapButton
Display a colormap button.
- Parameters
-
| [in] | label | Label to display on the button (unique id for ImGui) |
| [in,out] | cmap | Colormap to show on the button and edit in the popup |
| [in] | size_arg | Size of the button |
- Returns
- True if clicked
- Note
- Code from Implot library
◆ to_json
Converts the provided object into a json object.
- Parameters
-
| [out] | j | Return Json object |
| [in] | cmap | Colormap to convert |
Definition at line 215 of file Colormap.cpp.
◆ colormap
| std::vector<std::pair<double, ImColor> > NAV::Colormap::colormap |
|
private |
Sorted list of value/color combinations (value is active if lookup is greater or equal)
Definition at line 82 of file Colormap.hpp.
◆ discrete
| bool NAV::Colormap::discrete |
Whether to have discrete changes of the colors or continuous.
Definition at line 75 of file Colormap.hpp.
◆ id
| int64_t NAV::Colormap::id |
|
private |
Unique id of the colormap.
Definition at line 80 of file Colormap.hpp.
◆ name
| std::string NAV::Colormap::name |
◆ version
| size_t NAV::Colormap::version |
Version, to tell nodes that the colormap was updated.
Definition at line 76 of file Colormap.hpp.
The documentation for this class was generated from the following files:
- /home/runner/work/INSTINCT/INSTINCT/src/util/Plot/Colormap.hpp
- /home/runner/work/INSTINCT/INSTINCT/src/util/Plot/Colormap.cpp