Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
xlabels.c File Reference
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <label/xlabels.h>
#include <util/alloc.h>
#include <util/exit.h>
Include dependency graph for xlabels.c:

Go to the source code of this file.

Macros

#define XLABEL_INT
 

Functions

static int icompare (void *, void *)
 
static XLabels_t * xlnew (object_t *objs, size_t n_objs, xlabel_t *lbls, size_t n_lbls, label_params_t *params)
 
static void xlfree (XLabels_t *xlp)
 
static unsigned int xlhorder (XLabels_t *xlp)
 
static unsigned int hd_hil_s_from_xy (point p, int n)
 
static double aabbaabb (Rect_t *r, Rect_t *s)
 
static bool lblenclosing (object_t *objp, object_t *objp1)
 
static Rect_t objp2rect (const object_t *op)
 
static Rect_t objplp2rect (const object_t *objp)
 
static Rect_t objplpmks (object_t *objp)
 
static int getintrsxi (object_t *op, object_t *cp)
 
static double recordointrsx (object_t *op, object_t *cp, Rect_t *rp, double a, object_t *intrsx[XLNBR])
 
static double recordlintrsx (object_t *op, object_t *cp, Rect_t *rp, double a, object_t *intrsx[XLNBR])
 
static BestPos_t xlintersections (XLabels_t *xlp, object_t *objp, object_t *intrsx[XLNBR])
 
static BestPos_t xladjust (XLabels_t *xlp, object_t *objp)
 
static int xlhdxload (XLabels_t *xlp)
 
static void xlhdxunload (XLabels_t *xlp)
 
static void xlspdxload (XLabels_t *xlp)
 
static int xlinitialize (XLabels_t *xlp)
 
int placeLabels (object_t *objs, size_t n_objs, xlabel_t *lbls, size_t n_lbls, label_params_t *params)
 

Variables

Dtdisc_t Hdisc
 

Macro Definition Documentation

◆ XLABEL_INT

#define XLABEL_INT

Definition at line 19 of file xlabels.c.

Function Documentation

◆ aabbaabb()

static double aabbaabb ( Rect_t r,
Rect_t s 
)
static

Definition at line 140 of file xlabels.c.

References Rect::boundary, and Overlap().

Referenced by recordlintrsx(), recordointrsx(), and xlintersections().

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

◆ getintrsxi()

static int getintrsxi ( object_t op,
object_t cp 
)
static

Definition at line 222 of file xlabels.c.

References object_t::lbl, object_t::pos, xlabel_t::set, pointf_s::x, and pointf_s::y.

Referenced by recordlintrsx(), and recordointrsx().

Here is the caller graph for this function:

◆ hd_hil_s_from_xy()

static unsigned int hd_hil_s_from_xy ( point  p,
int  n 
)
static

Definition at line 116 of file xlabels.c.

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

Referenced by xlhdxload().

Here is the caller graph for this function:

◆ icompare()

static int icompare ( void *  v1,
void *  v2 
)
static

Definition at line 30 of file xlabels.c.

◆ lblenclosing()

static bool lblenclosing ( object_t objp,
object_t objp1 
)
static

Definition at line 166 of file xlabels.c.

References object_t::lbl, xlabel_t::pos, object_t::pos, xlabel_t::sz, object_t::sz, pointf_s::x, and pointf_s::y.

Referenced by xlintersections().

Here is the caller graph for this function:

◆ objp2rect()

static Rect_t objp2rect ( const object_t op)
static

Definition at line 180 of file xlabels.c.

References Rect::boundary, object_t::pos, object_t::sz, pointf_s::x, and pointf_s::y.

Referenced by recordlintrsx(), recordointrsx(), and xlintersections().

Here is the caller graph for this function:

◆ objplp2rect()

static Rect_t objplp2rect ( const object_t objp)
static

Definition at line 190 of file xlabels.c.

References Rect::boundary, object_t::lbl, xlabel_t::pos, xlabel_t::sz, pointf_s::x, and pointf_s::y.

Referenced by recordlintrsx(), recordointrsx(), and xlintersections().

Here is the caller graph for this function:

◆ objplpmks()

static Rect_t objplpmks ( object_t objp)
static

Definition at line 201 of file xlabels.c.

References Rect::boundary, object_t::lbl, object_t::pos, xlabel_t::sz, object_t::sz, pointf_s::x, and pointf_s::y.

Referenced by xlhdxload().

Here is the caller graph for this function:

◆ placeLabels()

int placeLabels ( object_t objs,
size_t  n_objs,
xlabel_t lbls,
size_t  n_lbls,
label_params_t params 
)

Definition at line 579 of file xlabels.c.

References label_params_t::force, object_t::lbl, xlabel_t::pos, xlabel_t::set, pointf_s::x, xladjust(), xlfree(), xlinitialize(), xlnew(), and pointf_s::y.

Referenced by addXLabels().

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

◆ recordlintrsx()

static double recordlintrsx ( object_t op,
object_t cp,
Rect_t rp,
double  a,
object_t intrsx[XLNBR] 
)
static

Definition at line 290 of file xlabels.c.

References aabbaabb(), getintrsxi(), NULL, objp2rect(), and objplp2rect().

Referenced by xlintersections().

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

◆ recordointrsx()

static double recordointrsx ( object_t op,
object_t cp,
Rect_t rp,
double  a,
object_t intrsx[XLNBR] 
)
static

Definition at line 258 of file xlabels.c.

References aabbaabb(), getintrsxi(), NULL, objp2rect(), and objplp2rect().

Referenced by xlintersections().

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

◆ xladjust()

static BestPos_t xladjust ( XLabels_t *  xlp,
object_t objp 
)
static

Definition at line 381 of file xlabels.c.

References object_t::lbl, xlabel_t::pos, object_t::pos, xlabel_t::sz, object_t::sz, pointf_s::x, xlintersections(), and pointf_s::y.

Referenced by placeLabels().

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

◆ xlfree()

static void xlfree ( XLabels_t *  xlp)
static

Definition at line 66 of file xlabels.c.

References free(), and RTreeClose().

Referenced by placeLabels().

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

◆ xlhdxload()

static int xlhdxload ( XLabels_t *  xlp)
static

Definition at line 520 of file xlabels.c.

References dtinsert, gv_alloc(), hd_hil_s_from_xy(), objplpmks(), point::x, xlhorder(), and point::y.

Referenced by xlinitialize().

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

◆ xlhdxunload()

static void xlhdxunload ( XLabels_t *  xlp)
static

Definition at line 546 of file xlabels.c.

References dtdetach, dtfinger, dtsize(), and free().

Referenced by xlinitialize().

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

◆ xlhorder()

static unsigned int xlhorder ( XLabels_t *  xlp)
static

Definition at line 78 of file xlabels.c.

Referenced by xlhdxload().

Here is the caller graph for this function:

◆ xlinitialize()

static int xlinitialize ( XLabels_t *  xlp)
static

Definition at line 569 of file xlabels.c.

References dtclose(), xlhdxload(), xlhdxunload(), and xlspdxload().

Referenced by placeLabels().

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

◆ xlintersections()

static BestPos_t xlintersections ( XLabels_t *  xlp,
object_t objp,
object_t intrsx[XLNBR] 
)
static

Definition at line 322 of file xlabels.c.

References aabbaabb(), object_t::lbl, lblenclosing(), LeafList::next, objp2rect(), objplp2rect(), xlabel_t::pos, recordlintrsx(), recordointrsx(), RTreeLeafListFree(), RTreeSearch(), and xlabel_t::set.

Referenced by xladjust().

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

◆ xlnew()

static XLabels_t * xlnew ( object_t objs,
size_t  n_objs,
xlabel_t lbls,
size_t  n_lbls,
label_params_t params 
)
static

Definition at line 41 of file xlabels.c.

References Dtobag, dtopen(), graphviz_exit(), gv_alloc(), Hdisc, and RTreeOpen().

Referenced by placeLabels().

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

◆ xlspdxload()

static void xlspdxload ( XLabels_t *  xlp)
static

Definition at line 562 of file xlabels.c.

References dtfirst, dtnext, and RTreeInsert().

Referenced by xlinitialize().

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

Variable Documentation

◆ Hdisc

Dtdisc_t Hdisc
Initial value:
= { offsetof(HDict_t, key), sizeof(int), -1, 0, 0,
}
static int icompare(void *, void *)
Definition xlabels.c:30

Definition at line 26 of file xlabels.c.

Referenced by xlnew().