Graphviz 13.0.0~dev.20250113.2222
|
#include "config.h"
#include <sys/types.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <assert.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 <util/agxbuf.h>
#include <util/alloc.h>
#include <util/list.h>
#include <util/prisize_t.h>
Go to the source code of this file.
Data Structures | |
struct | poly_s |
struct | vgpane_t |
Macros | |
#define | Tcl_GetStringResult(interp) interp->result |
#define | HANDLE_FORMAT ("vgpane%" PRISIZE_T) |
printf format for TCL handles | |
Typedefs | |
typedef Ppoint_t | point |
typedef struct poly_s | poly |
Functions | |
static poly * | allocpoly (vgpane_t *vgp, int id, int npts) |
static void | vc_stale (vgpane_t *vgp) |
static int | vc_refresh (vgpane_t *vgp) |
static void | dgsprintxy (agxbuf *result, int npts, const point p[]) |
static void | expandPercentsEval (Tcl_Interp *interp, char *before, size_t vgcanvasHandle, int npts, const point *ppos) |
static void | triangle_callback (void *vgparg, const point pqr[]) |
static char * | buildBindings (char *s1, const char *s2) |
static int | scanpoint (Tcl_Interp *interp, const 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, const 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 vgpane_t * | find_vgpane (vgpanes_t *panes, const char *handle) |
static void | garbage_collect_vgpanes (vgpanes_t *panes) |
static int | vgpanecmd (ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]) |
static int | vgpane (ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]) |
int | Tclpathplan_Init (Tcl_Interp *interp) |
int | Tclpathplan_SafeInit (Tcl_Interp *interp) |
Variables | |
static vgpanes_t | vgpaneTable |
static int | polyid = 0 |
#define HANDLE_FORMAT ("vgpane%" PRISIZE_T) |
Definition at line 57 of file tclpathplan.c.
#define Tcl_GetStringResult | ( | interp | ) | interp->result |
Definition at line 43 of file tclpathplan.c.
Definition at line 47 of file tclpathplan.c.
Definition at line 74 of file tclpathplan.c.
References poly_s::boundary, gv_calloc(), Ppoly_t::pn, and Ppoly_t::ps.
Referenced by insert_poly().
|
static |
Definition at line 353 of file tclpathplan.c.
References point::x, and point::y.
Referenced by vgpanecmd().
|
static |
Definition at line 181 of file tclpathplan.c.
References agxbdisown(), agxbprint(), free(), gv_strdup(), NULL, and s1().
Referenced by vgpanecmd().
Definition at line 239 of file tclpathplan.c.
References point::x, and point::y.
Referenced by check_or_realloc_arrays(), circleLayout(), distance_to_group(), draw_polygon(), findCenterNode(), furtherest_point(), genBox(), genPoly(), get_gradient_points(), get_tri(), glcreate_gl_topview_menu(), node_distinct_coloring_internal2(), pcp_rotate(), placeFixed(), polyGraphs(), QuadTree_get_quadrant(), QuadTree_get_supernodes(), QuadTree_get_supernodes_internal(), QuadTree_new(), QuadTree_new_from_point_list(), QuadTree_new_in_quadrant(), rotate(), setParentNodes(), setPositions(), setSubtreeSpans(), spring_electrical_embedding(), spring_electrical_spring_embedding(), vgpanecmd(), and walkTree().
Definition at line 106 of file tclpathplan.c.
References agxblen(), agxbprint(), and agxbputc().
Referenced by expandPercentsEval().
|
static |
interp | Interpreter context |
before | Command with percent expressions |
vgcanvasHandle | Index to use in "%r" substitution |
npts | Number of coordinates |
ppos | Coordinates to substitute for t |
Definition at line 127 of file tclpathplan.c.
References agxbfree(), agxbprint(), agxbput_n(), agxbputc(), agxbuse(), dgsprintxy(), HANDLE_FORMAT, NULL, and Tcl_GetStringResult.
Referenced by triangle_callback().
|
static |
lookup an existing pane
panes | Collection to search |
handle | Text descriptor of the pane |
NULL
if there is no such pane Definition at line 368 of file tclpathplan.c.
References HANDLE_FORMAT, NULL, and vgpane_t::valid.
Referenced by vgpanecmd().
|
static |
cleanup unused panes where possible
Panes need to have a stable identifier (index) for their lifetime. Thus they cannot be removed from a vgpanes_t
when deallocated because removing them would alter the index of any still-live panes that comes after them. Instead, panes are marked ->valid = false
when deallocated and then later removed here.
It is only safe to remove deallocated panes that have no live panes following them, which is exactly what this function does.
panes | Collection to sweep |
Definition at line 399 of file tclpathplan.c.
References NULL.
Referenced by vgpanecmd().
|
static |
Definition at line 300 of file tclpathplan.c.
References allocpoly(), poly_s::boundary, make_CW(), Ppoly_t::pn, Ppoly_t::ps, scanpoint(), and vc_stale().
Referenced by vgpanecmd().
|
static |
Definition at line 320 of file tclpathplan.c.
References Pedge_t::a, Pedge_t::b, gv_calloc(), and vgpane_t::poly.
Referenced by vgpanecmd().
|
static |
Definition at line 284 of file tclpathplan.c.
References free(), id, vgpane_t::poly, and vc_stale().
Referenced by vgpanecmd().
Definition at line 261 of file tclpathplan.c.
References alpha, distance(), point::x, and point::y.
Referenced by vgpanecmd().
Definition at line 275 of file tclpathplan.c.
References point::x, and point::y.
Referenced by vgpanecmd().
|
static |
Definition at line 226 of file tclpathplan.c.
References NULL, point::x, and point::y.
Referenced by insert_poly(), and vgpanecmd().
int Tclpathplan_Init | ( | Tcl_Interp * | interp | ) |
Definition at line 891 of file tclpathplan.c.
References NULL, and vgpane().
Referenced by Tclpathplan_SafeInit().
int Tclpathplan_SafeInit | ( | Tcl_Interp * | interp | ) |
Definition at line 921 of file tclpathplan.c.
References Tclpathplan_Init().
|
static |
Definition at line 173 of file tclpathplan.c.
References expandPercentsEval(), vgpane_t::index, vgpane_t::interp, and vgpane_t::triangle_cmd.
Referenced by vgpanecmd().
|
static |
Definition at line 91 of file tclpathplan.c.
References free(), gv_calloc(), NULL, Plegal_arrangement(), Pobsopen(), vgpane_t::poly, and vgpane_t::vc.
Referenced by vgpanecmd().
|
static |
Definition at line 83 of file tclpathplan.c.
References NULL, Pobsclose(), and vgpane_t::vc.
Referenced by insert_poly(), and remove_poly().
|
static |
Definition at line 868 of file tclpathplan.c.
References agxbfree(), agxbprint(), agxbuse(), HANDLE_FORMAT, vgpane_t::index, vgpane_t::interp, NULL, vgpane_t::valid, vgpanecmd(), and vgpaneTable.
Referenced by Tclpathplan_Init().
|
static |
Definition at line 417 of file tclpathplan.c.
References alpha, appendpoint(), poly_s::boundary, buildBindings(), center(), find_vgpane(), free(), garbage_collect_vgpanes(), in_poly(), insert_poly(), make_barriers(), NULL, Ppoly_t::pn, Pobsclose(), Pobspath(), vgpane_t::poly, polyid, POLYID_NONE, POLYID_UNKNOWN, Proutespline(), ps, Ppoly_t::ps, Ptriangulate(), remove_poly(), rotate(), scale(), scanpoint(), triangle_callback(), vgpane_t::triangle_cmd, vgpane_t::valid, vgpane_t::vc, vc_refresh(), vgpaneTable, point::x, Pxy_t::x, point::y, and Pxy_t::y.
Referenced by vgpane().
|
static |
Definition at line 72 of file tclpathplan.c.
Referenced by vgpanecmd().
|
static |
Definition at line 70 of file tclpathplan.c.
Referenced by vgpane(), and vgpanecmd().