Graphviz 16.1.3~dev.20261121.1645
Loading...
Searching...
No Matches
hierarchy.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 v2.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#pragma once
12
14#include <stdbool.h>
15#include <stddef.h>
16#include <util/list.h>
17
18typedef struct {
19 int nedges; // degree, including self-loop
20 int *edges; // neighbors; edges[0] = self
21 int size; // no. of original nodes contained
22 int active_level; // Node displayed iff active_level == node's level
23
24 // position of node in universal coordinate system
25 float x_coord;
26 float y_coord;
27
28 // position of node in physical (device) coordinate system
31 //previous coords and active level (for animation)
35
36
38
39typedef struct {
41 LIST(v_data *) graphs;
42 LIST(ex_vtx_data *) geom_graphs;
43 int * nvtxs;
44 int * nedges;
45 /* Node i on level k is mapped to coarse node v2cv[k][i] on level k+1
46 */
47 int ** v2cv;
48 /* Coarse node i on level k contains nodes cv2v[k][2*i] and
49 * cv2v[k][2*i+1] on level k-1. If it contains only 1 node, then
50 * cv2v[k][2*i+1] will be -1
51 */
52 int ** cv2v;
53} Hierarchy;
54
55typedef struct {
56 int num_fine_nodes; /* 50 */
57 double coarsening_rate; /* 2.5 */
59
61 ex_vtx_data *geom_graph, int ngeom_edges,
62 bool dist2_limit);
63
64void set_active_levels(Hierarchy*, int*, int, levelparms_t*);
65void find_closest_active_node(Hierarchy*, double x, double y, int*);
66
67size_t extract_active_logical_coords(Hierarchy *hierarchy, int node, int level,
68 double *x_coords, double *y_coords, size_t counter);
69int set_active_physical_coords(Hierarchy *, int node, int level,
70 double *x_coords, double *y_coords, int counter);
71
72void init_active_level(Hierarchy* hierarchy);
73
74// creating a geometric graph:
75int init_ex_graph(v_data * graph1, v_data * graph2, int n,
76 double *x_coords, double *y_coords, ex_vtx_data ** gp);
77
78// layout distortion:
79void rescale_layout_polar(double * x_coords, double * y_coords,
80 double * x_foci, double * y_foci, int num_foci, size_t n, int interval,
81 double width, double height, double distortion);
82
83void find_physical_coords(Hierarchy *, int, int, float *x, float *y);
84void find_old_physical_coords(Hierarchy *hierarchy, int level, int node,
85 float *x, float *y);
86
87void find_active_ancestor_info(Hierarchy * hierarchy, int level, int node, int *levell,int *nodee);
Agraph_t * graph(char *name)
Definition gv.cpp:34
void init_active_level(Hierarchy *hierarchy)
Definition hierarchy.c:1075
size_t extract_active_logical_coords(Hierarchy *hierarchy, int node, int level, double *x_coords, double *y_coords, size_t counter)
Definition hierarchy.c:968
Hierarchy * create_hierarchy(v_data *graph, int nvtxs, int nedges, ex_vtx_data *geom_graph, int ngeom_edges, bool dist2_limit)
Definition hierarchy.c:668
void set_active_levels(Hierarchy *, int *, int, levelparms_t *)
Definition hierarchy.c:739
void find_old_physical_coords(Hierarchy *hierarchy, int level, int node, float *x, float *y)
Definition hierarchy.c:1063
void find_closest_active_node(Hierarchy *, double x, double y, int *)
Definition hierarchy.c:900
void find_active_ancestor_info(Hierarchy *hierarchy, int level, int node, int *levell, int *nodee)
Definition hierarchy.c:1045
void find_physical_coords(Hierarchy *, int, int, float *x, float *y)
Definition hierarchy.c:1032
void rescale_layout_polar(double *x_coords, double *y_coords, double *x_foci, double *y_foci, int num_foci, size_t n, int interval, double width, double height, double distortion)
int set_active_physical_coords(Hierarchy *, int node, int level, double *x_coords, double *y_coords, int counter)
Definition hierarchy.c:1002
int init_ex_graph(v_data *graph1, v_data *graph2, int n, double *x_coords, double *y_coords, ex_vtx_data **gp)
Definition hierarchy.c:915
type-generic dynamically expanding list
static int nedges
total no. of edges used in routing
Definition routespl.c:33
LIST(ex_vtx_data *) geom_graphs
int * nvtxs
Definition hierarchy.h:43
int ** cv2v
Definition hierarchy.h:52
LIST(v_data *) graphs
int * nedges
Definition hierarchy.h:44
int nlevels
Definition hierarchy.h:40
int ** v2cv
Definition hierarchy.h:47
float physical_y_coord
Definition hierarchy.h:30
float old_physical_y_coord
Definition hierarchy.h:33
float old_physical_x_coord
Definition hierarchy.h:32
int old_active_level
Definition hierarchy.h:34
float physical_x_coord
Definition hierarchy.h:29
float x_coord
Definition hierarchy.h:25
int active_level
Definition hierarchy.h:22
float y_coord
Definition hierarchy.h:26
int * edges
Definition hierarchy.h:20
int num_fine_nodes
Definition hierarchy.h:56
double coarsening_rate
Definition hierarchy.h:57