HyperspaceExplorer 0.7.1
|
Functions used for calculating four-dimensional depth cue. More...
Functions | |
void | checkMinimum (const VecMath::Vector< 4, double > &, const VecMath::Vector< 4, double > &xtrans) |
void | resetMin () |
void | findMinimumW (Displayable *object) |
void | checkMaximum (const VecMath::Vector< 4, double > &, const VecMath::Vector< 4, double > &xtrans) |
void | resetMax () |
void | findMaximumW (Displayable *object) |
void | determineExtrema (Displayable *object) |
Scans all vertices of the object, setting the upper and lower boundaries in all dimensions. | |
VecMath::Vector< 4 > | getMax () |
The upper boundary of the transformed object in all dimensions. | |
VecMath::Vector< 4 > | getMin () |
The lower boundary of the transformed object in all dimensions. | |
void | setDepthCueColor (const VecMath::Vector< 4, double > &x, const VecMath::Vector< 4, double > &xtrans) |
Sets the 4D depth cue for a single transformed vertex xtrans . | |
float | getColorComponent (unsigned i, const VecMath::Vector< 4, double > &x) |
A value between 0 and 1, how far component i of vector x lies between the extrema in the i th dimension. | |
void | calibrateColor3D (const VecMath::Vector< 4, double > &x) |
Default calibration of the ColorManager for a single vertex x . | |
void | calibrateColorForSurface (const VecMath::Vector< 4, double > &x) |
Color calibration function used in class Surface. | |
Variables | |
static Vector< 4 > | min |
static Vector< 4 > | max |
Functions used for calculating four-dimensional depth cue.
Because these functions are parameters to Displayable::for_each_vertex(), they need to be global to fit the signature.
namespace DepthCueUtil can and will be added to in other source files to define functions supplied to VertexHolder<N,P,NUM>::calibrateColor(). Example:
namespace DepthCueUtil { void calibrateColorForSomething(const VecMath::Vector<4, double> &x) { // ... ColMgrMgr::Instance().calibrateColor(x, Color(r, g, b)); } } Something::Something(): VertexHolder<4, 2, double>(ParameterMap()) { setColorCalibrationFunction(DepthCueUtil::calibrateColorForSomething); }
void DepthCueUtil::calibrateColor3D | ( | const VecMath::Vector< 4, double > & | x | ) |
Default calibration of the ColorManager for a single vertex x
.
Each component of the color (r, g, b, a) is calculated by how far the corresponding component of the vector (x, y, z, w) lies between the min and max values for that dimension.
References getColorComponent(), and Loki::SingletonHolder< T, CreationPolicy >::Instance().
void DepthCueUtil::checkMaximum | ( | const VecMath::Vector< 4, double > & | , |
const VecMath::Vector< 4, double > & | xtrans | ||
) |
Tests whether xtrans
is inside the upper boundary of the transformed object and resets any component of the upper boundary if not.
Referenced by findMaximumW().
void DepthCueUtil::checkMinimum | ( | const VecMath::Vector< 4, double > & | , |
const VecMath::Vector< 4, double > & | xtrans | ||
) |
Tests whether xtrans
is inside the lower boundary of the transformed object and resets any component of the lower boundary if not.
xtrans | the vertex to check |
Referenced by findMinimumW().
void DepthCueUtil::determineExtrema | ( | Displayable * | object | ) |
Scans all vertices of the object, setting the upper and lower boundaries in all dimensions.
object | Object whose boundaries are found |
References findMaximumW(), and findMinimumW().
void DepthCueUtil::findMaximumW | ( | Displayable * | object | ) |
Find the upper boundary of the space the transformed object
occupies.
object | Object whose upper boundary is found |
References checkMaximum(), and resetMax().
Referenced by determineExtrema().
void DepthCueUtil::findMinimumW | ( | Displayable * | object | ) |
Find the lower boundary of the space the transformed object
occupies.
object | Object whose lower boundary is found |
References checkMinimum(), and resetMin().
Referenced by determineExtrema().
void DepthCueUtil::resetMax | ( | ) |
Reset the upper boundary of the transformed object before running a full scan to determine it.
Referenced by findMaximumW().
void DepthCueUtil::resetMin | ( | ) |
Reset the lower boundary of the transformed object before running a full scan to determine it.
Referenced by findMinimumW().