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
16
extern
"C"
{
17
#endif
18
19
#include <
geom.h
>
20
21
typedef
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
28
typedef
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
34
typedef
struct
{
35
boxf
bb
;
/* Bounding box of all objects */
36
unsigned
char
force
;
/* If true, all labels must be placed */
37
}
label_params_t
;
38
39
int
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
73
typedef
struct
obyh {
74
Dtlink_t
link;
75
int
key;
76
Leaf_t
d;
77
} HDict_t;
78
79
typedef
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
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:34
label_params_t::bb
boxf bb
Definition
xlabels.h:35
label_params_t::force
unsigned char force
Definition
xlabels.h:36
object_t
Definition
xlabels.h:28
object_t::lbl
xlabel_t * lbl
Definition
xlabels.h:31
object_t::pos
pointf pos
Definition
xlabels.h:29
object_t::sz
pointf sz
Definition
xlabels.h:30
pointf_s
Definition
geom.h:29
xlabel_t
Definition
xlabels.h:21
xlabel_t::lbl
void * lbl
Definition
xlabels.h:24
xlabel_t::set
unsigned char set
Definition
xlabels.h:25
xlabel_t::sz
pointf sz
Definition
xlabels.h:22
xlabel_t::pos
pointf pos
Definition
xlabels.h:23
placeLabels
int placeLabels(object_t *objs, size_t n_objs, xlabel_t *lbls, size_t n_lbls, label_params_t *params)
Definition
xlabels.c:579
lib
label
xlabels.h
Generated by
1.9.8