VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtRemapValueTransform Class Reference

Detailed Description

This transform changes the range of input values by mapping them from an input range to an output range using linear interpolation. It's useful for normalizing or scaling values from hardware-specific ranges to standardized ranges.

#include <remapValueTransform.h>

Inheritance diagram for makVre::DtRemapValueTransform:
[legend]

Public Member Functions

 DtRemapValueTransform ()
 
virtual ~DtRemapValueTransform () override
 
virtual void init (DtInitTable *config) override
 
virtual float transform (float value) override
 
- Public Member Functions inherited from makVre::DtValueTransform
 DtValueTransform ()
 
virtual ~DtValueTransform ()
 

Protected Attributes

float myInputMin
 
float myInputMax
 
float myOutputMin
 
float myOutputMax
 
float myInputRange
 
float myOutputRange
 

Constructor & Destructor Documentation

◆ DtRemapValueTransform()

makVre::DtRemapValueTransform::DtRemapValueTransform ( )

Default constructor.

Initializes the remap ranges with default values

◆ ~DtRemapValueTransform()

virtual makVre::DtRemapValueTransform::~DtRemapValueTransform ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ init()

virtual void makVre::DtRemapValueTransform::init ( DtInitTable * config)
overridevirtual

Initialize the remap transform from configuration.

Reads the input and output range parameters from the configuration table. Expected configuration parameters are:

  • "InputMin": Minimum value of the input range
  • "InputMax": Maximum value of the input range
  • "OutputMin": Minimum value of the output range
  • "OutputMax": Maximum value of the output range
Parameters
configPointer to the configuration table

Implements makVre::DtValueTransform.

◆ transform()

virtual float makVre::DtRemapValueTransform::transform ( float value)
overridevirtual

Apply the remapping transformation to an input value.

Linearly remaps the input value from the input range to the output range. Values outside the input range will be clamped to the output range boundaries.

Parameters
valueThe raw input value to transform
Returns
The remapped value in the output range

Implements makVre::DtValueTransform.

Member Data Documentation

◆ myInputMin

float makVre::DtRemapValueTransform::myInputMin
protected

Minimum value of the input range.

◆ myInputMax

float makVre::DtRemapValueTransform::myInputMax
protected

Maximum value of the input range.

◆ myOutputMin

float makVre::DtRemapValueTransform::myOutputMin
protected

Minimum value of the output range.

◆ myOutputMax

float makVre::DtRemapValueTransform::myOutputMax
protected

Maximum value of the output range.

◆ myInputRange

float makVre::DtRemapValueTransform::myInputRange
protected

Size of the input range (InputMax - InputMin)

Pre-calculated for efficiency in the transform function

◆ myOutputRange

float makVre::DtRemapValueTransform::myOutputRange
protected

Size of the output range (OutputMax - OutputMin)

Pre-calculated for efficiency in the transform function


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