returns the kind of CG_SEGMENT_INTERSECTION_TYPE behavior of lineseg 1 (constructed from p1 and p2) and lineseg 2 (constructed from q1 and q2)
- Parameters
-
| p1 | start point of first straight linesegment |
| p2 | end point of first straight linesegment |
| q1 | start point of second line segment |
| q2 | end point of second line segment |
- Returns
- a CG_SEGMENT_INTERSECTION_TYPE Returns one of SEG_ERROR = -1, SEG_NO_INTERSECTION = 0, SEG_COLINEAR = 1, SEG_CROSS_LEFT = 2, SEG_CROSS_RIGHT = 3,
Definition at line 373 of file lwalgorithm.c.
374{
375
376 int pq1, pq2, qp1, qp2;
377
378
380 {
382 }
383
384
387 if ((pq1>0 && pq2>0) || (pq1<0 && pq2<0))
388 {
390 }
391
392
395 if ( (qp1 > 0.0 && qp2 > 0.0) || (qp1 < 0.0 && qp2 < 0.0) )
396 {
398 }
399
400
401 if ( pq1 == 0.0 && pq2 == 0.0 && qp1 == 0.0 && qp2 == 0.0 )
402 {
404 }
405
406
407
408
409
410
411 LWDEBUGF(4,
"pq1=%.15g pq2=%.15g", pq1, pq2);
412 LWDEBUGF(4,
"qp1=%.15g qp2=%.15g", qp1, qp2);
413
414
415 if ( pq2 == 0 || qp2 == 0 )
416 {
418 }
419
420
421 if ( pq1 == 0 )
422 {
423 if ( pq2 > 0 )
425 else
427 }
428
429
430 if ( qp1 == 0 )
431 {
432 if ( pq1 < pq2 )
434 else
436 }
437
438
439 if ( pq1 < pq2 )
441 else
443
444
446}
static int lw_seg_interact(const POINT2D *p1, const POINT2D *p2, const POINT2D *q1, const POINT2D *q2)
int lw_segment_side(const POINT2D *p1, const POINT2D *p2, const POINT2D *q)
lw_segment_side()
#define LWDEBUGF(level, msg,...)
References lw_seg_interact(), lw_segment_side(), LWDEBUGF, SEG_COLINEAR, SEG_CROSS_LEFT, SEG_CROSS_RIGHT, SEG_ERROR, and SEG_NO_INTERSECTION.
Referenced by lwline_crossing_direction(), rect_leaf_node_intersects(), and test_lw_segment_intersects().