MeVisLab Toolbox Reference
WEMGeometry.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2007, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 
15 
16 #pragma once
17 
19 
20 ML_START_NAMESPACE
21 
23 
27 namespace WEMGeometry
28 {
31  MLWEM_EXPORT bool isPointInsideWEMPatch(const Vector3& position, WEMPatch* wemPatch);
32 
34  MLWEM_EXPORT bool isLineIntersectingFace(const Vector3& startPos, const Vector3& endPos, WEMFace* face, WEMPatch* wemPatch=nullptr);
36  MLWEM_EXPORT bool isLineIntersectingFace(Vector3& intersectionPoint, const Vector3& startPos, const Vector3& endPos, WEMFace* face, WEMPatch* wemPatch=nullptr);
37 
40  MLWEM_EXPORT bool pointInsidePolygon(const Vector3& point, const Vector3* polygon, unsigned int numPoints);
41 
43  MLWEM_EXPORT bool isPointOnEdgeOrNode(const Vector3& position, WEMFace* face);
45  MLWEM_EXPORT bool isPointOnFace(const Vector3& position, WEMFace* face);
46 
48  MLWEM_EXPORT bool isPointInsideFace(const Vector3& point, const WEMFace* face);
50  MLWEM_EXPORT bool checkForEdgeNodeCrossing(const Vector3& rayStart, const Vector3& rayEnd, WEMFace* face);
51 
53  MLWEM_EXPORT double computeSegmentSegmentDistance(const Vector3& start0, const Vector3& end0,
54  const Vector3& start1, const Vector3& end1,
55  Vector3& intersectionPoint);
56 
58  MLWEM_EXPORT double computePointSegmentDistance(const Vector3& point, const Vector3& segmentStart, const Vector3& segmentEnd);
59 
61  MLWEM_EXPORT double computePointPlaneDistance(const Vector3& point, const WEMFace* face);
62 
64  MLWEM_EXPORT double computePointTriangleDistance(const Vector3& point, const WEMTriangle* triangle);
65 
66  // not exporting the methods below
67  bool doLineSegmentsIntersect2D(const Vector2& s1, const Vector2& e1, const Vector2& s2, const Vector2& e2);
68  bool isOnSegmentFor2DSegmentIntersectionTest(double xi, double yi, double xj, double yj,double xk, double yk);
69  char computeDirectionFor2DSegmentIntersectionTest(double xi, double yi, double xj, double yj,double xk, double yk);
70 };
71 
73 
74 ML_END_NAMESPACE
#define MLWEM_EXPORT
Definition: MLWEMSystem.h:18
Defines the mesh component: face.
Definition: WEMFace.h:30
Base class for triangle and quad patches.
Definition: WEMPatch.h:48
Defines the mesh component: triangle.
Definition: WEMTriangle.h:27
bool isOnSegmentFor2DSegmentIntersectionTest(double xi, double yi, double xj, double yj, double xk, double yk)
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...
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 th...
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 bool isPointInsideWEMPatch(const Vector3 &position, WEMPatch *wemPatch)
Returns whether the given point is inside the given WEMPatch.
MLWEM_EXPORT bool isPointInsideFace(const Vector3 &point, const WEMFace *face)
Returns whether the given point is in the given face.
bool doLineSegmentsIntersect2D(const Vector2 &s1, const Vector2 &e1, const Vector2 &s2, const Vector2 &e2)
MLWEM_EXPORT double computePointTriangleDistance(const Vector3 &point, const WEMTriangle *triangle)
Returns the distance of the given point to the given triangle.
MLWEM_EXPORT bool isPointOnFace(const Vector3 &position, WEMFace *face)
Returns whether the given point lies on any face 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,...
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.
char computeDirectionFor2DSegmentIntersectionTest(double xi, double yi, double xj, double yj, double xk, double yk)
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 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.