Graphviz 12.0.1~dev.20240716.0800
|
#include "config.h"
#include <assert.h>
#include <float.h>
#include <math.h>
#include <stdbool.h>
#include <stddef.h>
#include <ortho/maze.h>
#include <ortho/fPQ.h>
#include <ortho/ortho.h>
#include <cgraph/alloc.h>
#include <cgraph/exit.h>
#include <cgraph/unused.h>
#include <common/geomprocs.h>
#include <common/globals.h>
#include <common/render.h>
#include <common/pointset.h>
#include <common/intset.h>
#include <common/arith.h>
Go to the source code of this file.
Data Structures | |
struct | epair_t |
struct | chanItem |
Macros | |
#define | DEBUG |
#define | DEBUG_FN /* nothing */ |
#define | CELL(n) ((cell*)ND_alg(n)) |
#define | MID(a, b) (((a)+(b))/2.0) |
#define | SC 1 |
#define | TRANS 10 |
Functions | |
static DEBUG_FN void | emitSearchGraph (FILE *fp, sgraph *sg) |
dumps in dot format snode::cells and edges of sgraph for debugging | |
static DEBUG_FN void | emitGraph (FILE *fp, maze *mp, size_t n_edges, route *route_list, epair_t[]) |
static cell * | cellOf (snode *p, snode *q) |
static pointf | midPt (cell *cp) |
static pointf | sidePt (snode *ptr, cell *cp) |
static void | setSeg (segment *sp, bool dir, double fix, double b1, double b2, int l1, int l2) |
static route | convertSPtoRoute (sgraph *g, snode *fst, snode *lst) |
static void | freeChannel (void *chan) |
static void | freeChanItem (void *item) |
static int | chancmpid (void *k1, void *k2) |
static int | dcmpid (void *k1, void *k2) |
static void | addChan (Dt_t *chdict, channel *cp, double j) |
static Dt_t * | extractHChans (maze *mp) |
static Dt_t * | extractVChans (maze *mp) |
static void | insertChan (channel *chan, segment *seg) |
static channel * | chanSearch (Dt_t *chans, segment *seg) |
static void | assignSegs (size_t nrtes, route *route_list, maze *mp) |
static void | addLoop (sgraph *sg, cell *cp, snode *dp, snode *sp) |
static void | addNodeEdges (sgraph *sg, cell *cp, snode *np) |
static char * | bendToStr (bend b) |
static void | putSeg (FILE *fp, segment *seg) |
static DEBUG_FN void | dumpChanG (channel *cp, double v) |
static void | assignTrackNo (Dt_t *chans) |
static void | create_graphs (Dt_t *chans) |
static int | eqEndSeg (bend S1l2, bend S2l2, bend T1, bend T2) |
static int | overlapSeg (segment *S1, segment *S2, bend T1, bend T2) |
static int | ellSeg (bend S1l1, bend S1l2, bend T) |
static int | segCmp (segment *S1, segment *S2, bend T1, bend T2) |
static int | seg_cmp (segment *S1, segment *S2) |
static int | add_edges_in_G (channel *cp) |
static int | add_np_edges (Dt_t *chans) |
static segment * | next_seg (segment *seg, int dir) |
static int | propagate_prec (segment *seg, int prec, int hops, int dir) |
static bool | is_parallel (segment *s1, segment *s2) |
static int | decide_point (pair *ret, segment *si, segment *sj, int dir1, int dir2) |
static void | set_parallel_edges (segment *seg1, segment *seg2, int dir1, int dir2, int hops, maze *mp) |
static void | removeEdge (segment *seg1, segment *seg2, int dir, maze *mp) |
static int | addPEdges (channel *cp, maze *mp) |
static int | add_p_edges (Dt_t *chans, maze *mp) |
static int | assignTracks (maze *mp) |
static double | vtrack (segment *seg, maze *m) |
static double | htrack (segment *seg, maze *m) |
static pointf | addPoints (pointf p0, pointf p1) |
static void | attachOrthoEdges (maze *mp, size_t n_edges, route *route_list, splineInfo *sinfo, epair_t es[], bool doLbls) |
static int | edgeLen (Agedge_t *e) |
static int | edgecmp (const void *x, const void *y) |
static bool | spline_merge (node_t *n) |
static bool | swap_ends_p (edge_t *e) |
void | orthoEdges (Agraph_t *g, bool useLbls) |
static pointf | coordOf (cell *cp, snode *np) |
static boxf | emitEdge (FILE *fp, Agedge_t *e, route rte, maze *m, boxf bb) |
Variables | |
int | odb_flags |
static Dtdisc_t | chanDisc |
static Dtdisc_t | chanItemDisc |
static splineInfo | sinfo = { swap_ends_p, spline_merge, true, true } |
static char * | prolog2 |
static char * | epilog2 |
|
static |
Definition at line 716 of file ortho.c.
References cmp(), G, channel::G, insert_edge(), seg_cmp(), and channel::seg_list.
Referenced by add_np_edges().
|
static |
Definition at line 740 of file ortho.c.
References add_edges_in_G(), dtflatten(), dtlink, and channel::seg_list.
Referenced by assignTracks().
Definition at line 1057 of file ortho.c.
References addPEdges(), dtflatten(), and dtlink.
Referenced by assignTracks().
Definition at line 320 of file ortho.c.
References chanDisc, chanItem::chans, dtinsert, dtmatch, dtopen(), Dtoset, gv_alloc(), and chanItem::v.
Referenced by extractHChans(), and extractVChans().
Definition at line 448 of file ortho.c.
References snode::cells, createSEdge(), snode::isVert, sgraph::nnodes, cell::nsides, and cell::sides.
Referenced by orthoEdges().
Definition at line 476 of file ortho.c.
References snode::cells, createSEdge(), sgraph::nnodes, cell::nsides, and cell::sides.
Referenced by orthoEdges().
Definition at line 965 of file ortho.c.
References pair::a, pair::b, decide_point(), edge_exists(), G, channel::G, is_parallel(), removeEdge(), channel::seg_list, and set_parallel_edges().
Referenced by add_p_edges().
Definition at line 1124 of file ortho.c.
References pointf_s::x, and pointf_s::y.
Referenced by attachOrthoEdges().
Definition at line 426 of file ortho.c.
References chanSearch(), maze::hchans, insertChan(), segment::isVert, route::n, route::segs, and maze::vchans.
Referenced by orthoEdges().
|
static |
Definition at line 546 of file ortho.c.
References dtflatten(), dtlink, dumpChanG(), channel::G, odb_flags, channel::seg_list, top_sort(), vertex::topsort_order, and rawgraph::vertices.
Referenced by assignTracks().
|
static |
Definition at line 1076 of file ortho.c.
References add_np_edges(), add_p_edges(), assignTrackNo(), create_graphs(), maze::hchans, and maze::vchans.
Referenced by orthoEdges().
|
static |
Definition at line 1131 of file ortho.c.
References addEdgeLabels(), addPoints(), aghead, agnameof(), agtail, clip_and_install(), epair_t::e, ED_head_port, ED_label, ED_tail_port, free(), gv_calloc(), htrack(), segment::isVert, lbl, route::n, ND_coord, route::segs, sinfo, Verbose, vtrack(), pointf_s::x, and pointf_s::y.
Referenced by orthoEdges().
|
static |
Definition at line 66 of file ortho.c.
References snode::cells.
Referenced by convertSPtoRoute().
|
static |
Definition at line 415 of file ortho.c.
References chanItem::chans, segment::comm_coord, dtmatch, and segment::p.
Referenced by assignSegs(), htrack(), removeEdge(), set_parallel_edges(), and vtrack().
Definition at line 145 of file ortho.c.
References B_DOWN, B_LEFT, B_NODE, B_RIGHT, B_UP, cell::bb, cellOf(), snode::cells, gv_calloc(), gv_recalloc(), IsNode, snode::isVert, boxf::LL, midPt(), route::n, N_DAD, N_EDGE, segment::next, NULL, prev, segment::prev, route::segs, setSeg(), sidePt(), updateWts(), pointf_s::x, and pointf_s::y.
Referenced by orthoEdges().
Definition at line 1409 of file ortho.c.
References agerrorf(), cell::bb, graphviz_exit(), boxf::LL, M_BOTTOM, M_LEFT, M_RIGHT, M_TOP, cell::sides, boxf::UR, pointf_s::x, and pointf_s::y.
Referenced by emitSearchGraph().
|
static |
Definition at line 570 of file ortho.c.
References dtflatten(), dtlink, channel::G, make_graph(), and channel::seg_list.
Referenced by assignTracks().
Definition at line 822 of file ortho.c.
References pair::a, pair::b, is_parallel(), next_seg(), NULL, propagate_prec(), and seg_cmp().
Referenced by addPEdges().
Definition at line 526 of file ortho.c.
References vertex::adj_list, dtfirst, dtnext, dtsize(), channel::G, intitem::id, channel::p, paird::p1, paird::p2, putSeg(), channel::seg_list, and rawgraph::vertices.
Referenced by assignTrackNo().
|
static |
Definition at line 1203 of file ortho.c.
References epair_t::d.
Referenced by orthoEdges().
|
static |
Definition at line 1435 of file ortho.c.
References aghead, agtail, CELL, htrack(), segment::isVert, boxf::LL, route::n, SC, route::segs, boxf::UR, vtrack(), pointf_s::x, and pointf_s::y.
Referenced by emitGraph().
|
static |
Definition at line 1525 of file ortho.c.
References cell::bb, bbox(), maze::cells, emitEdge(), epilog2, maze::gcells, boxf::LL, maze::ncells, maze::ngcells, prolog2, TRANS, boxf::UR, pointf_s::x, and pointf_s::y.
Referenced by orthoEdges().
The routine uses coordinates of cells calculated from gcells. Coordinates of gcellg are calculated by original specified graph layout engine.
Definition at line 1497 of file ortho.c.
References snode::cells, coordOf(), sgraph::edges, IsNode, midPt(), sgraph::nedges, sgraph::nnodes, sgraph::nodes, sedge::v1, sedge::v2, sedge::weight, pointf_s::x, and pointf_s::y.
Referenced by orthoEdges().
Definition at line 587 of file ortho.c.
References B_NODE.
Referenced by overlapSeg(), and segCmp().
Definition at line 334 of file ortho.c.
References addChan(), cell::bb, maze::cells, snode::cells, chanItemDisc, channel::cp, dtopen(), Dtoset, cell::flags, gv_alloc(), IsHScan, IsNode, boxf::LL, M_LEFT, M_RIGHT, MZ_HSCAN, maze::ncells, channel::p, paird::p1, paird::p2, cell::sides, boxf::UR, pointf_s::x, and pointf_s::y.
Referenced by orthoEdges().
Definition at line 371 of file ortho.c.
References addChan(), cell::bb, maze::cells, snode::cells, chanItemDisc, channel::cp, dtopen(), Dtoset, cell::flags, gv_alloc(), IsNode, IsVScan, boxf::LL, M_BOTTOM, M_TOP, MZ_VSCAN, maze::ncells, channel::p, paird::p1, paird::p2, cell::sides, boxf::UR, pointf_s::x, and pointf_s::y.
Referenced by orthoEdges().
|
static |
Definition at line 264 of file ortho.c.
References chanItem::chans, dtclose(), and free().
|
static |
Definition at line 257 of file ortho.c.
References free(), free_graph(), channel::G, and channel::seg_list.
Definition at line 1115 of file ortho.c.
References cell::bb, chanSearch(), channel::cp, maze::hchans, boxf::LL, channel::seg_list, segment::track_no, boxf::UR, and pointf_s::y.
Referenced by attachOrthoEdges(), and emitEdge().
Definition at line 408 of file ortho.c.
References segment::ind_no, and channel::seg_list.
Referenced by assignSegs().
Definition at line 807 of file ortho.c.
References segment::comm_coord, segment::l1, segment::l2, segment::p, paird::p1, paird::p2, and s1().
Referenced by addPEdges(), decide_point(), and removeEdge().
Definition at line 74 of file ortho.c.
References cell::bb, boxf::LL, MID, boxf::UR, pointf_s::x, and pointf_s::y.
Referenced by convertSPtoRoute(), and emitSearchGraph().
Definition at line 762 of file ortho.c.
References segment::next, and segment::prev.
Referenced by decide_point(), propagate_prec(), removeEdge(), and set_parallel_edges().
void orthoEdges | ( | Agraph_t * | g, |
bool | useLbls | ||
) |
Definition at line 1234 of file ortho.c.
References addLoop(), addNodeEdges(), addPS(), agfstnode(), agfstout(), agget(), aghead, agnedges(), agnxtnode(), agnxtout(), AGSEQ, agtail, agwarningf(), assignSegs(), assignTracks(), attachOrthoEdges(), CELL, Concentrate, convertSPtoRoute(), epair_t::d, epair_t::e, ED_label, ED_spl, edgecmp(), edgeLen(), emitGraph(), emitSearchGraph(), extractHChans(), extractVChans(), free(), freeMaze(), freePS(), gv_calloc(), maze::hchans, isInPS(), lbl, mkMaze(), newPS(), sgraph::nnodes, sgraph::nodes, Nop, NULL, odb_flags, PQfree(), PQgen(), ps, reset(), maze::sg, shortPath(), sinfo, and maze::vchans.
Referenced by _spline_edges(), and dot_splines_().
Definition at line 596 of file ortho.c.
References eqEndSeg(), segment::l1, segment::l2, segment::p, and paird::p2.
Referenced by segCmp().
|
static |
Definition at line 775 of file ortho.c.
References B_DOWN, B_LEFT, B_RIGHT, B_UP, segment::comm_coord, segment::isVert, segment::l1, segment::l2, next_seg(), segment::p, and paird::p1.
Referenced by decide_point().
|
static |
Definition at line 516 of file ortho.c.
References bendToStr(), segment::comm_coord, segment::isVert, segment::l1, segment::l2, segment::p, paird::p1, and paird::p2.
Referenced by dumpChanG().
Definition at line 945 of file ortho.c.
References chanSearch(), channel::G, maze::hchans, segment::ind_no, is_parallel(), segment::isVert, next_seg(), remove_redge(), and maze::vchans.
Referenced by addPEdges().
Definition at line 703 of file ortho.c.
References agerrorf(), B_DOWN, B_LEFT, B_RIGHT, B_UP, segment::comm_coord, segment::isVert, and segCmp().
Referenced by add_edges_in_G(), and decide_point().
Definition at line 623 of file ortho.c.
References B_NODE, ellSeg(), eqEndSeg(), segment::l1, segment::l2, overlapSeg(), segment::p, paird::p1, and paird::p2.
Referenced by seg_cmp().
|
static |
Definition at line 856 of file ortho.c.
References B_LEFT, B_UP, chanSearch(), segment::comm_coord, edge_exists(), channel::G, maze::hchans, segment::ind_no, insert_edge(), segment::isVert, segment::l1, segment::l2, next_seg(), segment::p, paird::p1, and maze::vchans.
Referenced by addPEdges().
|
static |
Definition at line 119 of file ortho.c.
References segment::comm_coord, segment::isVert, segment::l1, segment::l2, segment::p, paird::p1, and paird::p2.
Referenced by convertSPtoRoute().
Definition at line 87 of file ortho.c.
References cell::bb, snode::cells, snode::isVert, boxf::LL, MID, boxf::UR, pointf_s::x, and pointf_s::y.
Referenced by convertSPtoRoute().
Definition at line 1106 of file ortho.c.
References cell::bb, chanSearch(), channel::cp, left, boxf::LL, right, channel::seg_list, segment::track_no, boxf::UR, maze::vchans, and pointf_s::x.
Referenced by attachOrthoEdges(), and emitEdge().
|
static |
Definition at line 301 of file ortho.c.
Referenced by addChan().
|
static |
Definition at line 310 of file ortho.c.
Referenced by extractHChans(), and extractVChans().
|
static |
Definition at line 1404 of file ortho.c.
Referenced by emitGraph().
int odb_flags |
Definition at line 55 of file ortho.c.
Referenced by assignTrackNo(), mkMaze(), and orthoEdges().
|
static |
Definition at line 1372 of file ortho.c.
Referenced by emitGraph().
|
static |
Definition at line 1227 of file ortho.c.
Referenced by attachOrthoEdges(), and orthoEdges().