Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
triang.c File Reference
#include <assert.h>
#include <cgraph/alloc.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <pathplan/pathutil.h>
#include <pathplan/tri.h>
Include dependency graph for triang.c:

Go to the source code of this file.

Functions

static int triangulate (Ppoint_t **pointp, int pointn, void(*fn)(void *, Ppoint_t *), void *vc)
 
int ccw (Ppoint_t p1, Ppoint_t p2, Ppoint_t p3)
 are the given points counter-clockwise, clockwise, or co-linear?
 
static Ppoint_t point_indexer (void *base, int index)
 
int Ptriangulate (Ppoly_t *polygon, void(*fn)(void *, Ppoint_t *), void *vc)
 
bool isdiagonal (int i, int ip2, void *pointp, int pointn, indexer_t indexer)
 is (i, i + 2) a diagonal?
 
bool intersects (Ppoint_t pa, Ppoint_t pb, Ppoint_t pc, Ppoint_t pd)
 line to line intersection
 
bool between (Ppoint_t pa, Ppoint_t pb, Ppoint_t pc)
 is pb between pa and pc?
 

Function Documentation

◆ between()

bool between ( Ppoint_t  pa,
Ppoint_t  pb,
Ppoint_t  pc 
)

Definition at line 142 of file triang.c.

References ccw(), ISON, Pxy_t::x, and Pxy_t::y.

Referenced by intersects().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ccw()

int ccw ( Ppoint_t  p1,
Ppoint_t  p2,
Ppoint_t  p3 
)

Definition at line 24 of file triang.c.

References ISCCW, ISCW, ISON, Pxy_t::x, and Pxy_t::y.

Referenced by between(), convert(), finddqsplit(), intersects(), isdiagonal(), pointintri(), and Pshortestpath().

Here is the caller graph for this function:

◆ intersects()

bool intersects ( Ppoint_t  pa,
Ppoint_t  pb,
Ppoint_t  pc,
Ppoint_t  pd 
)

Definition at line 124 of file triang.c.

References between(), ccw(), ISCCW, and ISON.

Referenced by isdiagonal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isdiagonal()

bool isdiagonal ( int  i,
int  ip2,
void *  pointp,
int  pointn,
indexer_t  indexer 
)

Definition at line 95 of file triang.c.

References ccw(), intersects(), ISCCW, and ISCW.

Referenced by triangulate(), and triangulate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ point_indexer()

static Ppoint_t point_indexer ( void *  base,
int  index 
)
static

Definition at line 29 of file triang.c.

Referenced by triangulate().

Here is the caller graph for this function:

◆ Ptriangulate()

int Ptriangulate ( Ppoly_t polygon,
void(*)(void *, Ppoint_t *)  fn,
void *  vc 
)

Definition at line 37 of file triang.c.

References free(), gv_calloc(), and triangulate().

Here is the call graph for this function:

◆ triangulate()

static int triangulate ( Ppoint_t **  pointp,
int  pointn,
void(*)(void *, Ppoint_t *)  fn,
void *  vc 
)
static

Definition at line 64 of file triang.c.

References A, isdiagonal(), point_indexer(), and triangulate().

Referenced by Ptriangulate(), and triangulate().

Here is the call graph for this function:
Here is the caller graph for this function: