Graphviz
13.1.3~dev.20250829.1031
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 <stdbool.h>
14
#include <stddef.h>
15
16
#ifdef __cplusplus
17
extern
"C"
{
18
#endif
19
20
#include <
geom.h
>
21
22
typedef
struct
{
23
pointf
sz
;
/* Size of label (input) */
24
pointf
pos
;
/* Position of lower-left corner of label (output) */
25
void
*
lbl
;
/* Pointer to label in the graph */
26
unsigned
char
set
;
/* True if the position has been set (input/output) */
27
}
xlabel_t
;
28
29
typedef
struct
{
30
pointf
pos
;
/* Position of lower-left corner of object */
31
pointf
sz
;
/* Size of object; may be zero for a point */
32
xlabel_t
*
lbl
;
/* Label attached to object, or NULL */
33
}
object_t
;
34
35
typedef
struct
{
36
boxf
bb
;
/* Bounding box of all objects */
37
bool
force
;
38
}
label_params_t
;
39
40
int
placeLabels
(
object_t
*objs,
size_t
n_objs,
xlabel_t
*lbls,
size_t
n_lbls,
41
label_params_t
*params);
42
43
#ifdef XLABEL_INT
44
#include <
label/index.h
>
45
#include <
cdt.h
>
46
47
#ifndef XLXDENOM
48
#define XLXDENOM 8
49
#endif
/*XLXDENOM*/
50
#ifndef XLYDENOM
51
#define XLYDENOM 2
52
#endif
/*XLYDENOM*/
53
#define XLNBR 9
54
// indexes of neighbors in certain arrays
55
// the node of interest is usually in node 4
56
// 6 7 8
57
// 3 4 5
58
// 0 1 2
59
#define XLPXPY 0
60
#define XLCXPY 1
61
#define XLNXPY 2
62
#define XLPXCY 3
63
#define XLCXCY 4
64
#define XLNXCY 5
65
#define XLPXNY 6
66
#define XLCXNY 7
67
#define XLNXNY 8
68
typedef
struct
best_p_s {
69
int
n;
70
double
area;
71
pointf
pos;
72
} BestPos_t;
73
74
typedef
struct
obyh {
75
Dtlink_t
link;
76
int
key;
77
Leaf_t
d;
78
} HDict_t;
79
80
typedef
struct
XLabels_s {
81
object_t
*objs;
82
size_t
n_objs;
83
xlabel_t
*lbls;
84
size_t
n_lbls;
85
label_params_t
*params;
86
87
Dt_t
*hdx;
// splay tree keyed with hilbert spatial codes
88
RTree_t
*spdx;
// rtree
89
90
} XLabels_t;
91
92
#endif
/* XLABEL_INT */
93
94
#ifdef __cplusplus
95
}
96
#endif
cdt.h
container data types API
geom.h
geometric types and macros (e.g. points and boxes)
index.h
Leaf
Definition
index.h:55
RTree
Definition
index.h:65
boxf
Definition
geom.h:41
dt_s_
Definition
cdt.h:100
dtlink_s_
Definition
cdt.h:51
label_params_t
Definition
xlabels.h:35
label_params_t::bb
boxf bb
Definition
xlabels.h:36
label_params_t::force
bool force
if true, all labels must be placed
Definition
xlabels.h:37
object_t
Definition
xlabels.h:29
object_t::lbl
xlabel_t * lbl
Definition
xlabels.h:32
object_t::pos
pointf pos
Definition
xlabels.h:30
object_t::sz
pointf sz
Definition
xlabels.h:31
pointf_s
Definition
geom.h:29
xlabel_t
Definition
xlabels.h:22
xlabel_t::lbl
void * lbl
Definition
xlabels.h:25
xlabel_t::set
unsigned char set
Definition
xlabels.h:26
xlabel_t::sz
pointf sz
Definition
xlabels.h:23
xlabel_t::pos
pointf pos
Definition
xlabels.h:24
placeLabels
int placeLabels(object_t *objs, size_t n_objs, xlabel_t *lbls, size_t n_lbls, label_params_t *params)
Definition
xlabels.c:547
lib
label
xlabels.h
Generated by
1.9.8