#include <Integrator.h>
Static Public Member Functions | |
| static void | getTransformAndScaleFactor (Level2D *level, Vector2D *destinationOrigin, double maxValue, Vector2D *transformationVector, double *scaleFactor) |
| static void | transform (Vector2D *value, Vector2D *transformationVector, double scaleFactor) |
| static void | reTransform (Vector2D *value, Vector2D *transformationVector, double scaleFactor) |
| static Vector2D * | transformInvertY (Vector2D *value, Vector2D *transformationVector, double scaleFactor) |
| static Vector2D * | reTransformInvertY (Vector2D *value, Vector2D *transformationVector, double scaleFactor) |
| static Vector2D * | transformInvertX (Vector2D *value, Vector2D *transformationVector, double scaleFactor) |
| static Vector2D * | reTransformInvertX (Vector2D *value, Vector2D *transformationVector, double scaleFactor) |
| static double | getAngleFromUnifiedVector (Vector2D v) |
| static double | getAngleFromVector (Vector2D v) |
| static double | getFixedAngleFromVector (Vector2D v, double threshold) |
Class for integration / migration of level data into single modules. Contains only static methods. The raw data of a level based on a SVG must be transformed so every module can work with the level because the modules have different number workspaces. If a module changes level data it needs to retransform those values. Besides that the class has some other utility functions
filename: Integrator.h
| static void sonus::Integrator::getTransformAndScaleFactor | ( | Level2D * | level, | |
| Vector2D * | destinationOrigin, | |||
| double | maxValue, | |||
| Vector2D * | transformationVector, | |||
| double * | scaleFactor | |||
| ) | [inline, static] |
Calculates a transformation vector and scale factor to transform level data into module workspace and scaling. It is assumed that the module workspace is cubic. For example your level has its origin at (0, 0) and a max value of 50. So the level workspace goes from (-50, -50) to (50, 50). Assuming your module has its origin at (10, 10) and also a max value at 50. So its workspace goes from (-40, -40) to (60, 60). So the transformation vector will be (10, 10) and the scale factor will be 1.
| level | the level (data) | |
| destinationOrigin | the origin coordinates of the module workspace | |
| maxValue | the max value of the workspace | |
| transformationVector | the output transformation vector | |
| scaleFactor | the output scale factor |
| static void sonus::Integrator::transform | ( | Vector2D * | value, | |
| Vector2D * | transformationVector, | |||
| double | scaleFactor | |||
| ) | [inline, static] |
Transforms a vector by given transformation vector and scale factor.
| value | the vector which will be transformed | |
| transformationVector | the used transformation vector | |
| scaleFactor | the used scale factor |
| static void sonus::Integrator::reTransform | ( | Vector2D * | value, | |
| Vector2D * | transformationVector, | |||
| double | scaleFactor | |||
| ) | [inline, static] |
Invert transforms a vector by given transformation vector and scale factor.
| value | the vector which will be retransformed | |
| transformationVector | the used transformation vector | |
| scaleFactor | the used scale factor |
| static Vector2D* sonus::Integrator::transformInvertY | ( | Vector2D * | value, | |
| Vector2D * | transformationVector, | |||
| double | scaleFactor | |||
| ) | [inline, static] |
Transforms a vector into a new vector by given transformation vector and scale factor inverts the y value.
| value | the original vector | |
| transformationVector | the used transformation vector | |
| scaleFactor | the used scale factor |
| static Vector2D* sonus::Integrator::reTransformInvertY | ( | Vector2D * | value, | |
| Vector2D * | transformationVector, | |||
| double | scaleFactor | |||
| ) | [inline, static] |
Invert transforms a vector into a new vector by given transformation vector and scale factor and inverts the y value.
| value | the original vector | |
| transformationVector | the used transformation vector | |
| scaleFactor | the used scale factor |
| static Vector2D* sonus::Integrator::transformInvertX | ( | Vector2D * | value, | |
| Vector2D * | transformationVector, | |||
| double | scaleFactor | |||
| ) | [inline, static] |
Transforms a vector into a new vector by given transformation vector and scale factor and inverts the x value.
| value | the original vector | |
| transformationVector | the used transformation vector | |
| scaleFactor | the used scale factor |
| static Vector2D* sonus::Integrator::reTransformInvertX | ( | Vector2D * | value, | |
| Vector2D * | transformationVector, | |||
| double | scaleFactor | |||
| ) | [inline, static] |
Invert transforms a vector into a new vector by given transformation vector and scale factor and inverts the x value.
| value | the original vector | |
| transformationVector | the used transformation vector | |
| scaleFactor | the used scale factor |
| static double sonus::Integrator::getAngleFromUnifiedVector | ( | Vector2D | v | ) | [inline, static] |
Calculates an angle from an unified vector
| v | input vector |
| static double sonus::Integrator::getAngleFromVector | ( | Vector2D | v | ) | [inline, static] |
Calculates an angle from a vector. The copied vector will unified.
| v | input vector |
| static double sonus::Integrator::getFixedAngleFromVector | ( | Vector2D | v, | |
| double | threshold | |||
| ) | [inline, static] |
Calculates a fixed angle from a vector. The angle will only contain fixed values depending on the threshold.
| v | input vector | |
| threshold | threshold value for value steps |
1.5.4