ml::CSOMath Class Reference

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

#include <CSOMath.h>

List of all members.

Public Member Functions

 CSOMath ()
 Constructor.
 ~CSOMath ()
 Destructor.

Static Public Member Functions

static void init ()
 Initializes the CSOMath module.
static double computeArea (const std::vector< Vector3 > &points, const Vector3 &normal)
 Computes the area of the polygon, given as a list of points.
static void 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.
static Vector3 mapWorldToVoxel (const Vector3 &worldPos, const CSO *cso)
 Computes the voxel position of a given world position with the matrix of the given CSO.
static void mapWorldToVoxel (const Vector3 &worldPos, Vector3 &voxelPos, const CSO *cso)
 Computes the voxel position of a given world position with the matrix of the given CSO.
static int floorToInt (const double x)
 Returns the floored double value as an integer.
static int ceilToInt (const double x)
 Returns the ceiled double value as an integer.
static float fast_log (float value)
 Calculates the natural logarithm based on an approximation using a look up table.
static 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.
static bool computeIsInPlane (const CSO *cso, Vector3 &planeNormal)
static bool isSelfIntersecting (const std::vector< Vector3 > &positions, bool isClosed)
static bool isSelfIntersecting (const std::vector< Vector3 > &positions, std::vector< Vector3 > &intersectPoints, bool isClosed)
static bool isSelfIntersecting (const CSO *cso)
static bool isSelfIntersecting (const CSO *cso, std::vector< Vector3 > &intersectPositions)
static double computeSegmentSegmentDistance (const Vector3 &start0, const Vector3 &end0, const Vector3 &start1, const Vector3 &end1, Vector3 &intersectionPoint, bool &isParallel)
static double computeSegmentSegmentDistance (const Vector3 &start0, const Vector3 &end0, const Vector3 &start1, const Vector3 &end1, Vector3 &intersectionPoint)
static bool areInSamePlane (CSO *cso0, CSO *cso1)
static bool computeUnionIntersectionCSOs (CSO *, CSO *, CSO *, CSO *)
static void rotateAndProject (Rotation &rot, Vector3 &voxelPos, bool shouldProject=true)
static void level (CSO *cso)
static bool isPointInsidePolygon (const std::vector< Vector3 > &polygonPoints, const Vector3 &point)
static void appendUniquePosition (std::vector< Vector3 > &positions, Vector3 pos)
static Vector3 getCenterOfGravity (CSO *cso, bool considerSeedPointsExtra=false)
static double distanceToLine (const Vector3 &point, const Vector3 &linePoint1, const Vector3 &linePoint2)

Static Public Attributes

static const double smallNumber
 A small number for comparisons.


Detailed Description

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

Definition at line 31 of file CSOMath.h.


Constructor & Destructor Documentation

ml::CSOMath::CSOMath (  ) 

Constructor.

ml::CSOMath::~CSOMath (  ) 

Destructor.


Member Function Documentation

static void ml::CSOMath::appendUniquePosition ( std::vector< Vector3 > &  positions,
Vector3  pos 
) [inline, static]

Deprecated:
Call the method from CSOGeometry directly.

Definition at line 147 of file CSOMath.h.

static bool ml::CSOMath::areInSamePlane ( CSO cso0,
CSO cso1 
) [inline, static]

Deprecated:
Call the method from CSOGeometry directly.

Definition at line 129 of file CSOMath.h.

static int ml::CSOMath::ceilToInt ( const double  x  )  [inline, static]

Returns the ceiled double value as an integer.

On WIN32 platforms this function uses a faster implementation using inline assembler.

Definition at line 71 of file CSOMath.h.

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

Computes the area of the polygon, given as a list of points.

static void ml::CSOMath::computeAreaAndCenterOfGravity ( const std::vector< Vector3 > &  points,
const Vector3 normal,
const Vector3 centerPoint,
double &  area,
Vector3 centerOfGravity 
) [static]

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.

static double ml::CSOMath::computeDirectionDotProduct ( const Vector3 predPos,
const Vector3 middlePos,
const Vector3 succPos 
) [static]

Computes and returns the dot product of the direction vectors of pred-middle and middle-succ.

static bool ml::CSOMath::computeIsInPlane ( const CSO cso,
Vector3 planeNormal 
) [inline, static]

Deprecated:
Call the method from CSOGeometry directly.

Definition at line 106 of file CSOMath.h.

static double ml::CSOMath::computeSegmentSegmentDistance ( const Vector3 start0,
const Vector3 end0,
const Vector3 start1,
const Vector3 end1,
Vector3 intersectionPoint 
) [inline, static]

Deprecated:
Call the method from CSOGeometry directly.

Definition at line 125 of file CSOMath.h.

static double ml::CSOMath::computeSegmentSegmentDistance ( const Vector3 start0,
const Vector3 end0,
const Vector3 start1,
const Vector3 end1,
Vector3 intersectionPoint,
bool &  isParallel 
) [inline, static]

Deprecated:
Call the method from CSOGeometry directly.

Definition at line 121 of file CSOMath.h.

static bool ml::CSOMath::computeUnionIntersectionCSOs ( CSO ,
CSO ,
CSO ,
CSO  
) [inline, static]

Deprecated:
Method has been removed.

Definition at line 132 of file CSOMath.h.

static double ml::CSOMath::distanceToLine ( const Vector3 point,
const Vector3 linePoint1,
const Vector3 linePoint2 
) [inline, static]

Deprecated:
Call the method from CSOGeometry directly.

Definition at line 155 of file CSOMath.h.

static float ml::CSOMath::fast_log ( float  value  )  [inline, static]

Calculates the natural logarithm based on an approximation using a look up table.

No bounds checking is performed and thus only values >0 are allowed as parameter.

Definition at line 85 of file CSOMath.h.

static int ml::CSOMath::floorToInt ( const double  x  )  [inline, static]

Returns the floored double value as an integer.

On WIN32 platforms this function uses a faster implementation using inline assembler.

Definition at line 57 of file CSOMath.h.

static Vector3 ml::CSOMath::getCenterOfGravity ( CSO cso,
bool  considerSeedPointsExtra = false 
) [inline, static]

Deprecated:
Call the method from CSOGeometry directly.

Definition at line 151 of file CSOMath.h.

static void ml::CSOMath::init (  )  [static]

Initializes the CSOMath module.

static bool ml::CSOMath::isPointInsidePolygon ( const std::vector< Vector3 > &  polygonPoints,
const Vector3 point 
) [inline, static]

Deprecated:
Call the method from CSOGeometry directly.

Definition at line 143 of file CSOMath.h.

static bool ml::CSOMath::isSelfIntersecting ( const CSO cso,
std::vector< Vector3 > &  intersectPositions 
) [inline, static]

Deprecated:
Call the method from CSOGeometry directly.

Definition at line 118 of file CSOMath.h.

static bool ml::CSOMath::isSelfIntersecting ( const CSO cso  )  [inline, static]

Deprecated:
Call the method from CSOGeometry directly.

Definition at line 115 of file CSOMath.h.

static bool ml::CSOMath::isSelfIntersecting ( const std::vector< Vector3 > &  positions,
std::vector< Vector3 > &  intersectPoints,
bool  isClosed 
) [inline, static]

Deprecated:
Call the method from CSOGeometry directly.

Definition at line 112 of file CSOMath.h.

static bool ml::CSOMath::isSelfIntersecting ( const std::vector< Vector3 > &  positions,
bool  isClosed 
) [inline, static]

Deprecated:
Call the method from CSOGeometry directly.

Definition at line 109 of file CSOMath.h.

static void ml::CSOMath::level ( CSO cso  )  [inline, static]

Deprecated:
Call the method from CSOGeometry directly.

Definition at line 140 of file CSOMath.h.

static void ml::CSOMath::mapWorldToVoxel ( const Vector3 worldPos,
Vector3 voxelPos,
const CSO cso 
) [static]

Computes the voxel position of a given world position with the matrix of the given CSO.

static Vector3 ml::CSOMath::mapWorldToVoxel ( const Vector3 worldPos,
const CSO cso 
) [static]

Computes the voxel position of a given world position with the matrix of the given CSO.

static void ml::CSOMath::rotateAndProject ( Rotation rot,
Vector3 voxelPos,
bool  shouldProject = true 
) [inline, static]

Deprecated:
Call the method from CSOGeometry directly.

Definition at line 136 of file CSOMath.h.


Member Data Documentation

const double ml::CSOMath::smallNumber [static]

A small number for comparisons.

Definition at line 100 of file CSOMath.h.


The documentation for this class was generated from the following file:

Generated on Sat Sep 3 18:39:42 2011 for MeVisLab Toolbox Reference by  doxygen 1.5.8