Open Inventor 9.9
com.openinventor.meshviz.graph

## Class PbNonLinearDataMapping2

• All Implemented Interfaces:
java.lang.Cloneable

```public class PbNonLinearDataMapping2
extends PbDataMapping
implements java.lang.Cloneable```
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)

• ### Nested Class Summary

Nested Classes
Modifier and Type Class and Description
`static class ` `PbNonLinearDataMapping2.Types`
Type of data mapping.
• ### Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor

`Inventor.ConstructorCommand`
• ### Field Summary

Fields
Modifier and Type Field and Description
`static int` `LINEAR_PER_LEVEL`
Deprecated.
`static int` `NON_LINEAR_PER_LEVEL`
Deprecated.
• ### Fields inherited from class com.openinventor.inventor.Inventor

`VERBOSE_LEVEL, ZeroHandle`
• ### Constructor Summary

Constructors
Constructor and Description
`PbNonLinearDataMapping2()`
Default constructor.
`PbNonLinearDataMapping2(PbNonLinearDataMapping2 nonLinearDataMap2)`
Copy constructor.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`java.lang.Object` `clone()`
`java.nio.FloatBuffer` `getDirectRGBColorsList()`
Gets the list of RGB colors defining the current non linear data mapping.
`java.nio.FloatBuffer` `getDirectTransparencyList()`
Gets the list of transparencies defining the current non linear data mapping.
`java.nio.FloatBuffer` `getDirectValuesList()`
Gets the list of values defining the current non linear data mapping.
`SbColor[]` `getRGBColorsList()`
Gets the list of RGB colors defining the current non linear data mapping.
`float[]` `getTransparencyList()`
Gets the list of transparencies defining the current non linear data mapping.
`PbNonLinearDataMapping2.Types` `getType()`
Returns the data mapping type.
`float[]` `getValuesList()`
Gets the list of values defining the current non linear data mapping.
`void` ```setValues(PbNonLinearDataMapping2.Types type, float[] v, SbColor[] c)```
Sets non linear function for data mapping, with RGB color.
`void` ```setValues(PbNonLinearDataMapping2.Types type, float[] v, SbColor[] c, float[] t)```
Sets non linear function for data mapping, with RGB color and transparencies.
• ### Methods inherited from class com.openinventor.meshviz.graph.PbDataMapping

`enableThresholds, enableTransparency, getHLSColor, getTransparencyValueDeletedParts, isTransparencyEnabled, setMaxThreshold, setMaxThreshold, setMaxThreshold, setMaxThreshold, setMaxThreshold, setMinThreshold, setMinThreshold, setMinThreshold, setMinThreshold, setMinThreshold, setTransparencyValueDeletedParts, thresholdsEnabled`
• ### Methods inherited from class com.openinventor.meshviz.graph.PbBase

`enableConnection, isConnectionEnabled, touch`
• ### Methods inherited from class com.openinventor.inventor.Inventor

`dispose, getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads`
• ### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Field Detail

• #### NON_LINEAR_PER_LEVEL

```@Deprecated
public static final int NON_LINEAR_PER_LEVEL```
Deprecated.
• #### LINEAR_PER_LEVEL

```@Deprecated
public static final int LINEAR_PER_LEVEL```
Deprecated.
• ### Constructor Detail

• #### PbNonLinearDataMapping2

`public PbNonLinearDataMapping2()`
Default constructor.
• #### PbNonLinearDataMapping2

`public PbNonLinearDataMapping2(PbNonLinearDataMapping2 nonLinearDataMap2)`
Copy constructor.
• ### Method Detail

• #### clone

`public java.lang.Object clone()`
Overrides:
`clone` in class `java.lang.Object`
• #### setValues

```public void setValues(PbNonLinearDataMapping2.Types type,
float[] v,
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.
• #### getDirectRGBColorsList

`public java.nio.FloatBuffer getDirectRGBColorsList()`
Gets the list of RGB colors defining the current non linear data mapping.
• #### setValues

```public void setValues(PbNonLinearDataMapping2.Types type,
float[] v,
SbColor[] c,
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.
• #### getDirectTransparencyList

`public java.nio.FloatBuffer getDirectTransparencyList()`
Gets the list of transparencies defining the current non linear data mapping.
• #### getValuesList

`public float[] getValuesList()`
Gets the list of values defining the current non linear data mapping.
• #### getRGBColorsList

`public SbColor[] getRGBColorsList()`
Gets the list of RGB colors defining the current non linear data mapping.
• #### getType

`public PbNonLinearDataMapping2.Types getType()`
Returns the data mapping type.
• #### getTransparencyList

`public float[] getTransparencyList()`
Gets the list of transparencies defining the current non linear data mapping.
• #### getDirectValuesList

`public java.nio.FloatBuffer getDirectValuesList()`
Gets the list of values defining the current non linear data mapping.