Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
render.h
Go to the documentation of this file.
1
5/*************************************************************************
6 * Copyright (c) 2011 AT&T Intellectual Property
7 * All rights reserved. This program and the accompanying materials
8 * are made available under the terms of the Eclipse Public License v1.0
9 * which accompanies this distribution, and is available at
10 * https://www.eclipse.org/legal/epl-v10.html
11 *
12 * Contributors: Details at https://graphviz.org
13 *************************************************************************/
14
15#pragma once
16
17#include "config.h"
18
19#include <sys/types.h>
20#include <stdbool.h>
21#include <stdint.h>
22#include <stdlib.h>
23#include <string.h>
24#include <util/agxbuf.h>
25
26#include <inttypes.h>
27
28#include "types.h"
29#include "macros.h"
30#include "const.h"
31#include "globals.h"
32#include "colorprocs.h" /* must follow color.h (in types.h) */
33#include "geomprocs.h" /* must follow geom.h (in types.h) */
34#include "utils.h" /* must follow types.h and agxbuf.h */
35#include "gvplugin.h" /* must follow gvcext.h (in types.h) */
36#include "gvcjob.h" /* must follow gvcext.h (in types.h) */
37#include "gvcint.h" /* must follow gvcext.h (in types.h) */
38#include "gvcproc.h" /* must follow gvcext.h (in types.h) */
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44 typedef struct epsf_s {
48
49#ifdef GVDLL
50#ifdef GVC_EXPORTS
51#define RENDER_API __declspec(dllexport)
52#else
53#define RENDER_API __declspec(dllimport)
54#endif
55#endif
56
57#ifndef RENDER_API
58#define RENDER_API /* nothing */
59#endif
60
61 RENDER_API void add_box(path *, boxf);
62 RENDER_API void arrow_flags(Agedge_t *e, uint32_t *sflag, uint32_t *eflag);
63 RENDER_API boxf arrow_bb(pointf p, pointf u, double arrowsize);
64 RENDER_API void arrow_gen(GVJ_t * job, emit_state_t emit_state, pointf p, pointf u,
65 double arrowsize, double penwidth, uint32_t flag);
66 RENDER_API size_t arrowEndClip(edge_t*, pointf*, size_t, size_t, bezier*,
67 uint32_t eflag);
68 RENDER_API size_t arrowStartClip(edge_t*, pointf *ps, size_t, size_t,
69 bezier*, uint32_t sflag);
70 RENDER_API void arrowOrthoClip(edge_t*, pointf *ps, size_t, size_t, bezier*,
71 uint32_t sflag, uint32_t eflag);
72 RENDER_API void beginpath(path *, Agedge_t *, int, pathend_t *, bool);
73 RENDER_API void bezier_clip(inside_t * inside_context,
74 bool(*insidefn) (inside_t * inside_context,
75 pointf p), pointf * sp, bool left_inside);
76 RENDER_API shape_desc *bind_shape(char *name, node_t *);
77 RENDER_API void makeStraightEdge(graph_t * g, edge_t * e, int edgetype, splineInfo * info);
78 RENDER_API void makeStraightEdges(graph_t *g, edge_t **edges, size_t e_cnt,
79 int et, splineInfo* sinfo);
80 RENDER_API void clip_and_install(edge_t * fe, node_t * hn,
81 pointf *ps, size_t pn, splineInfo *info);
82 RENDER_API char* charsetToStr (int c);
83 RENDER_API pointf coord(node_t * n);
84 RENDER_API void do_graph_label(graph_t * sg);
85 RENDER_API void graph_init(graph_t * g, bool use_rankdir);
86 RENDER_API void graph_cleanup(graph_t * g);
87 RENDER_API int dotneato_args_initialize(GVC_t * gvc, int, char **);
88 RENDER_API int dotneato_usage(const char *, int);
89 RENDER_API void dotneato_postprocess(Agraph_t *);
90 RENDER_API void gv_postprocess(Agraph_t *, int);
91 RENDER_API Ppolyline_t* ellipticWedge (pointf ctr, double major, double minor, double angle0, double angle1);
92 RENDER_API void emit_clusters(GVJ_t * job, Agraph_t * g, int flags);
93 RENDER_API char* getObjId (GVJ_t* job, void* obj, agxbuf* xb);
94 RENDER_API void emit_graph(GVJ_t * job, graph_t * g);
95 RENDER_API void emit_label(GVJ_t * job, emit_state_t emit_state, textlabel_t *);
96 RENDER_API bool emit_once(char *message);
97 RENDER_API void emit_once_reset(void);
98 RENDER_API void emit_map_rect(GVJ_t *job, boxf b);
99 RENDER_API void endpath(path *, Agedge_t *, int, pathend_t *, bool);
100 RENDER_API void epsf_init(node_t * n);
101 RENDER_API void epsf_free(node_t * n);
102 RENDER_API shape_desc *find_user_shape(const char *);
103 RENDER_API void free_label(textlabel_t *);
104 RENDER_API void free_textspan(textspan_t *tl, size_t);
105 RENDER_API void getdouble(graph_t * g, char *name, double *result);
106 RENDER_API splines *getsplinepoints(edge_t * e);
107 RENDER_API void gv_fixLocale (int set);
108 RENDER_API void gv_free_splines(edge_t * e);
109 RENDER_API void gv_cleanup_edge(Agedge_t * e);
110 RENDER_API void gv_cleanup_node(Agnode_t * n);
111 RENDER_API void* init_xdot (Agraph_t* g);
112 RENDER_API int initMapData (GVJ_t*, char*, char*, char*, char*, char*, void*);
113 RENDER_API bool isPolygon(node_t *);
114 RENDER_API void makeSelfEdge(edge_t *edges[], size_t ind, size_t cnt,
115 double sizex, double sizey, splineInfo * sinfo);
116 RENDER_API textlabel_t *make_label(void *obj, char *str, int kind, double fontsize, char *fontname, char *fontcolor);
117 RENDER_API bezier *new_spline(edge_t *e, size_t sz);
118 RENDER_API char **parse_style(char *s);
119 RENDER_API void place_graph_label(Agraph_t *);
120 RENDER_API int place_portlabel(edge_t * e, bool head_p);
121 RENDER_API void makePortLabels(edge_t * e);
122 RENDER_API pointf edgeMidpoint(graph_t* g, edge_t * e);
123 RENDER_API void addEdgeLabels(edge_t *e);
124 RENDER_API void pop_obj_state(GVJ_t *job);
125 RENDER_API obj_state_t* push_obj_state(GVJ_t *job);
126 RENDER_API int rank(graph_t * g, int balance, int maxiter);
127 RENDER_API int rank2(graph_t * g, int balance, int maxiter, int search_size);
128 RENDER_API port resolvePort(node_t* n, node_t* other, port* oldport);
129 RENDER_API void resolvePorts (edge_t* e);
130 RENDER_API void round_corners(GVJ_t *job, pointf *AF, size_t sides,
131 graphviz_polygon_style_t style, int filled);
132 RENDER_API int routesplinesinit(void);
133 RENDER_API pointf *routesplines(path *, size_t *);
134 RENDER_API void routesplinesterm(void);
135 RENDER_API pointf* simpleSplineRoute(pointf, pointf, Ppoly_t, size_t *, int);
136 RENDER_API pointf *routepolylines(path* pp, size_t* npoints);
137 RENDER_API double selfRightSpace(edge_t *e);
138 RENDER_API shape_kind shapeOf(node_t *);
139 RENDER_API void shape_clip(node_t * n, pointf curve[4]);
140 RENDER_API void make_simple_label (GVC_t * gvc, textlabel_t* rv);
141 RENDER_API int stripedBox(GVJ_t *job, pointf *AF, const char *clrs,
142 int rotate);
143 RENDER_API stroke_t taper (bezier*, double (*radfunc_t)(double,double,double), double initwid);
144 RENDER_API pointf textspan_size(GVC_t * gvc, textspan_t * span);
145 RENDER_API void textfont_dict_open(GVC_t *gvc);
146 RENDER_API void textfont_dict_close(GVC_t *gvc);
147 RENDER_API void translate_bb(Agraph_t *, int);
148 RENDER_API int wedgedEllipse(GVJ_t *job, pointf *pf, const char *clrs);
149 RENDER_API void update_bb_bz(boxf *bb, pointf *cp);
150 RENDER_API boxf xdotBB (graph_t* g);
151
152#undef RENDER_API
153
154#ifdef __cplusplus
155}
156#endif
static splineInfo sinfo
Definition dotsplines.c:127
double(* radfunc_t)(double, double, double)
Definition emit.c:2119
static int flags
Definition gc.c:61
geometric functions (e.g. on points and boxes)
static int cnt(Dict_t *d, Dtlink_t **set)
Definition graph.c:210
static GVC_t * gvc
Definition gv.cpp:23
emit_state_t
Definition gvcjob.h:173
static double penwidth[]
textitem scanner parser str
Definition htmlparse.y:224
static int * ps
Definition lu.c:51
bezier * new_spline(edge_t *e, size_t sz)
Definition splines.c:215
void make_simple_label(GVC_t *gvc, textlabel_t *rv)
Definition labels.c:54
void emit_label(GVJ_t *job, emit_state_t emit_state, textlabel_t *)
Definition labels.c:212
void gv_cleanup_edge(Agedge_t *e)
Definition utils.c:1524
void emit_clusters(GVJ_t *job, Agraph_t *g, int flags)
Definition emit.c:3467
void epsf_free(node_t *n)
int stripedBox(GVJ_t *job, pointf *AF, const char *clrs, int rotate)
Definition emit.c:589
void makePortLabels(edge_t *e)
Definition splines.c:1217
shape_desc * find_user_shape(const char *)
Definition shapes.c:3962
splines * getsplinepoints(edge_t *e)
Definition splines.c:1392
int rank(graph_t *g, int balance, int maxiter)
Definition ns.c:1001
void gv_fixLocale(int set)
Definition emit.c:3869
void clip_and_install(edge_t *fe, node_t *hn, pointf *ps, size_t pn, splineInfo *info)
Definition splines.c:238
pointf * simpleSplineRoute(pointf, pointf, Ppoly_t, size_t *, int)
Given a simple (ccw) polygon, route an edge from tp to hp.
Definition routespl.c:173
void gv_free_splines(edge_t *e)
Definition utils.c:1514
double selfRightSpace(edge_t *e)
Definition splines.c:1148
void resolvePorts(edge_t *e)
Definition shapes.c:4358
void gv_cleanup_node(Agnode_t *n)
Definition utils.c:1536
int routesplinesinit(void)
Definition routespl.c:220
void shape_clip(node_t *n, pointf curve[4])
Definition splines.c:194
size_t arrowStartClip(edge_t *, pointf *ps, size_t, size_t, bezier *, uint32_t sflag)
Definition arrows.c:315
boxf arrow_bb(pointf p, pointf u, double arrowsize)
Definition arrows.c:1112
void round_corners(GVJ_t *job, pointf *AF, size_t sides, graphviz_polygon_style_t style, int filled)
Handle some special graphical cases, such as rounding the shape, adding diagonals at corners,...
Definition shapes.c:707
int dotneato_args_initialize(GVC_t *gvc, int, char **)
Definition input.c:218
void translate_bb(Agraph_t *, int)
Definition postproc.c:123
pointf textspan_size(GVC_t *gvc, textspan_t *span)
Estimates size of a textspan, in points.
Definition textspan.c:79
bool isPolygon(node_t *)
Definition shapes.c:1926
size_t arrowEndClip(edge_t *, pointf *, size_t, size_t, bezier *, uint32_t eflag)
Definition arrows.c:284
shape_kind shapeOf(node_t *)
Definition shapes.c:1906
void makeStraightEdge(graph_t *g, edge_t *e, int edgetype, splineInfo *info)
Definition routespl.c:934
char * charsetToStr(int c)
Given an internal charset value, return a canonical string representation.
Definition input.c:806
bool emit_once(char *message)
Definition emit.c:3430
Ppolyline_t * ellipticWedge(pointf ctr, double major, double minor, double angle0, double angle1)
Definition ellipse.c:298
void textfont_dict_close(GVC_t *gvc)
Definition textspan.c:165
textlabel_t * make_label(void *obj, char *str, int kind, double fontsize, char *fontname, char *fontcolor)
Definition labels.c:108
shape_desc * bind_shape(char *name, node_t *)
Definition shapes.c:3994
void add_box(path *, boxf)
Definition splines.c:348
void graph_init(graph_t *g, bool use_rankdir)
Definition input.c:592
pointf coord(node_t *n)
Definition utils.c:150
void epsf_init(node_t *n)
Definition psusershape.c:97
void bezier_clip(inside_t *inside_context, bool(*insidefn)(inside_t *inside_context, pointf p), pointf *sp, bool left_inside)
Definition splines.c:106
void * init_xdot(Agraph_t *g)
Definition emit.c:58
void place_graph_label(Agraph_t *)
Definition postproc.c:732
void beginpath(path *, Agedge_t *, int, pathend_t *, bool)
Definition splines.c:389
void addEdgeLabels(edge_t *e)
Definition splines.c:1328
obj_state_t * push_obj_state(GVJ_t *job)
Definition emit.c:98
char ** parse_style(char *s)
Definition emit.c:3702
void textfont_dict_open(GVC_t *gvc)
Definition textspan.c:160
void emit_once_reset(void)
Definition emit.c:3440
void gv_postprocess(Agraph_t *, int)
Definition postproc.c:597
void emit_map_rect(GVJ_t *job, boxf b)
Definition emit.c:634
void graph_cleanup(graph_t *g)
Definition input.c:790
pointf edgeMidpoint(graph_t *g, edge_t *e)
Definition splines.c:1299
void arrow_flags(Agedge_t *e, uint32_t *sflag, uint32_t *eflag)
Definition arrows.c:217
pointf * routesplines(path *, size_t *)
Definition routespl.c:566
struct epsf_s epsf_t
int wedgedEllipse(GVJ_t *job, pointf *pf, const char *clrs)
Definition emit.c:543
void getdouble(graph_t *g, char *name, double *result)
Definition input.c:490
void dotneato_postprocess(Agraph_t *)
Definition postproc.c:689
void free_label(textlabel_t *)
Definition labels.c:199
void routesplinesterm(void)
Definition routespl.c:233
void pop_obj_state(GVJ_t *job)
Definition emit.c:122
void makeSelfEdge(edge_t *edges[], size_t ind, size_t cnt, double sizex, double sizey, splineInfo *sinfo)
Definition splines.c:1174
port resolvePort(node_t *n, node_t *other, port *oldport)
Definition shapes.c:4346
stroke_t taper(bezier *, double(*radfunc_t)(double, double, double), double initwid)
Definition taper.c:181
char * getObjId(GVJ_t *job, void *obj, agxbuf *xb)
Use id of root graph if any, plus kind and internal id of object.
Definition emit.c:201
void arrowOrthoClip(edge_t *, pointf *ps, size_t, size_t, bezier *, uint32_t sflag, uint32_t eflag)
Definition arrows.c:355
void endpath(path *, Agedge_t *, int, pathend_t *, bool)
Definition splines.c:586
void update_bb_bz(boxf *bb, pointf *cp)
Definition emit.c:748
pointf * routepolylines(path *pp, size_t *npoints)
Definition routespl.c:570
void free_textspan(textspan_t *tl, size_t)
Definition labels.c:186
boxf xdotBB(graph_t *g)
Definition emit.c:2838
void do_graph_label(graph_t *sg)
Set characteristics of graph label if it exists.
Definition input.c:829
void arrow_gen(GVJ_t *job, emit_state_t emit_state, pointf p, pointf u, double arrowsize, double penwidth, uint32_t flag)
Definition arrows.c:1150
int place_portlabel(edge_t *e, bool head_p)
Definition splines.c:1340
int rank2(graph_t *g, int balance, int maxiter, int search_size)
Definition ns.c:923
void emit_graph(GVJ_t *job, graph_t *g)
Definition emit.c:3371
int initMapData(GVJ_t *, char *, char *, char *, char *, char *, void *)
Definition emit.c:154
int dotneato_usage(const char *, int)
Definition input.c:78
void makeStraightEdges(graph_t *g, edge_t **edges, size_t e_cnt, int et, splineInfo *sinfo)
Definition routespl.c:953
static void rotate(int n, int dim, double *x, double angle)
graph or subgraph
Definition cgraph.h:425
Definition gvcint.h:80
Definition types.h:89
Definition geom.h:41
pointf offset
Definition render.h:46
int macro_id
Definition render.h:45
Definition types.h:81
Definition types.h:48
graphs, nodes and edges info: Agraphinfo_t, Agnodeinfo_t and Agedgeinfo_t
shape_kind
Definition types.h:187
Definition grammar.c:93
int(* pf)(void *, char *,...)
Definition xdot.c:405