Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
xlabels.h
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#pragma once
12
13#include <stddef.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19#include <geom.h>
20
21typedef struct {
22 pointf sz; /* Size of label (input) */
23 pointf pos; /* Position of lower-left corner of label (output) */
24 void *lbl; /* Pointer to label in the graph */
25 unsigned char set; /* True if the position has been set (input/output) */
26} xlabel_t;
27
28typedef struct {
29 pointf pos; /* Position of lower-left corner of object */
30 pointf sz; /* Size of object; may be zero for a point */
31 xlabel_t *lbl; /* Label attached to object, or NULL */
32} object_t;
33
34typedef struct {
35 boxf bb; /* Bounding box of all objects */
36 unsigned char force; /* If true, all labels must be placed */
38
39int placeLabels(object_t *objs, size_t n_objs, xlabel_t *lbls, size_t n_lbls,
40 label_params_t *params);
41
42#ifdef XLABEL_INT
43#include <label/index.h>
44#include <cdt.h>
45
46#ifndef XLXDENOM
47#define XLXDENOM 8
48#endif /*XLXDENOM*/
49#ifndef XLYDENOM
50#define XLYDENOM 2
51#endif /*XLYDENOM*/
52#define XLNBR 9
53// indexes of neighbors in certain arrays
54// the node of interest is usually in node 4
55// 6 7 8
56// 3 4 5
57// 0 1 2
58#define XLPXPY 0
59#define XLCXPY 1
60#define XLNXPY 2
61#define XLPXCY 3
62#define XLCXCY 4
63#define XLNXCY 5
64#define XLPXNY 6
65#define XLCXNY 7
66#define XLNXNY 8
67 typedef struct best_p_s {
68 int n;
69 double area;
70 pointf pos;
71} BestPos_t;
72
73typedef struct obyh {
74 Dtlink_t link;
75 int key;
76 Leaf_t d;
77} HDict_t;
78
79typedef struct XLabels_s {
80 object_t *objs;
81 size_t n_objs;
82 xlabel_t *lbls;
83 size_t n_lbls;
84 label_params_t *params;
85
86 Dt_t *hdx; // splay tree keyed with hilbert spatial codes
87 RTree_t *spdx; // rtree
88
89} XLabels_t;
90
91#endif /* XLABEL_INT */
92
93#ifdef __cplusplus
94}
95#endif
container data types API
geometric types and macros (e.g. points and boxes)
Definition index.h:55
Definition index.h:65
Definition geom.h:41
Definition cdt.h:100
unsigned char force
Definition xlabels.h:36
xlabel_t * lbl
Definition xlabels.h:31
pointf pos
Definition xlabels.h:29
pointf sz
Definition xlabels.h:30
void * lbl
Definition xlabels.h:24
unsigned char set
Definition xlabels.h:25
pointf sz
Definition xlabels.h:22
pointf pos
Definition xlabels.h:23
int placeLabels(object_t *objs, size_t n_objs, xlabel_t *lbls, size_t n_lbls, label_params_t *params)
Definition xlabels.c:579