Simox  2.3.74.0
VirtualRobot::ColorMap Class Reference

Data Structures

struct  ColorKey
 

Public Types

enum  type {
  eIntensity, eHot, eRed, eGreen,
  eBlue, eHotAlpha, eRedAlpha, eBlueAlpha,
  eGreenAlpha, eGray
}
 

Public Member Functions

 ColorMap (type t)
 
virtual ~ColorMap ()
 
VirtualRobot::VisualizationFactory::Color getColor (float position) const
 
bool getColor (float position, VirtualRobot::VisualizationFactory::Color &storeColor) const
 

Static Public Member Functions

static ColorMap customColorMap (std::vector< VirtualRobot::VisualizationFactory::Color > colors)
 Custom color maps can be created with this method. More...
 

Protected Member Functions

 ColorMap ()
 
bool addColorKey (const unsigned char R, const unsigned char G, const unsigned char B, const unsigned char A, const float Position)
 
void create (type t)
 
void sort ()
 

Static Protected Member Functions

static bool CompareColorKey (const ColorKey &lhs, const ColorKey &rhs)
 

Protected Attributes

std::vector< ColorKeycolorKeys
 
std::vector< float > intervals
 
type colorMapType
 

Member Enumeration Documentation

◆ type

Enumerator
eIntensity 
eHot 
eRed 
eGreen 
eBlue 
eHotAlpha 
eRedAlpha 
eBlueAlpha 
eGreenAlpha 
eGray 

Constructor & Destructor Documentation

◆ ColorMap() [1/2]

VirtualRobot::ColorMap::ColorMap ( type  t)

◆ ~ColorMap()

VirtualRobot::ColorMap::~ColorMap ( )
virtualdefault

◆ ColorMap() [2/2]

VirtualRobot::ColorMap::ColorMap ( )
protecteddefault

Member Function Documentation

◆ addColorKey()

bool VirtualRobot::ColorMap::addColorKey ( const unsigned char  R,
const unsigned char  G,
const unsigned char  B,
const unsigned char  A,
const float  Position 
)
protected

◆ CompareColorKey()

bool VirtualRobot::ColorMap::CompareColorKey ( const ColorKey lhs,
const ColorKey rhs 
)
staticprotected

◆ create()

void VirtualRobot::ColorMap::create ( type  t)
protected

◆ customColorMap()

ColorMap VirtualRobot::ColorMap::customColorMap ( std::vector< VirtualRobot::VisualizationFactory::Color colors)
static

Custom color maps can be created with this method.

◆ getColor() [1/2]

VirtualRobot::VisualizationFactory::Color VirtualRobot::ColorMap::getColor ( float  position) const

Returns color that is equivalent to position.

Parameters
positionA value between 0 and 1.
Returns
The corresponding color values (r,g,b,transparency values are in [0..1])

◆ getColor() [2/2]

bool VirtualRobot::ColorMap::getColor ( float  position,
VirtualRobot::VisualizationFactory::Color storeColor 
) const

◆ sort()

void VirtualRobot::ColorMap::sort ( )
protected

Field Documentation

◆ colorKeys

std::vector<ColorKey> VirtualRobot::ColorMap::colorKeys
protected

◆ colorMapType

type VirtualRobot::ColorMap::colorMapType
protected

◆ intervals

std::vector<float> VirtualRobot::ColorMap::intervals
protected