Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
route.c File Reference
#include <assert.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <pathplan/pathutil.h>
#include <pathplan/solvers.h>
Include dependency graph for route.c:

Go to the source code of this file.

Data Structures

struct  tna_t
 

Macros

#define EPSILON1   1E-3
 
#define EPSILON2   1E-6
 
#define DISTSQ(a, b)
 
#define POINTSIZE   sizeof (Ppoint_t)
 

Typedefs

typedef struct tna_t tna_t
 

Functions

static int reallyroutespline (Pedge_t *, size_t, Ppoint_t *, int, Ppoint_t, Ppoint_t)
 
static int mkspline (Ppoint_t *, int, tna_t *, Ppoint_t, Ppoint_t, Ppoint_t *, Ppoint_t *, Ppoint_t *, Ppoint_t *)
 
static int splinefits (Pedge_t *, size_t, Ppoint_t, Pvector_t, Ppoint_t, Pvector_t, Ppoint_t *, int)
 
static int splineisinside (Pedge_t *, size_t, Ppoint_t *)
 
static int splineintersectsline (Ppoint_t *, Ppoint_t *, double *)
 
static void points2coeff (double, double, double, double, double *)
 
static void addroot (double, double *, int *)
 
static Pvector_t normv (Pvector_t)
 
static int growops (size_t)
 
static Ppoint_t add (Ppoint_t, Ppoint_t)
 
static Ppoint_t sub (Ppoint_t, Ppoint_t)
 
static double dist (Ppoint_t, Ppoint_t)
 
static Ppoint_t scale (Ppoint_t, double)
 
static double dot (Ppoint_t, Ppoint_t)
 
static double B0 (double t)
 
static double B1 (double t)
 
static double B2 (double t)
 
static double B3 (double t)
 
static double B01 (double t)
 
static double B23 (double t)
 
int Proutespline (Pedge_t *barriers, size_t n_barriers, Ppolyline_t input_route, Ppoint_t endpoint_slopes[2], Ppolyline_t *output_route)
 
static double dist_n (Ppoint_t *p, int n)
 

Variables

static Ppoint_tops
 
static size_t opn
 
static size_t opl
 

Macro Definition Documentation

◆ DISTSQ

#define DISTSQ (   a,
 
)
Value:
( \
(((a).x - (b).x) * ((a).x - (b).x)) + (((a).y - (b).y) * ((a).y - (b).y)) \
)

Definition at line 27 of file route.c.

◆ EPSILON1

#define EPSILON1   1E-3

Definition at line 19 of file route.c.

◆ EPSILON2

#define EPSILON2   1E-6

Definition at line 20 of file route.c.

◆ POINTSIZE

#define POINTSIZE   sizeof (Ppoint_t)

Definition at line 31 of file route.c.

Typedef Documentation

◆ tna_t

typedef struct tna_t tna_t

Function Documentation

◆ add()

static Ppoint_t add ( Ppoint_t  p1,
Ppoint_t  p2 
)
static

Definition at line 426 of file route.c.

References Pxy_t::x, and Pxy_t::y.

Referenced by eval(), mkspline(), and reallyroutespline().

Here is the caller graph for this function:

◆ addroot()

static void addroot ( double  root,
double *  roots,
int *  rootnp 
)
static

Definition at line 398 of file route.c.

Referenced by splineintersectsline().

Here is the caller graph for this function:

◆ B0()

static double B0 ( double  t)
static

Definition at line 457 of file route.c.

Referenced by reallyroutespline().

Here is the caller graph for this function:

◆ B01()

static double B01 ( double  t)
static

Definition at line 480 of file route.c.

Referenced by mkspline().

Here is the caller graph for this function:

◆ B1()

static double B1 ( double  t)
static

Definition at line 463 of file route.c.

Referenced by reallyroutespline().

Here is the caller graph for this function:

◆ B2()

static double B2 ( double  t)
static

Definition at line 469 of file route.c.

Referenced by reallyroutespline().

Here is the caller graph for this function:

◆ B23()

static double B23 ( double  t)
static

Definition at line 486 of file route.c.

Referenced by mkspline().

Here is the caller graph for this function:

◆ B3()

static double B3 ( double  t)
static

Definition at line 475 of file route.c.

Referenced by reallyroutespline().

Here is the caller graph for this function:

◆ dist()

static double dist ( Ppoint_t  p1,
Ppoint_t  p2 
)
static

Definition at line 438 of file route.c.

References dx, dy, Pxy_t::x, and Pxy_t::y.

Referenced by mkspline(), and reallyroutespline().

Here is the caller graph for this function:

◆ dist_n()

static double dist_n ( Ppoint_t p,
int  n 
)
static

Definition at line 195 of file route.c.

Referenced by splinefits().

Here is the caller graph for this function:

◆ dot()

static double dot ( Ppoint_t  p1,
Ppoint_t  p2 
)
static

Definition at line 452 of file route.c.

References Pxy_t::x, and Pxy_t::y.

◆ growops()

static int growops ( size_t  newopn)
static

Definition at line 416 of file route.c.

References opn, ops, and POINTSIZE.

Referenced by Proutespline(), and splinefits().

Here is the caller graph for this function:

◆ mkspline()

static int mkspline ( Ppoint_t inps,
int  inpn,
tna_t tnas,
Ppoint_t  ev0,
Ppoint_t  ev1,
Ppoint_t sp0,
Ppoint_t sv0,
Ppoint_t sp1,
Ppoint_t sv1 
)
static

Definition at line 154 of file route.c.

References add(), B01(), B23(), dist(), dot, scale(), and sub.

Referenced by reallyroutespline().

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

◆ normv()

static Pvector_t normv ( Pvector_t  v)
static

Definition at line 404 of file route.c.

References Pxy_t::x, and Pxy_t::y.

Referenced by Proutespline(), and reallyroutespline().

Here is the caller graph for this function:

◆ points2coeff()

static void points2coeff ( double  v0,
double  v1,
double  v2,
double  v3,
double *  coeff 
)
static

Definition at line 389 of file route.c.

Referenced by splineintersectsline().

Here is the caller graph for this function:

◆ Proutespline()

int Proutespline ( Pedge_t barriers,
size_t  n_barriers,
Ppolyline_t  input_route,
Ppoint_t  endpoint_slopes[2],
Ppolyline_t output_route 
)

Definition at line 69 of file route.c.

References growops(), normv(), opl, ops, Ppoly_t::pn, Ppoly_t::ps, and reallyroutespline().

Referenced by genroute(), makeSpline(), routesplines_(), simpleSplineRoute(), and vgpanecmd().

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

◆ reallyroutespline()

static int reallyroutespline ( Pedge_t edges,
size_t  edgen,
Ppoint_t inps,
int  inpn,
Ppoint_t  ev0,
Ppoint_t  ev1 
)
static

Definition at line 96 of file route.c.

References tna_t::a, add(), B0(), B1(), B2(), B3(), dist(), mkspline(), normv(), NULL, reallyroutespline(), scale(), splinefits(), sub, tna_t::t, Pxy_t::x, and Pxy_t::y.

Referenced by Proutespline(), and reallyroutespline().

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

◆ scale()

static Ppoint_t scale ( Ppoint_t  p,
double  c 
)
static

Definition at line 446 of file route.c.

References Pxy_t::x, and Pxy_t::y.

Referenced by mkspline(), and reallyroutespline().

Here is the caller graph for this function:

◆ splinefits()

static int splinefits ( Pedge_t edges,
size_t  edgen,
Ppoint_t  pa,
Pvector_t  va,
Ppoint_t  pb,
Pvector_t  vb,
Ppoint_t inps,
int  inpn 
)
static

Definition at line 207 of file route.c.

References dist_n(), EPSILON1, growops(), opl, ops, splineisinside(), Pxy_t::x, and Pxy_t::y.

Referenced by reallyroutespline().

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

◆ splineintersectsline()

static int splineintersectsline ( Ppoint_t sps,
Ppoint_t lps,
double *  roots 
)
static

Definition at line 309 of file route.c.

References addroot(), points2coeff(), solve3(), Pxy_t::x, and Pxy_t::y.

Referenced by splineisinside().

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

◆ splineisinside()

static int splineisinside ( Pedge_t edges,
size_t  edgen,
Ppoint_t sps 
)
static

Definition at line 278 of file route.c.

References Pedge_t::a, Pedge_t::b, DISTSQ, EPSILON1, EPSILON2, splineintersectsline(), Pxy_t::x, and Pxy_t::y.

Referenced by splinefits().

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

◆ sub()

static Ppoint_t sub ( Ppoint_t  p1,
Ppoint_t  p2 
)
static

Definition at line 432 of file route.c.

References Pxy_t::x, and Pxy_t::y.

Variable Documentation

◆ opl

size_t opl
static

Definition at line 34 of file route.c.

Referenced by Proutespline(), and splinefits().

◆ opn

size_t opn
static

Definition at line 34 of file route.c.

Referenced by growops(), and Pobspath().

◆ ops

Ppoint_t* ops
static

Definition at line 33 of file route.c.

Referenced by growops(), parseOp(), parseXDotFOn(), Pobspath(), Proutespline(), and splinefits().