MobilityDB 1.3
Loading...
Searching...
No Matches

◆ liangBarskyClip()

static bool liangBarskyClip ( const GSERIALIZED point1,
const GSERIALIZED point2,
const STBox box,
bool  hasz,
bool  border_inc,
GSERIALIZED **  point3,
GSERIALIZED **  point4,
bool p3_inc,
bool p4_inc 
)
static

Clip a line segment using the Liang-Barsky algorithm.

Parameters
[in]point1,point2Input points
[in]boxBounding box
[in]haszHas Z dimension?
[in]border_incTrue when the box contains the upper border, otherwise the upper border is assumed as outside of the box.
[out]point3,point4Output points
[out]p3_inc,p4_incAre the points included or not in the box? These are only written/returned when border_inc is false
Returns
True if the line segment defined by p1,p2 intersects the bounding box, false otherwise.
Note
It is possible to mix 2D/3D geometries, the Z dimension is only considered if both the temporal point and the box have Z dimension
See also
The Liang-Barsky algorithm is explained in https://www.researchgate.net/publication/255657434_Some_Improvements_to_a_Parametric_Line_Clipping_Algorithm