Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
tclpathplan.c File Reference
#include "config.h"
#include <sys/types.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <assert.h>
#include <cgraph/agxbuf.h>
#include <cgraph/alloc.h>
#include <cgraph/list.h>
#include <limits.h>
#include "makecw.h"
#include <math.h>
#include <pathplan/pathutil.h>
#include <pathplan/vispath.h>
#include <pathplan/tri.h>
#include "Plegal_arrangement.h"
#include <tcl.h>
#include "tclhandle.h"
Include dependency graph for tclpathplan.c:

Go to the source code of this file.

Data Structures

struct  poly_s
 
struct  vgpane_s
 

Macros

#define USE_NON_CONST
 
#define CONST84
 
#define Tcl_GetStringResult(interp)   interp->result
 

Typedefs

typedef Ppoint_t point
 
typedef struct poly_s poly
 
typedef struct vgpane_s vgpane_t
 

Functions

static polyallocpoly (vgpane_t *vgp, int id, int npts)
 
static void vc_stale (vgpane_t *vgp)
 
static int vc_refresh (vgpane_t *vgp)
 
static void dgsprintxy (Tcl_DString *result, int npts, point p[])
 
static void expandPercentsEval (Tcl_Interp *interp, char *before, char *r, int npts, point *ppos)
 
static void triangle_callback (void *vgparg, point pqr[])
 
static char * buildBindings (char *s1, const char *s2)
 
static int scanpoint (Tcl_Interp *interp, char *argv[], point *p)
 
static point center (point vertex[], size_t n)
 
static double distance (point p, point q)
 
static point rotate (point c, point p, double alpha)
 
static point scale (point c, point p, double gain)
 
static bool remove_poly (vgpane_t *vgp, int id)
 
static int insert_poly (Tcl_Interp *interp, vgpane_t *vgp, int id, char *vargv[], int vargc)
 
static void make_barriers (vgpane_t *vgp, int pp, int qp, Pedge_t **barriers, size_t *n_barriers)
 
static void appendpoint (Tcl_Interp *interp, point p)
 
static int vgpanecmd (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
 
static int vgpane (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
 
int Tclpathplan_Init (Tcl_Interp *interp)
 
int Tclpathplan_SafeInit (Tcl_Interp *interp)
 

Variables

tblHeader_pt vgpaneTable
 
static int polyid = 0
 

Macro Definition Documentation

◆ CONST84

#define CONST84

Definition at line 46 of file tclpathplan.c.

◆ Tcl_GetStringResult

#define Tcl_GetStringResult (   interp)    interp->result

Definition at line 52 of file tclpathplan.c.

◆ USE_NON_CONST

#define USE_NON_CONST

Definition at line 22 of file tclpathplan.c.

Typedef Documentation

◆ point

typedef Ppoint_t point

Definition at line 56 of file tclpathplan.c.

◆ poly

typedef struct poly_s poly

◆ vgpane_t

typedef struct vgpane_s vgpane_t

Function Documentation

◆ allocpoly()

static poly * allocpoly ( vgpane_t vgp,
int  id,
int  npts 
)
static

Definition at line 76 of file tclpathplan.c.

References poly_s::boundary, gv_calloc(), Ppoly_t::pn, vgpane_s::poly, and Ppoly_t::ps.

Referenced by insert_poly().

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

◆ appendpoint()

static void appendpoint ( Tcl_Interp *  interp,
point  p 
)
static

Definition at line 362 of file tclpathplan.c.

References point::x, and point::y.

Referenced by vgpanecmd().

Here is the caller graph for this function:

◆ buildBindings()

static char * buildBindings ( char *  s1,
const char *  s2 
)
static

Definition at line 190 of file tclpathplan.c.

References agxbdisown(), agxbprint(), free(), gv_strdup(), NULL, and s1().

Referenced by vgpanecmd().

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

◆ center()

◆ dgsprintxy()

static void dgsprintxy ( Tcl_DString *  result,
int  npts,
point  p[] 
)
static

Definition at line 108 of file tclpathplan.c.

Referenced by expandPercentsEval().

Here is the caller graph for this function:

◆ distance()

static double distance ( point  p,
point  q 
)
static

Definition at line 261 of file tclpathplan.c.

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

Referenced by rotate().

Here is the caller graph for this function:

◆ expandPercentsEval()

static void expandPercentsEval ( Tcl_Interp *  interp,
char *  before,
char *  r,
int  npts,
point ppos 
)
static

Definition at line 125 of file tclpathplan.c.

References dgsprintxy(), and Tcl_GetStringResult.

Referenced by triangle_callback().

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

◆ insert_poly()

static int insert_poly ( Tcl_Interp *  interp,
vgpane_t vgp,
int  id,
char *  vargv[],
int  vargc 
)
static

Definition at line 309 of file tclpathplan.c.

References allocpoly(), poly_s::boundary, make_CW(), Ppoly_t::pn, Ppoly_t::ps, scanpoint(), and vc_stale().

Referenced by vgpanecmd().

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

◆ make_barriers()

static void make_barriers ( vgpane_t vgp,
int  pp,
int  qp,
Pedge_t **  barriers,
size_t *  n_barriers 
)
static

Definition at line 329 of file tclpathplan.c.

References Pedge_t::a, Pedge_t::b, gv_calloc(), and vgpane_s::poly.

Referenced by vgpanecmd().

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

◆ remove_poly()

static bool remove_poly ( vgpane_t vgp,
int  id 
)
static

Definition at line 293 of file tclpathplan.c.

References free(), id, vgpane_s::poly, and vc_stale().

Referenced by vgpanecmd().

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

◆ rotate()

static point rotate ( point  c,
point  p,
double  alpha 
)
static

Definition at line 270 of file tclpathplan.c.

References alpha, distance(), point::x, and point::y.

Referenced by vgpanecmd().

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

◆ scale()

static point scale ( point  c,
point  p,
double  gain 
)
static

Definition at line 284 of file tclpathplan.c.

References point::x, and point::y.

Referenced by vgpanecmd().

Here is the caller graph for this function:

◆ scanpoint()

static int scanpoint ( Tcl_Interp *  interp,
char *  argv[],
point p 
)
static

Definition at line 235 of file tclpathplan.c.

References NULL, point::x, and point::y.

Referenced by insert_poly(), and vgpanecmd().

Here is the caller graph for this function:

◆ Tclpathplan_Init()

int Tclpathplan_Init ( Tcl_Interp *  interp)

Definition at line 839 of file tclpathplan.c.

References NULL, tclhandleInit(), vgpane(), and vgpaneTable.

Referenced by Tclpathplan_SafeInit().

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

◆ Tclpathplan_SafeInit()

int Tclpathplan_SafeInit ( Tcl_Interp *  interp)

Definition at line 871 of file tclpathplan.c.

References Tclpathplan_Init().

Here is the call graph for this function:

◆ triangle_callback()

static void triangle_callback ( void *  vgparg,
point  pqr[] 
)
static

Definition at line 175 of file tclpathplan.c.

References tblHeader_t::bodyPtr, tblHeader_t::entrySize, expandPercentsEval(), vgpane_s::interp, vgpane_s::triangle_cmd, and vgpaneTable.

Referenced by vgpanecmd().

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

◆ vc_refresh()

static int vc_refresh ( vgpane_t vgp)
static

Definition at line 93 of file tclpathplan.c.

References free(), gv_calloc(), NULL, Plegal_arrangement(), Pobsopen(), vgpane_s::poly, and vgpane_s::vc.

Referenced by vgpanecmd().

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

◆ vc_stale()

static void vc_stale ( vgpane_t vgp)
static

Definition at line 85 of file tclpathplan.c.

References NULL, Pobsclose(), and vgpane_s::vc.

Referenced by insert_poly(), and remove_poly().

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

◆ vgpane()

static int vgpane ( ClientData  clientData,
Tcl_Interp *  interp,
int  argc,
char *  argv[] 
)
static

Definition at line 816 of file tclpathplan.c.

References free(), gv_alloc(), vgpane_s::interp, NULL, vgpane_s::poly, tclhandleAlloc(), vgpane_s::triangle_cmd, vgpane_s::vc, vgpanecmd(), and vgpaneTable.

Referenced by Tclpathplan_Init().

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

◆ vgpanecmd()

static int vgpanecmd ( ClientData  clientData,
Tcl_Interp *  interp,
int  argc,
char *  argv[] 
)
static

Definition at line 374 of file tclpathplan.c.

References alpha, appendpoint(), poly_s::boundary, buildBindings(), center(), CONST84, free(), in_poly(), insert_poly(), make_barriers(), NULL, Ppoly_t::pn, Pobsclose(), Pobspath(), vgpane_s::poly, polyid, POLYID_NONE, POLYID_UNKNOWN, Proutespline(), ps, Ppoly_t::ps, Ptriangulate(), remove_poly(), rotate(), scale(), scanpoint(), tclhandleFree(), tclhandleXlate(), triangle_callback(), vgpane_s::triangle_cmd, vgpane_s::vc, vc_refresh(), vgpaneTable, point::x, Pxy_t::x, point::y, and Pxy_t::y.

Referenced by vgpane().

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

Variable Documentation

◆ polyid

int polyid = 0
static

Definition at line 74 of file tclpathplan.c.

Referenced by vgpanecmd().

◆ vgpaneTable

tblHeader_pt vgpaneTable

Definition at line 72 of file tclpathplan.c.

Referenced by Tclpathplan_Init(), triangle_callback(), vgpane(), and vgpanecmd().