Abstract class for data mapping. More...
#include <MeshViz/graph/PbDataMapping.h>
Public Types | |
typedef float | PbHLSColor[3] |
Public Member Functions | |
PbDataMapping () | |
Default constructor. | |
~PbDataMapping () | |
Destructor. | |
PbDataMapping (const PbDataMapping &dataMapping) | |
Copy constructor. | |
PbDataMapping & | operator= (const PbDataMapping &dataMapping) |
Assignment operator. | |
const SbColor * | getRGBColor (float value) const |
Gets RGB color associated to a value. | |
const float * | getHLSColor (float value) const |
Gets HLS color associated with a value. | |
const SbColor * | getRGBColor (float value, float &transparency) const |
Gets the RGB color and the transparency associated with a value. | |
const float * | getHLSColor (float value, float &transparency) const |
Gets the HLS color and the transparency associated to a value. | |
void | setMinThreshold (float threshold_min) |
Sets a minimum threshold. | |
void | setMinThreshold (float threshold_min, const SbColor &cmin, float transp_min=0.0) |
Sets a minimum threshold, associated to a RGB color and a transparency value. | |
void | setMinThreshold (float threshold_min, PbHLSColor cmin, float transp_min=0.0) |
Sets a minimum threshold, associated to a HLS color and a transparency value. | |
void | setMaxThreshold (float threshold_max) |
Sets a maximum threshold. | |
void | setMaxThreshold (float threshold_max, const SbColor &cmax, float transp_max=0.0) |
Sets a maximum threshold, associated to a RGB color and a transparency value. | |
void | setMaxThreshold (float threshold_max, PbHLSColor cmax, float transp_max=0.0) |
Sets a maximum threshold, associated to a HLS color and a transparency value. | |
const SbColor * | getMinRGBThreshold (float &threshold_min) const |
Gets the minimum threshold and its associated RGB color. | |
const float * | getMinHLSThreshold (float &threshold_min) const |
Gets the minimum threshold and its associated HLS color. | |
const SbColor * | getMinRGBThreshold (float &threshold_min, float &transp_min) const |
Gets the minimum threshold, its associated RGB color and transparency. | |
const float * | getMinHLSThreshold (float &threshold_min, float &transp_min) const |
Gets the minimum threshold, its associated HLS color and transparency. | |
const SbColor * | getMaxRGBThreshold (float &threshold_max) const |
Gets the maximum threshold and its associated RGB color. | |
const float * | getMaxHLSThreshold (float &threshold_max) const |
Gets the maximum threshold and its associated HLS color. | |
const SbColor * | getMaxRGBThreshold (float &threshold_max, float &transp_max) const |
Gets the maximum threshold, its associated RGB color and transparency. | |
const float * | getMaxHLSThreshold (float &threshold_max, float &transp_max) const |
Gets the maximum threshold, its associated HLS color and transparency. | |
void | enableThresholds (SbBool min, SbBool max) |
Enable/Disable the taking into account of threshold values. | |
void | thresholdsEnabled (SbBool &min, SbBool &max) const |
Returns min=TRUE if the minimum threshold is enabled, otherwise FALSE. | |
void | enableTransparency (SbBool flag) |
Enable/Disable the taking into account of transparency. | |
SbBool | isTransparencyEnabled () const |
Returns TRUE if transparency is enabled, otherwise FALSE. | |
void | setTransparencyValueDeletedParts (float value) |
Sets a value that defines the following property : each primitive part of which transparency >= value, is deleted. | |
float | getTransparencyValueDeletedParts () const |
Gets a value that defines the following property : each primitive part of which transparency >= value, is deleted. | |
Public Member Functions inherited from PbBase | |
void | enableConnection (SbBool flag) |
Activates/deactivates the mechanism of connection. | |
SbBool | isConnectionEnabled () const |
Returns TRUE if the connection mechanism is active, otherwise FALSE. | |
void | touch () |
Simulates the changing of an instance of this object, so all connected objects are informed of this change. | |
PbBase & | operator= (const PbBase &base) |
Assignment operator. | |
Abstract class for data mapping.
Data mapping defines an association between colors, transparencies and floating-point values. Giving transparencies is not compulsory. When they are not given, they are supposed to be equal to 0 , i.e. each color is opaque.
Whichever data mapping, two threshold values can be defined, threshold_min and threshold_max. One color (cmin) and one transparency (transp_min) are associated to threshold_min . As well, cmax and transp_max are associated to threshold_max. For a given value vi <= threshold_min, the associated color ci is cmin and the associated transparency ti is transp_min. As well, for a given value vi >= threshold_max, the associated color ci is cmax and the associated transparency ti is transp_max.
By default min and max thresholds are disabled, threshold_min = 0 and threshold_max = 1 and no color is associated to threshold_min and threshold_max. Each part of primitive of which transparency is greater or equal 0.95 is deleted. This default value can be changed by the method setTransparencyValueDeletedParts().
Definition at line 57 of file PbDataMapping.h.
typedef float PbDataMapping::PbHLSColor[3] |
Definition at line 61 of file PbDataMapping.h.
PbDataMapping::PbDataMapping | ( | ) |
Default constructor.
PbDataMapping::~PbDataMapping | ( | ) |
Destructor.
PbDataMapping::PbDataMapping | ( | const PbDataMapping & | dataMapping | ) |
Copy constructor.
Enable/Disable the taking into account of threshold values.
void PbDataMapping::enableTransparency | ( | SbBool | flag | ) |
Enable/Disable the taking into account of transparency.
If it is disable, the different shape are always opaque.
const float * PbDataMapping::getHLSColor | ( | float | value | ) | const |
Gets HLS color associated with a value.
If the returned value is NULL, this means that there is no color associated with this value.
const float * PbDataMapping::getHLSColor | ( | float | value, |
float & | transparency | ||
) | const |
Gets the HLS color and the transparency associated to a value.
If the returned value is NULL, this means that there is no color associated to this value.
const float * PbDataMapping::getMaxHLSThreshold | ( | float & | threshold_max | ) | const |
Gets the maximum threshold and its associated HLS color.
NULL is returned if no color is associated to this threshold.
const float * PbDataMapping::getMaxHLSThreshold | ( | float & | threshold_max, |
float & | transp_max | ||
) | const |
Gets the maximum threshold, its associated HLS color and transparency.
NULL is returned if no color is associated to this threshold.
const SbColor * PbDataMapping::getMaxRGBThreshold | ( | float & | threshold_max | ) | const |
Gets the maximum threshold and its associated RGB color.
NULL is returned if no color is associated to this threshold.
const SbColor * PbDataMapping::getMaxRGBThreshold | ( | float & | threshold_max, |
float & | transp_max | ||
) | const |
Gets the maximum threshold, its associated RGB color and transparency.
NULL is returned if no color is associated to this threshold.
const float * PbDataMapping::getMinHLSThreshold | ( | float & | threshold_min | ) | const |
Gets the minimum threshold and its associated HLS color.
NULL is returned if no color is associated to this threshold.
const float * PbDataMapping::getMinHLSThreshold | ( | float & | threshold_min, |
float & | transp_min | ||
) | const |
Gets the minimum threshold, its associated HLS color and transparency.
NULL is returned if no color is associated to this threshold.
const SbColor * PbDataMapping::getMinRGBThreshold | ( | float & | threshold_min | ) | const |
Gets the minimum threshold and its associated RGB color.
NULL is returned if no color is associated to this threshold.
const SbColor * PbDataMapping::getMinRGBThreshold | ( | float & | threshold_min, |
float & | transp_min | ||
) | const |
Gets the minimum threshold, its associated RGB color and transparency.
NULL is returned if no color is associated to this threshold.
const SbColor * PbDataMapping::getRGBColor | ( | float | value | ) | const |
Gets RGB color associated to a value.
If the returned value is NULL, this means that there is no color associated to this value.
const SbColor * PbDataMapping::getRGBColor | ( | float | value, |
float & | transparency | ||
) | const |
Gets the RGB color and the transparency associated with a value.
If the returned value is NULL, this means that there is no color associated to this value.
float PbDataMapping::getTransparencyValueDeletedParts | ( | ) | const |
Gets a value that defines the following property : each primitive part of which transparency >= value, is deleted.
|
inline |
Returns TRUE if transparency is enabled, otherwise FALSE.
Definition at line 227 of file PbDataMapping.h.
PbDataMapping & PbDataMapping::operator= | ( | const PbDataMapping & | dataMapping | ) |
Assignment operator.
void PbDataMapping::setMaxThreshold | ( | float | threshold_max | ) |
Sets a maximum threshold.
No color is associated to this threshold.
void PbDataMapping::setMaxThreshold | ( | float | threshold_max, |
const SbColor & | cmax, | ||
float | transp_max = 0.0 |
||
) |
Sets a maximum threshold, associated to a RGB color and a transparency value.
void PbDataMapping::setMaxThreshold | ( | float | threshold_max, |
PbHLSColor | cmax, | ||
float | transp_max = 0.0 |
||
) |
Sets a maximum threshold, associated to a HLS color and a transparency value.
void PbDataMapping::setMinThreshold | ( | float | threshold_min | ) |
Sets a minimum threshold.
No color is associated to this threshold.
void PbDataMapping::setMinThreshold | ( | float | threshold_min, |
const SbColor & | cmin, | ||
float | transp_min = 0.0 |
||
) |
Sets a minimum threshold, associated to a RGB color and a transparency value.
void PbDataMapping::setMinThreshold | ( | float | threshold_min, |
PbHLSColor | cmin, | ||
float | transp_min = 0.0 |
||
) |
Sets a minimum threshold, associated to a HLS color and a transparency value.
void PbDataMapping::setTransparencyValueDeletedParts | ( | float | value | ) |
Sets a value that defines the following property : each primitive part of which transparency >= value, is deleted.
value = 0.95 by default.
Returns min=TRUE if the minimum threshold is enabled, otherwise FALSE.
Idem with max.
Definition at line 215 of file PbDataMapping.h.