MeVisLab Toolbox Reference
ml::CSOMath Namespace Reference

Functions

MLCSO_EXPORT double computeArea (const std::vector< Vector3 > &points, const Vector3 &normal)
 Computes the area of the polygon that is given as a list of points.
MLCSO_EXPORT void computeAreaAndCenterOfGravity (const std::vector< Vector3 > &points, const Vector3 &normal, const Vector3 &centerPoint, double &area, Vector3 &centerOfGravity)
MLCSO_EXPORT size_t getHashKeyForMatrix4 (const ml::Matrix4 &matrix)
 Returns a hash key for a given matrix.
MLCSO_EXPORT int floorToInt (const double x)
MLCSO_EXPORT int ceilToInt (const double x)
MLCSO_EXPORT double computeDirectionDotProduct (const Vector3 &predPos, const Vector3 &middlePos, const Vector3 &succPos)

Variables

const double smallNumber = 10e-10

Detailed Description

The CSOMath namespace offers some common methods for various problems, e.g., computing the area, mapping from voxel to world, or computing numerical problems really fast.

Function Documentation

◆ ceilToInt()

MLCSO_EXPORT int ml::CSOMath::ceilToInt ( const double x)
inline

Returns the ceiled double value as an integer. On WIN32 platforms, this function uses a faster implementation using inline assembler.

Definition at line 74 of file CSOMath.h.

References ceil(), ceilToInt(), and MLCSO_EXPORT.

Referenced by ceilToInt().

◆ computeArea()

MLCSO_EXPORT double ml::CSOMath::computeArea ( const std::vector< Vector3 > & points,
const Vector3 & normal )

Computes the area of the polygon that is given as a list of points.

References computeArea(), and MLCSO_EXPORT.

Referenced by computeArea().

◆ computeAreaAndCenterOfGravity()

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 that is 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.

Parameters
[in]pointsThe points that define the polygon.
[in]normalThe normal vector of the plane that contains the polygon points.
[in]centerPointThe 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]areaReturn parameter for the calculated area of the polygon.
[out]centerOfGravityReturn parameter for the calculated center of gravity of the polygon.
Returns
See parameters area and centerOfGravity.

References computeAreaAndCenterOfGravity(), and MLCSO_EXPORT.

Referenced by computeAreaAndCenterOfGravity().

◆ computeDirectionDotProduct()

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.

References computeDirectionDotProduct(), and MLCSO_EXPORT.

Referenced by computeDirectionDotProduct().

◆ floorToInt()

MLCSO_EXPORT int ml::CSOMath::floorToInt ( const double x)
inline

Returns the floored double value as an integer. On WIN32 platforms, this function uses a faster implementation using inline assembler.

Definition at line 59 of file CSOMath.h.

References floor(), floorToInt(), and MLCSO_EXPORT.

Referenced by floorToInt().

◆ getHashKeyForMatrix4()

MLCSO_EXPORT size_t ml::CSOMath::getHashKeyForMatrix4 ( const ml::Matrix4 & matrix)

Returns a hash key for a given matrix.

References getHashKeyForMatrix4(), and MLCSO_EXPORT.

Referenced by getHashKeyForMatrix4().

Variable Documentation

◆ smallNumber

const double ml::CSOMath::smallNumber = 10e-10

Definition at line 39 of file CSOMath.h.