Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
PbNonLinearDataMapping2 Class Reference

MeshViz Class to define non linear data mapping. More...

#include <MeshViz/graph/PbNonLinearDataMapping2.h>

+ Inheritance diagram for PbNonLinearDataMapping2:

Public Types

enum  Type {
  NON_LINEAR_PER_LEVEL ,
  LINEAR_PER_LEVEL
}
 Type of data mapping. More...
 
- Public Types inherited from PbDataMapping
typedef float PbHLSColor[3]
 

Public Member Functions

 PbNonLinearDataMapping2 ()
 Default constructor.
 
 PbNonLinearDataMapping2 (const PbNonLinearDataMapping2 &nonLinearDataMap2)
 Copy constructor.
 
 ~PbNonLinearDataMapping2 ()
 Destructor.
 
PbNonLinearDataMapping2operator= (const PbNonLinearDataMapping2 &nonLinearDataMap2)
 Assignment operator.
 
void setValues (Type type, int numValues, const float *v, const SbColor *c)
 Sets non linear function for data mapping, with RGB color.
 
void setValues (Type type, int numValues, const float *v, const SbColor *c, const float *t)
 Sets non linear function for data mapping, with RGB color and transparencies.
 
void setValues (Type type, int numValues, const float *v, const PbHLSColor *c)
 Sets non linear function for data mapping, with HLS color.
 
void setValues (Type type, int numValues, const float *v, const PbHLSColor *c, const float *t)
 Sets non linear function for data mapping, with HLS color and transparencies.
 
const float * getValuesList (int &numValues) const
 Gets the list of values defining the current non linear data mapping.
 
const SbColorgetRGBColorsList (int &numColors) const
 Gets the list of RGB colors defining the current non linear data mapping.
 
const PbHLSColorgetHLSColorsList (int &numColors)
 Gets the list of HLS colors defining the current non linear data mapping.
 
const float * getTransparencyList (int &num_transparency) const
 Gets the list of transparencies defining the current non linear data mapping.
 
Type getType () const
 Returns the data mapping type.
 
- Public Member Functions inherited from PbDataMapping
 PbDataMapping ()
 Default constructor.
 
 ~PbDataMapping ()
 Destructor.
 
 PbDataMapping (const PbDataMapping &dataMapping)
 Copy constructor.
 
PbDataMappingoperator= (const PbDataMapping &dataMapping)
 Assignment operator.
 
const SbColorgetRGBColor (float value) const
 Gets RGB color associated to a value.
 
const float * getHLSColor (float value) const
 Gets HLS color associated with a value.
 
const SbColorgetRGBColor (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 SbColorgetMinRGBThreshold (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 SbColorgetMinRGBThreshold (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 SbColorgetMaxRGBThreshold (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 SbColorgetMaxRGBThreshold (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.
 
PbBaseoperator= (const PbBase &base)
 Assignment operator.
 

Detailed Description

MeshViz Class to define non linear data mapping.

This object defines a non linear association between colors, transparencies and floating-point values. In other words, this association is defined by 2 functions F(c,v) and F(c,t):

      F(c,v)(V) = C (with c being a color and v being a value).
      F(t,v)(V) = T (with t being a transparency and v being a value).

There are two ways to express F(c,v)(V):

  • F(c,v)(V) is non linear, but linear per level, so a list of values sorted in increasing order and a list of colors associated define this function. Thus, the association is (V1,C1), (V2,C2),...,(Vn,Cn) with V1 < V2 <...< Vn. For a given value vi, Vk <= vi <= Vk+1, the associated color ci is determined by a linear interpolation between (Vk,Ck) and (Vk+1,Ck+1).
  • F(c,v)(V) is defined by level, so a list of n values sorted in increasing order and a list of n+1 colors associated define this function. Thus, the association is C1, (V1,C2), (V2,C3),...,(Vn,Cn+1) with V1 < V2 <...< Vn. For a given value vi, Vk <= vi < Vk+1, the associated color ci is Ck+1. If vi < V1, the associated color ci is C1. In the two methods, the list of values is sorted in increasing order (and the associated colors also). By default, F(c,v)(V) is linear by level (LINEAR_PER_LEVEL), the number of colors and values is 2 with V1=0, V2=0, C1=(0,0,0) (black) and C2=(1,1,1) (white).

There are as well, two ways to express F(t,v)(V)

Definition at line 62 of file PbNonLinearDataMapping2.h.

Member Enumeration Documentation

◆ Type

Type of data mapping.

Enumerator
NON_LINEAR_PER_LEVEL 
LINEAR_PER_LEVEL 

Definition at line 69 of file PbNonLinearDataMapping2.h.

Constructor & Destructor Documentation

◆ PbNonLinearDataMapping2() [1/2]

PbNonLinearDataMapping2::PbNonLinearDataMapping2 ( )

Default constructor.

◆ PbNonLinearDataMapping2() [2/2]

PbNonLinearDataMapping2::PbNonLinearDataMapping2 ( const PbNonLinearDataMapping2 nonLinearDataMap2)

Copy constructor.

◆ ~PbNonLinearDataMapping2()

PbNonLinearDataMapping2::~PbNonLinearDataMapping2 ( )

Destructor.

Member Function Documentation

◆ getHLSColorsList()

const PbHLSColor * PbNonLinearDataMapping2::getHLSColorsList ( int &  numColors)

Gets the list of HLS colors defining the current non linear data mapping.

◆ getRGBColorsList()

const SbColor * PbNonLinearDataMapping2::getRGBColorsList ( int &  numColors) const
inline

Gets the list of RGB colors defining the current non linear data mapping.

Definition at line 140 of file PbNonLinearDataMapping2.h.

◆ getTransparencyList()

const float * PbNonLinearDataMapping2::getTransparencyList ( int &  num_transparency) const
inline

Gets the list of transparencies defining the current non linear data mapping.

Definition at line 153 of file PbNonLinearDataMapping2.h.

◆ getType()

Type PbNonLinearDataMapping2::getType ( ) const
inline

Returns the data mapping type.

Definition at line 158 of file PbNonLinearDataMapping2.h.

◆ getValuesList()

const float * PbNonLinearDataMapping2::getValuesList ( int &  numValues) const
inline

Gets the list of values defining the current non linear data mapping.

Definition at line 133 of file PbNonLinearDataMapping2.h.

◆ operator=()

PbNonLinearDataMapping2 & PbNonLinearDataMapping2::operator= ( const PbNonLinearDataMapping2 nonLinearDataMap2)

Assignment operator.

◆ setValues() [1/4]

void PbNonLinearDataMapping2::setValues ( Type  type,
int  numValues,
const float *  v,
const PbHLSColor c 
)

Sets non linear function for data mapping, with HLS color.

If type = NON_LINEAR_PER_LEVEL, the number of colors must be equal to numValues + 1, otherwise it must be equal to numValues.

◆ setValues() [2/4]

void PbNonLinearDataMapping2::setValues ( Type  type,
int  numValues,
const float *  v,
const PbHLSColor c,
const float *  t 
)

Sets non linear function for data mapping, with HLS color and transparencies.

If type = NON_LINEAR_PER_LEVEL, the number of colors and transparencies must be equal to numValues + 1, otherwise it must be equal to numValues.

◆ setValues() [3/4]

void PbNonLinearDataMapping2::setValues ( Type  type,
int  numValues,
const float *  v,
const SbColor c 
)

Sets non linear function for data mapping, with RGB color.

If type = NON_LINEAR_PER_LEVEL, the number of colors must be equal to numValues + 1, otherwise it must be equal to numValues.

◆ setValues() [4/4]

void PbNonLinearDataMapping2::setValues ( Type  type,
int  numValues,
const float *  v,
const SbColor c,
const float *  t 
)

Sets non linear function for data mapping, with RGB color and transparencies.

If type = NON_LINEAR_PER_LEVEL, the number of colors and transparencies must be equal to numValues + 1, otherwise it must be equal to numValues.


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