
The segments are by default specified as ( X1a Y1a, X1b Y1b, X2a Y2a, X2b, ... ), i e pairs of Vec2f to specify start position, start value, stop position and stop value. For a color transfer function each value must be in the interval (0,1), since it is to be converted to unsigned char which would yield under/overflow for other values.
The segments are also assumed to be specified in ascending order. If they are not the result is likely to be unpredictable and wrong.
If the field continuous is true the segments are specified as ( X1 Y1, X2 Y2, X3 Y3, ... ), which produces a continuous function with piecewise linear segments between the points specified. The points must be specified in the order of the X value.
Updating the segments field will generate an event, but not updating the continuous field, so to change the function from non continuous to continuous change first the continuous field and then set the segments field to match.
X3D Interface | ||||
| Name | Type | Default value | Description | |
![]() | segments | MFVec2f | [] | |
![]() | continuous | SFBool | FALSE | This flag makes it easier to specify a continuous function, see the detailed description |
| Derived from VHTKTransferFunctionNode | ||||
![]() | input | SFFloat | 0.0 | The input to convert using this transfer function. |
![]() | outputValue | (SFFloat) | 0.0 | This field converts the input value to a output value according to the specifications for the transfer function. |
![]() | outputDerivative | (SFFloat) | 0.0 | This field evaluates the derivative of the transfer function at the position of the input value. |
Public Member Functions | |
| PiecewiseFunction () | |
| Initializes local members. | |
| PiecewiseFunction (H3D::Vec2f p0, H3D::Vec2f p1) | |
| Initializes local members with one segment. | |
| PiecewiseFunction (H3D::H3DFloat x1, H3D::H3DFloat y1, H3D::H3DFloat x2, H3D::H3DFloat y2) | |
| Initializes local members with one segment. | |
| H3D::H3DFloat | get (H3D::H3DFloat x) |
| Get the value as float. | |
| H3D::H3DFloat | getDerivative (H3D::H3DFloat x) |
| Get the derivative. | |
Public Attributes | |
|
auto_ptr < H3D::ThreadSafeSField < H3D::SFBool > > | continuous |
| auto_ptr < H3D::ThreadSafeMField < H3D::MFVec2f > > | segments |
| The segments of this function. | |
Static Public Attributes | |
| static H3D::H3DNodeDatabase | database |
| VHTK::PiecewiseFunction::PiecewiseFunction | ( | ) |
Initializes local members.
| VHTK::PiecewiseFunction::PiecewiseFunction | ( | H3D::Vec2f | p0, | |
| H3D::Vec2f | p1 | |||
| ) |
Initializes local members with one segment.
| VHTK::PiecewiseFunction::PiecewiseFunction | ( | H3D::H3DFloat | x1, | |
| H3D::H3DFloat | y1, | |||
| H3D::H3DFloat | x2, | |||
| H3D::H3DFloat | y2 | |||
| ) |
Initializes local members with one segment.
| H3D::H3DFloat VHTK::PiecewiseFunction::get | ( | H3D::H3DFloat | x | ) | [virtual] |
| H3D::H3DFloat VHTK::PiecewiseFunction::getDerivative | ( | H3D::H3DFloat | x | ) | [virtual] |
| auto_ptr< H3D::ThreadSafeMField< H3D::MFVec2f > > VHTK::PiecewiseFunction::segments |
The segments of this function.
1.5.6