Helper class which represents a linear interpolation between two other mappings. More...
#include <MappingUtils.h>
Inherits Mapping.
Public Member Functions | |
LinearIntplMapping (ConstMapping *left=0, ConstMapping *right=0, double f=0.0) | |
Initializes the LinearIntplMapping with the passed left and right Mapping to interpolate by the passed interpolation value. | |
virtual Mapping * | clone () const |
Interpolated mappings are not supposed to be cloned! | |
virtual double | getValue (const Argument &pos) const |
Returns the linear interpolated value of this Mapping. | |
virtual MappingIterator * | createIterator () |
An interpolated mapping doesn't have a valid "first"-entry, so this method is not supported. | |
virtual MappingIterator * | createIterator (const Argument &pos) |
Creates an iterator for this mapping starting at the passed position. | |
virtual void | setValue (const Argument &pos, double value) |
This method is not supported! | |
Protected Attributes | |
ConstMapping * | left |
The left mapping to interpolate. | |
ConstMapping * | right |
The right mapping to interpolate. | |
double | factor |
The interpolation factor determining the linear interpolation between left and right mapping. |
Helper class which represents a linear interpolation between two other mappings.
Definition at line 481 of file MappingUtils.h.
virtual MappingIterator* LinearIntplMapping::createIterator | ( | const Argument & | pos | ) | [inline, virtual] |
Creates an iterator for this mapping starting at the passed position.
Note: The returned Iterator does only support a subset of the normal MappingIterator-methods. See LinearIntplMappingIterator for details.
Implements Mapping.
Definition at line 539 of file MappingUtils.h.
References ConstMapping::createConstIterator(), factor, left, and right.
{ assert(left); assert(right); return new LinearIntplMappingIterator(left->createConstIterator(pos), right->createConstIterator(pos), factor); }
virtual double LinearIntplMapping::getValue | ( | const Argument & | pos | ) | const [inline, virtual] |
Returns the linear interpolated value of this Mapping.
The value is calculated by the following formula:
v = left + (right - left) * intplFactor
Implements ConstMapping.
Definition at line 513 of file MappingUtils.h.
References factor, ConstMapping::getValue(), left, and right.