0.2.0
Loading...
Searching...
No Matches
Colormap.hpp File Reference

Colormap. More...

Go to the source code of this file.

Classes

class  NAV::Colormap
 Colormap class. More...
 

Enumerations

enum class  NAV::ColormapMaskType : int {
  None ,
  Global ,
  Flow
}
 Type of the Colormap mask. More...
 

Functions

bool NAV::ColormapButton (const char *label, Colormap &cmap, const ImVec2 &size_arg)
 Display a colormap button.
 
std::optional< std::reference_wrapper< const Colormap > > NAV::ColormapSearch (const ColormapMaskType &type, const int64_t &id)
 Searches for the colormap in the Global and Flow colormaps.
 
void NAV::from_json (const json &j, Colormap &cmap)
 Converts the provided json object into a struct.
 
bool NAV::ShowColormapSelector (ColormapMaskType &type, int64_t &id, const char *label="")
 Shows a combobox to select a colormap.
 
void NAV::to_json (json &j, const Colormap &cmap)
 Converts the provided object into a json object.
 

Variables

std::vector< ColormapNAV::ColormapsFlow
 Flow colormaps.
 
std::vector< ColormapNAV::ColormapsGlobal
 Global colormaps.
 

Detailed Description

Enumeration Type Documentation

◆ ColormapMaskType

enum class NAV::ColormapMaskType : int
strong

Type of the Colormap mask.

Enumerator
None 

Do not use a colormap mask.

Global 

Use the global colormap.

Flow 

Use the flow colormap.

Function Documentation

◆ ColormapButton()

bool NAV::ColormapButton ( const char * label,
Colormap & cmap,
const ImVec2 & size_arg )

Display a colormap button.

Parameters
[in]labelLabel to display on the button (unique id for ImGui)
[in,out]cmapColormap to show on the button and edit in the popup
[in]size_argSize of the button
Returns
True if clicked
Note
Code from Implot library

◆ ColormapSearch()

std::optional< std::reference_wrapper< const Colormap > > NAV::ColormapSearch ( const ColormapMaskType & type,
const int64_t & id )

Searches for the colormap in the Global and Flow colormaps.

Parameters
typeType of the colormap (global or flow)
idId of the colormap
Returns
The colormap if one could be found

◆ from_json()

void NAV::from_json ( const json & j,
Colormap & cmap )

Converts the provided json object into a struct.

Parameters
[in]jJson object with the vector values
[out]cmapStruct to return

◆ ShowColormapSelector()

bool NAV::ShowColormapSelector ( ColormapMaskType & type,
int64_t & id,
const char * label = "" )

Shows a combobox to select a colormap.

Parameters
[in,out]typeType of the selected colormap
[in,out]idId of the selected colormap
[in]labelUnique ImGui Id
Returns
True if a change was made

◆ to_json()

void NAV::to_json ( json & j,
const Colormap & cmap )

Converts the provided object into a json object.

Parameters
[out]jReturn Json object
[in]cmapColormap to convert