MeVisLab Toolbox Reference
ml::WEMGeometry Namespace Reference

Tool namespace for performing geometric operations on a WEMPatch. More...

Functions

MLWEM_EXPORT bool isPointInsideWEMPatch (const Vector3 &position, WEMPatch *wemPatch)
 Returns whether the given point is inside the given WEMPatch.
 
MLWEM_EXPORT bool isLineIntersectingFace (const Vector3 &startPos, const Vector3 &endPos, WEMFace *face, WEMPatch *wemPatch=nullptr)
 Returns whether the given line (from startPos to endPos) intersects the given WEMFace. The wemPatch parameter is not in use and per default NULL.
 
MLWEM_EXPORT bool isLineIntersectingFace (Vector3 &intersectionPoint, const Vector3 &startPos, const Vector3 &endPos, WEMFace *face, WEMPatch *wemPatch=nullptr)
 Returns whether the given line (from startPos to endPos) intersects the given WEMFace and fills up the intersection point.
 
MLWEM_EXPORT bool pointInsidePolygon (const Vector3 &point, const Vector3 *polygon, unsigned int numPoints)
 Returns whether the given point lies inside the polygon, given by the list of points.
 
MLWEM_EXPORT bool isPointOnEdgeOrNode (const Vector3 &position, WEMFace *face)
 Returns whether the given point lies on any node or edge of the given face.
 
MLWEM_EXPORT bool isPointOnFace (const Vector3 &position, WEMFace *face)
 Returns whether the given point lies on any face of the given face.
 
MLWEM_EXPORT bool isPointInsideFace (const Vector3 &point, const WEMFace *face)
 Returns whether the given point is in the given face.
 
MLWEM_EXPORT bool checkForEdgeNodeCrossing (const Vector3 &rayStart, const Vector3 &rayEnd, WEMFace *face)
 Returns whether the given ray crosses any edge or node of the given face.
 
MLWEM_EXPORT double computeSegmentSegmentDistance (const Vector3 &start0, const Vector3 &end0, const Vector3 &start1, const Vector3 &end1, Vector3 &intersectionPoint)
 Returns the minimum distance between the two given segments. If this distance is 0, the intersectionPoint is valid.
 
MLWEM_EXPORT double computePointSegmentDistance (const Vector3 &point, const Vector3 &segmentStart, const Vector3 &segmentEnd)
 Returns the shortest distance of a given point to a segment, given by its start and end point.
 
MLWEM_EXPORT double computePointPlaneDistance (const Vector3 &point, const WEMFace *face)
 Returns the distance of the given point to a plane, defined by the WEMFace (first position and normal of the face).
 
MLWEM_EXPORT double computePointTriangleDistance (const Vector3 &point, const WEMTriangle *triangle)
 Returns the distance of the given point to the given triangle.
 
bool doLineSegmentsIntersect2D (const Vector2 &s1, const Vector2 &e1, const Vector2 &s2, const Vector2 &e2)
 
bool isOnSegmentFor2DSegmentIntersectionTest (double xi, double yi, double xj, double yj, double xk, double yk)
 
char computeDirectionFor2DSegmentIntersectionTest (double xi, double yi, double xj, double yj, double xk, double yk)
 

Detailed Description

Tool namespace for performing geometric operations on a WEMPatch.

If you are looking for fast WEM ray intersection, have a look at the WEMBoundingVolumeHierarchy class in the MLWEMAcceleration project.

Function Documentation

◆ checkForEdgeNodeCrossing()

MLWEM_EXPORT bool ml::WEMGeometry::checkForEdgeNodeCrossing ( const Vector3 & rayStart,
const Vector3 & rayEnd,
WEMFace * face )

Returns whether the given ray crosses any edge or node of the given face.

References checkForEdgeNodeCrossing().

Referenced by checkForEdgeNodeCrossing().

◆ computeDirectionFor2DSegmentIntersectionTest()

char ml::WEMGeometry::computeDirectionFor2DSegmentIntersectionTest ( double xi,
double yi,
double xj,
double yj,
double xk,
double yk )

◆ computePointPlaneDistance()

MLWEM_EXPORT double ml::WEMGeometry::computePointPlaneDistance ( const Vector3 & point,
const WEMFace * face )

Returns the distance of the given point to a plane, defined by the WEMFace (first position and normal of the face).

References computePointPlaneDistance().

Referenced by computePointPlaneDistance().

◆ computePointSegmentDistance()

MLWEM_EXPORT double ml::WEMGeometry::computePointSegmentDistance ( const Vector3 & point,
const Vector3 & segmentStart,
const Vector3 & segmentEnd )

Returns the shortest distance of a given point to a segment, given by its start and end point.

References computePointSegmentDistance().

Referenced by computePointSegmentDistance().

◆ computePointTriangleDistance()

MLWEM_EXPORT double ml::WEMGeometry::computePointTriangleDistance ( const Vector3 & point,
const WEMTriangle * triangle )

Returns the distance of the given point to the given triangle.

References computePointTriangleDistance().

Referenced by computePointTriangleDistance().

◆ computeSegmentSegmentDistance()

MLWEM_EXPORT double ml::WEMGeometry::computeSegmentSegmentDistance ( const Vector3 & start0,
const Vector3 & end0,
const Vector3 & start1,
const Vector3 & end1,
Vector3 & intersectionPoint )

Returns the minimum distance between the two given segments. If this distance is 0, the intersectionPoint is valid.

References computeSegmentSegmentDistance().

Referenced by computeSegmentSegmentDistance().

◆ doLineSegmentsIntersect2D()

bool ml::WEMGeometry::doLineSegmentsIntersect2D ( const Vector2 & s1,
const Vector2 & e1,
const Vector2 & s2,
const Vector2 & e2 )

◆ isLineIntersectingFace() [1/2]

MLWEM_EXPORT bool ml::WEMGeometry::isLineIntersectingFace ( const Vector3 & startPos,
const Vector3 & endPos,
WEMFace * face,
WEMPatch * wemPatch = nullptr )

Returns whether the given line (from startPos to endPos) intersects the given WEMFace. The wemPatch parameter is not in use and per default NULL.

References isLineIntersectingFace().

Referenced by isLineIntersectingFace(), and isLineIntersectingFace().

◆ isLineIntersectingFace() [2/2]

MLWEM_EXPORT bool ml::WEMGeometry::isLineIntersectingFace ( Vector3 & intersectionPoint,
const Vector3 & startPos,
const Vector3 & endPos,
WEMFace * face,
WEMPatch * wemPatch = nullptr )

Returns whether the given line (from startPos to endPos) intersects the given WEMFace and fills up the intersection point.

References isLineIntersectingFace().

◆ isOnSegmentFor2DSegmentIntersectionTest()

bool ml::WEMGeometry::isOnSegmentFor2DSegmentIntersectionTest ( double xi,
double yi,
double xj,
double yj,
double xk,
double yk )

◆ isPointInsideFace()

MLWEM_EXPORT bool ml::WEMGeometry::isPointInsideFace ( const Vector3 & point,
const WEMFace * face )

Returns whether the given point is in the given face.

References isPointInsideFace().

Referenced by isPointInsideFace().

◆ isPointInsideWEMPatch()

MLWEM_EXPORT bool ml::WEMGeometry::isPointInsideWEMPatch ( const Vector3 & position,
WEMPatch * wemPatch )

Returns whether the given point is inside the given WEMPatch.

A point is considered to be inside if it lies exactly on a node, edge, or face.

References isPointInsideWEMPatch().

Referenced by isPointInsideWEMPatch().

◆ isPointOnEdgeOrNode()

MLWEM_EXPORT bool ml::WEMGeometry::isPointOnEdgeOrNode ( const Vector3 & position,
WEMFace * face )

Returns whether the given point lies on any node or edge of the given face.

References isPointOnEdgeOrNode().

Referenced by isPointOnEdgeOrNode().

◆ isPointOnFace()

MLWEM_EXPORT bool ml::WEMGeometry::isPointOnFace ( const Vector3 & position,
WEMFace * face )

Returns whether the given point lies on any face of the given face.

References isPointOnFace().

Referenced by isPointOnFace().

◆ pointInsidePolygon()

MLWEM_EXPORT bool ml::WEMGeometry::pointInsidePolygon ( const Vector3 & point,
const Vector3 * polygon,
unsigned int numPoints )

Returns whether the given point lies inside the polygon, given by the list of points.

Both, the point and the polygon, must be projected onto the x-y plane before.

References pointInsidePolygon().

Referenced by pointInsidePolygon().