NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
CellValueShader Class Reference

A class to handle value-based cell shading using a custom colorscheme and custom conditions. More...

#include <cellvalueshader.hpp>

Collaboration diagram for CellValueShader:

Public Member Functions

 CellValueShader ()
 
 CellValueShader (const std::vector< wxColour > &colors, const CellValueShaderCondition &cond)
 
 CellValueShader (const CellValueShader &shader)
 
bool isActive () const
 Detect, whether this shader is actually active or an empty shader. More...
 
wxColour getColour (const mu::value_type &val) const
 Calculate the colour for a numerical value. More...
 
wxColour getColour (const wxString &strVal) const
 Calulate the colour for a string value. More...
 

Private Member Functions

wxColour interpolateColor (double val, bool excl) const
 Calculate the cell background colour depending on their value and using linear interpolation. More...
 

Private Attributes

std::vector< wxColour > m_colorArray
 
CellValueShaderCondition m_condition
 

Detailed Description

A class to handle value-based cell shading using a custom colorscheme and custom conditions.

Definition at line 70 of file cellvalueshader.hpp.

Constructor & Destructor Documentation

◆ CellValueShader() [1/3]

CellValueShader::CellValueShader ( )
inline

Definition at line 112 of file cellvalueshader.hpp.

◆ CellValueShader() [2/3]

CellValueShader::CellValueShader ( const std::vector< wxColour > &  colors,
const CellValueShaderCondition cond 
)
inline

Definition at line 113 of file cellvalueshader.hpp.

◆ CellValueShader() [3/3]

CellValueShader::CellValueShader ( const CellValueShader shader)
inline

Definition at line 114 of file cellvalueshader.hpp.

Member Function Documentation

◆ getColour() [1/2]

◆ getColour() [2/2]

wxColour CellValueShader::getColour ( const wxString &  strVal) const
inline

◆ interpolateColor()

wxColour CellValueShader::interpolateColor ( double  val,
bool  excl 
) const
inlineprivate

Calculate the cell background colour depending on their value and using linear interpolation.

Parameters
valdouble
exclbool
Returns
wxColour

Definition at line 86 of file cellvalueshader.hpp.

References date::floor(), mu::isinf(), mu::isnan(), and m_colorArray.

Referenced by getColour().

Here is the call graph for this function:

◆ isActive()

bool CellValueShader::isActive ( ) const
inline

Detect, whether this shader is actually active or an empty shader.

Returns
bool

Definition at line 123 of file cellvalueshader.hpp.

References m_colorArray.

Referenced by AdvStringCellRenderer::hasCustomColor().

Member Data Documentation

◆ m_colorArray

std::vector<wxColour> CellValueShader::m_colorArray
private

Definition at line 73 of file cellvalueshader.hpp.

Referenced by getColour(), interpolateColor(), and isActive().

◆ m_condition

CellValueShaderCondition CellValueShader::m_condition
private

Definition at line 74 of file cellvalueshader.hpp.

Referenced by getColour().


The documentation for this class was generated from the following file: