1
/* vim:set shiftwidth=4 ts=8: */
3
/**********************************************************
4
* This software is part of the graphviz package *
5
* http://www.graphviz.org/ *
7
* Copyright (c) 1994-2004 AT&T Corp. *
8
* and is licensed under the *
9
* Common Public License, Version 1.0 *
12
* Information and Software Systems Research *
13
* AT&T Research, Florham Park NJ *
14
**********************************************************/
21
typedef enum {Polar, Rectilinear, NoRescale} RescaleType;
23
typedef struct _ex_vtx_data {
30
// "logical" coordinates of node (result of algorithm):
34
// coordinates of node after making local layout:
38
// actual coordinates of (active) node in drawing area
39
float physical_x_coord;
40
float physical_y_coord;
45
float old_physical_x_coord;
46
float old_physical_y_coord;
47
float new_physical_x_coord;
48
float new_physical_y_coord;
52
typedef struct _Hierarchy {
55
ex_vtx_data ** geom_graphs;
63
void release(Hierarchy*);
64
Hierarchy* create_hierarchy(vtx_data * graph, int nvtxs, int nedges,
65
ex_vtx_data* geom_graph, int ngeom_edges, int min_nvtxs);
67
void set_active_levels(Hierarchy*, int*, int);
68
void set_horizontal_active_level(Hierarchy* hierarchy, int cur_level);
69
double find_closest_active_node(Hierarchy*, double x, double y, int*);
70
int find_leftmost_descendant(Hierarchy*, int node, int level, int min_level);
72
int extract_active_logical_coords(Hierarchy * hierarchy, int node, int level,
73
double *x_coords, double *y_coords, int counter);
74
int set_active_physical_coords(Hierarchy *, int node, int level,
75
double *x_coords, double *y_coords, int counter);
78
int extract_new_active_logical_coords(Hierarchy *, int node, int level,
79
double *x_coords, double *y_coords, int counter);
80
int set_new_active_physical_coords(Hierarchy * hierarchy, int node, int level,
81
double *x_coords, double *y_coords, int counter);
82
void derive_old_new_active_physical_coords(Hierarchy *, int, int ,
83
double new_x, double new_y, double old_x, double old_y);
84
int count_active_nodes(Hierarchy *);
86
// creating a geometric graph:
87
int init_ex_graph(vtx_data * graph1, vtx_data * graph2, int n,
88
double *x_coords, double *y_coords, ex_vtx_data ** gp);
90
vtx_data *delaunay_triangulation(double *x, double *y, int n);
92
vtx_data *UG_graph(double *x, double *y, int n, int accurate_computation);
95
void rescale_layout(double *x_coords, double *y_coords,
96
int n, int interval, int ClientWidth, int ClientHeight,
99
void rescale_layout_polar(double * x_coords, double * y_coords,
100
double * x_foci, double * y_foci, int num_foci,
101
int n, int interval, int ClientWidth, int ClientHeight, int margin);
103
void find_physical_coords(Hierarchy*, int, int, double *x, double *y);
104
void find_new_physical_coords(Hierarchy*, int, int, double *x, double *y);
105
void find_old_physical_coords(Hierarchy*, int, int, double *x, double *y);
106
int find_active_ancestor(Hierarchy*, int, int, int*);
107
int locateByIndex(Hierarchy*, int, int*, int*);
108
int findGlobalIndexesOfActiveNeighbors(Hierarchy*, int, int**);
110
void freeGraph(vtx_data * graph);