MeVisLab Toolbox Reference
|
The CSOMath namespace offers some common methods for various problems, e.g., computing the area, mapping from voxel to world or computing numerical problems real fast. More...
Functions | |
MLCSO_EXPORT double | computeArea (const std::vector< Vector3 > &points, const Vector3 &normal) |
Computes the area of the polygon, given as a list of points. More... | |
MLCSO_EXPORT void | computeAreaAndCenterOfGravity (const std::vector< Vector3 > &points, const Vector3 &normal, const Vector3 ¢erPoint, double &area, Vector3 ¢erOfGravity) |
MLCSO_EXPORT size_t | getHashKeyForMatrix4 (const ml::Matrix4 &matrix) |
Returns a hash key for a given matrix. More... | |
MLCSO_EXPORT int | floorToInt (const double x) |
Returns the floored double value as an integer. More... | |
MLCSO_EXPORT int | ceilToInt (const double x) |
Returns the ceiled double value as an integer. More... | |
MLCSO_EXPORT double | computeDirectionDotProduct (const Vector3 &predPos, const Vector3 &middlePos, const Vector3 &succPos) |
Computes and returns the dot product of the direction vectors of pred-middle and middle-succ. More... | |
Variables | |
const double | smallNumber = 10e-10 |
The CSOMath namespace offers some common methods for various problems, e.g., computing the area, mapping from voxel to world or computing numerical problems real fast.
|
inline |
MLCSO_EXPORT double ml::CSOMath::computeArea | ( | const std::vector< Vector3 > & | points, |
const Vector3 & | normal | ||
) |
Computes the area of the polygon, given as a list of points.
MLCSO_EXPORT void ml::CSOMath::computeAreaAndCenterOfGravity | ( | const std::vector< Vector3 > & | points, |
const Vector3 & | normal, | ||
const Vector3 & | centerPoint, | ||
double & | area, | ||
Vector3 & | centerOfGravity | ||
) |
Computes the area and center of gravity (in terms of area) of the polygon, given as a list of points. In contrast to CSOGeometry::getCenterOfGravity(), this method defines the center of gravity as the center of the enclosed area.
[in] | points | The points that define the polygon. |
[in] | normal | The normal vector of the plane that contains the polygon points. |
[in] | centerPoint | The point that is used to create a triangle fan for the calculation of the polygon area. Any point within the polygon plane may be used (e.g. the first path point), but for numerical reasons a point close to the center should be preferred. |
[out] | area | Return parameter for the calculated area of the polygon. |
[out] | centerOfGravity | Return parameter for the calculated center of gravity of the polygon. |
MLCSO_EXPORT double ml::CSOMath::computeDirectionDotProduct | ( | const Vector3 & | predPos, |
const Vector3 & | middlePos, | ||
const Vector3 & | succPos | ||
) |
Computes and returns the dot product of the direction vectors of pred-middle and middle-succ.
|
inline |
MLCSO_EXPORT size_t ml::CSOMath::getHashKeyForMatrix4 | ( | const ml::Matrix4 & | matrix | ) |
Returns a hash key for a given matrix.