| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/intervalmapper.h>

Public Member Functions | |
| IntervalMapper (TARGET_TYPE undefValue=TARGET_TYPE()) | |
| Creates a new empty mapping table. Only the undef target value is defined. | |
| IntervalMapper (Iterator< IntervalInfo > *intervals, TARGET_TYPE undefValue=TARGET_TYPE()) | |
| Creates a new mapping table containing given intervals. | |
| IntervalMapper (Iterator< SOURCE_TYPE > *sources, Iterator< TARGET_TYPE > *targets, bool interpolate=false, TARGET_TYPE undefValue=TARGET_TYPE()) | |
| void | add (SOURCE_TYPE sourceValue, TARGET_TYPE targetValue) |
| Define the target value for the given source value. | |
| void | add (SOURCE_TYPE sourceBegin, SOURCE_TYPE sourceEnd, TARGET_TYPE targetValue) |
| Define the (constant) target value for the given source interval. | |
| void | add (SOURCE_TYPE sourceBegin, SOURCE_TYPE sourceEnd, TARGET_TYPE targetBegin, TARGET_TYPE targetEnd) |
| void | remove (SOURCE_TYPE sourceBegin, SOURCE_TYPE sourceEnd, bool all=false) |
| void | remove (const IntervalInfo &interval) |
| Removes the given interval. | |
| void | removeAll () |
| Removes all intervals. | |
| virtual TARGET_TYPE | map (SOURCE_TYPE sourceValue) |
| Iterator< IntervalInfo > * | insertedIntervals () const |
| Iterator< IntervalInfo > * | mappingIntervals () const |
| VRS_TYPEINFO (IntervalMapper, VRS_TEMPLATE_ARGS_2(TARGET_TYPE, SOURCE_TYPE, Mapper)) | |
| VRS_SERIALIZABLE (IntervalMapper) | |
Classes | |
| struct | IntervalInfo |
| VRS::IntervalMapper< TARGET_TYPE, SOURCE_TYPE >::IntervalMapper | ( | TARGET_TYPE | undefValue = TARGET_TYPE() |
) |
Creates a new empty mapping table. Only the undef target value is defined.
| VRS::IntervalMapper< TARGET_TYPE, SOURCE_TYPE >::IntervalMapper | ( | Iterator< IntervalInfo > * | intervals, | |
| TARGET_TYPE | undefValue = TARGET_TYPE() | |||
| ) |
Creates a new mapping table containing given intervals.
| VRS::IntervalMapper< TARGET_TYPE, SOURCE_TYPE >::IntervalMapper | ( | Iterator< SOURCE_TYPE > * | sources, | |
| Iterator< TARGET_TYPE > * | targets, | |||
| bool | interpolate = false, |
|||
| TARGET_TYPE | undefValue = TARGET_TYPE() | |||
| ) |
Creates a new mapping table. The mappings for the given source and target values are inserted into an empty mapping table. The source values must be specified in increasing order. If interpolate is true, each source value is associated with the corresponding target value. If interpolate is false, the interval between two source values is associated with a (constant) target value; hence, the number of target values must be the number of source values minus one!
| void VRS::IntervalMapper< TARGET_TYPE, SOURCE_TYPE >::add | ( | SOURCE_TYPE | sourceValue, | |
| TARGET_TYPE | targetValue | |||
| ) |
Define the target value for the given source value.
| void VRS::IntervalMapper< TARGET_TYPE, SOURCE_TYPE >::add | ( | SOURCE_TYPE | sourceBegin, | |
| SOURCE_TYPE | sourceEnd, | |||
| TARGET_TYPE | targetValue | |||
| ) |
Define the (constant) target value for the given source interval.
| void VRS::IntervalMapper< TARGET_TYPE, SOURCE_TYPE >::add | ( | SOURCE_TYPE | sourceBegin, | |
| SOURCE_TYPE | sourceEnd, | |||
| TARGET_TYPE | targetBegin, | |||
| TARGET_TYPE | targetEnd | |||
| ) |
Define the target values for the given source interval. During the mapping calculation the target values are interpolated linearly across the source interval. If the source interval overlaps with already existing mapping intervals, the mapping for the overlap is refined by this new interval. VRS::INF and -VRSINF can be used to denote infinity and minus infinity.
| void VRS::IntervalMapper< TARGET_TYPE, SOURCE_TYPE >::remove | ( | SOURCE_TYPE | sourceBegin, | |
| SOURCE_TYPE | sourceEnd, | |||
| bool | all = false | |||
| ) |
Removes the interval with the given start and end points. If the all-flag is set to true, all matching intervals are removed; otherwise, only the last inserted interval matching these points is removed.
| void VRS::IntervalMapper< TARGET_TYPE, SOURCE_TYPE >::remove | ( | const IntervalInfo & | interval | ) |
Removes the given interval.
| void VRS::IntervalMapper< TARGET_TYPE, SOURCE_TYPE >::removeAll | ( | ) |
Removes all intervals.
| virtual TARGET_TYPE VRS::IntervalMapper< TARGET_TYPE, SOURCE_TYPE >::map | ( | SOURCE_TYPE | sourceValue | ) | [virtual] |
Calculates the mapping for the given source value. If the given source value lies inside of a stored interval the mapped value is calculated by linear interpolation between the corresponding target values of the mapping interval. If the given source value is not contained in any mapping interval the undef target value is returned. If the given source value lies inside of more than one mapping interval the last inserted mapping interval is used for the mapping calculation!
Implements VRS::Mapper< TARGET_TYPE, SOURCE_TYPE >.
| Iterator<IntervalInfo>* VRS::IntervalMapper< TARGET_TYPE, SOURCE_TYPE >::insertedIntervals | ( | ) | const |
Returns all inserted mapping intervals in the order of insertion. Note: the intervals may overlap and are NOT sorted according their starting points!
| Iterator<IntervalInfo>* VRS::IntervalMapper< TARGET_TYPE, SOURCE_TYPE >::mappingIntervals | ( | ) | const |
Returns the mapping intervals used for the mapping calculations. It is guaranteed that the returned intervals do not overlap and are sorted with respect to their starting points!
| VRS::IntervalMapper< TARGET_TYPE, SOURCE_TYPE >::VRS_TYPEINFO | ( | IntervalMapper< TARGET_TYPE, SOURCE_TYPE > | , | |
| VRS_TEMPLATE_ARGS_2(TARGET_TYPE, SOURCE_TYPE, Mapper) | ||||
| ) |
| VRS::IntervalMapper< TARGET_TYPE, SOURCE_TYPE >::VRS_SERIALIZABLE | ( | IntervalMapper< TARGET_TYPE, SOURCE_TYPE > | ) |