ExactPredicates2DInterface Class Reference

#include <exactpredicates2d.h>

Detailed Description

2D exact geometrical predicates. Based on Shewchuk's adaptive exact predicates.

Static Public Member Functions

static MAXON_METHOD Float Orient (const Vector2d &pointA, const Vector2d &pointB, const Vector2d &pointC)
 
static MAXON_METHOD Float InCircle (const Vector2d &pointA, const Vector2d &pointB, const Vector2d &pointC, const Vector2d &testPoint)
 
static MAXON_METHOD Result< FloatInTriangle (const Vector2d &pointA, const Vector2d &pointB, const Vector2d &pointC, const Vector2d &testPoint)
 
static MAXON_METHOD Result< FloatInSector (const Vector2d &center, const Vector2d &rayA, const Vector2d &rayB, const Vector2d &testPoint)
 
static MAXON_METHOD Result< BoolOutlineSelfIntersectionTest (const Block< const Vector2d > &outline)
 
static MAXON_METHOD Result< BoolOutlinesIntersectionTest (const Block< const Vector2d > &outline1, const Block< const Vector2d > &outline2)
 
static MAXON_METHOD Result< BoolOutlinesIntersectionTest (const Block< const Block< const Vector2d >> &outlines)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (ExactPredicates2DInterface, MAXON_REFERENCE_STATIC, "net.maxon.interface.exactpredicates2d")
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( ExactPredicates2DInterface  ,
MAXON_REFERENCE_STATIC  ,
"net.maxon.interface.exactpredicates2d"   
)
private

◆ Orient()

static MAXON_METHOD Float Orient ( const Vector2d pointA,
const Vector2d pointB,
const Vector2d pointC 
)
static

Gets orientation of three points.

Parameters
[in]pointAFirst point.
[in]pointBSecond point.
[in]pointCThird point.
Returns
Positive (negative) value if orientation is counter-clockwise (clockwise), zero otherwise.

◆ InCircle()

static MAXON_METHOD Float InCircle ( const Vector2d pointA,
const Vector2d pointB,
const Vector2d pointC,
const Vector2d testPoint 
)
static

Tests if a point is inside the circumscribed circle of a triangle defined by three points.

Parameters
[in]pointAFirst point.
[in]pointBSecond point.
[in]pointCThird point.
[in]testPointTest point.
Returns
Positive (negative) value if the point is inside (outside) the circle, zero if it is on the circle.

◆ InTriangle()

static MAXON_METHOD Result<Float> InTriangle ( const Vector2d pointA,
const Vector2d pointB,
const Vector2d pointC,
const Vector2d testPoint 
)
static

Tests if a point is inside a triangle defined by three points.

Parameters
[in]pointAFirst point.
[in]pointBSecond point.
[in]pointCThird point.
[in]testPointTest point.
Precondition
Three triangle points shall differ.
Returns
Positive (negative) value if the point is inside (outside) the triangle, zero if it is on the triangle boundary.

◆ InSector()

static MAXON_METHOD Result<Float> InSector ( const Vector2d center,
const Vector2d rayA,
const Vector2d rayB,
const Vector2d testPoint 
)
static

Checks if the test point lies inside a space sector.

Check if the test point lies inside the space sector defined by a center point and two rays (ccw order).

Parameters
[in]centerSector center.
[in]rayASector first ray.
[in]rayBSector second ray (ccw w.r.t the above parameters).
[in]testPointTest Point.
Precondition
Center and ray points shall differ.
Sector angle shall be less than 180 degree (not reflex).
Returns
Positive/zero/negative if the test point @testPoint is in/on/outside the sector respectively.

◆ OutlineSelfIntersectionTest()

static MAXON_METHOD Result<Bool> OutlineSelfIntersectionTest ( const Block< const Vector2d > &  outline)
static

Tests if a closed outline is self-intersected or have duplicated points.

Parameters
[in]outlineInput outline.
Returns
Outlines is self-intersected.

◆ OutlinesIntersectionTest() [1/2]

static MAXON_METHOD Result<Bool> OutlinesIntersectionTest ( const Block< const Vector2d > &  outline1,
const Block< const Vector2d > &  outline2 
)
static

Tests if two closed outlines intersect or either polyline is self-intersected.

Tests if two closed outlines intersect in at least one point or at least one of them is self-intersected or have duplicated points.

Precondition
Each outline has at least 3 points.
Parameters
[in]outline1First outline.
[in]outline2Second outline.
Returns
Outlines intersect.

◆ OutlinesIntersectionTest() [2/2]

static MAXON_METHOD Result<Bool> OutlinesIntersectionTest ( const Block< const Block< const Vector2d >> &  outlines)
static

Tests if a set of closed outlines intersect or if either polyline is self-intersected.

Tests if a set of closed outlines intersect in at least one point or at least one of them is self-intersected or has duplicated points.

Precondition
Each outline has at least 3 points.
Parameters
[in]outlinesInput outlines.
Returns
Outlines intersect.