41 color->R = (level * tarColor.
R - level * srcColor.
R +
42 levelcount * srcColor.
R) / levelcount;
43 color->G = (level * tarColor.
G - level * srcColor.
G +
44 levelcount * srcColor.
G) / levelcount;
45 color->B = (level * tarColor.
B - level * srcColor.
B +
46 levelcount * srcColor.
B) / levelcount;
55 int *edges =
gv_calloc(2 * ne + nv,
sizeof(
int));
56 float *ewgts =
gv_calloc(2 * ne + nv,
sizeof(
float));
61 graph[i].edges = edges++;
62 graph[i].ewgts = ewgts++;
72 Agnode_t *
const vp = tp == np ? hp : tp;
80 graph[i].nedges = i_nedges;
81 graph[i].edges[0] = i;
82 graph[i].ewgts[0] = 1 - i_nedges;
94 for (level = 0; level < hp->
nlevels; level++) {
95 for (v = 0; v <
LIST_GET(&hp->nvtxs, (
size_t)level); v++) {
122 int closest_fine_node;
133 x_coords[i]=
ND_A(np).x;
134 y_coords[i]=
ND_A(np).y;
146 closest_fine_node = 0;
149 fs->
x_foci[0] =
LIST_GET(&hp->geom_graphs, (
size_t)cur_level)[closest_fine_node].x_coord;
150 fs->
y_foci[0] =
LIST_GET(&hp->geom_graphs, (
size_t)cur_level)[closest_fine_node].y_coord;
160 (
"topologicalfisheyefinestcolor",
view,
166 (
"topologicalfisheyecoarsestcolor",
view,
174 "topologicalfisheyedistortionfactor"),
"%lf",
181 "topologicalfisheyecoarseningfactor"),
"%lf",
201 static int max_visible_level = 0;
208 for (level = 0; level < hp->
nlevels; level++) {
209 for (v = 0; v <
LIST_GET(&hp->nvtxs, (
size_t)level); v++) {
217 if (max_visible_level < level)
218 max_visible_level = level;
225 glVertex3f(x0, y0, 0.0f);
239 static int max_visible_level = 0;
245 for (level = 0; level < hp->
nlevels; level++) {
246 for (v = 0; v <
LIST_GET(&hp->nvtxs, (
size_t)level); v++) {
250 for (i = 1; i < g[v].
nedges; i++) {
255 if (max_visible_level < level)
256 max_visible_level = level;
264 glVertex3f(x0, y0, 0.0f);
265 glVertex3f(x, y, 0.0f);
284 glVertex3f(x0, y0, 0.0f);
285 glVertex3f(x, y, 0.0f);
298 const int fr = (int)(seconds * 1000.0);
299 if (fr < view->total_frames) {
315 int fr,
int total_fr,
float *x,
float *y) {
316 *x = x0 + (x1 - x0) / (
float)total_fr * (float)(fr + 1);
317 *y = y0 + (y1 - y0) / (
float)total_fr * (float)(fr + 1);
326 if (gg[v].active_level != level)
343 if (OAL < level || AL < level)
345 if (OAL >= level || AL >= level)
347 if (OAL == level && AL == level)
354 if (OAL > level && AL == level)
360 if (OAL == level && AL > level)
368 if (x0 == 0 || x1 == 0)
382 int closest_fine_node;
388 for (i = 0; i < num_foci; i++) {
392 LIST_GET(&hp->geom_graphs, (
size_t)cur_level)[closest_fine_node].x_coord;
394 LIST_GET(&hp->geom_graphs, (
size_t)cur_level)[closest_fine_node].y_coord;
404 (
"topologicalfisheyefinestcolor",
view,
410 (
"topologicalfisheyecoarsestcolor",
view,
418 "topologicalfisheyedistortionfactor"),
"%lf",
425 "topologicalfisheyecoarseningfactor"),
"%lf",
Memory allocation wrappers that exit on failure.
static void * gv_calloc(size_t nmemb, size_t size)
abstract graph C library, Cgraph API
void colorxlate(char *str, agxbuf *buf)
void freeGraph(v_data *graph)
int agnedges(Agraph_t *g)
int agnnodes(Agraph_t *g)
size_t agnnodes_z(const Agraph_t *g)
char * agget(void *obj, char *name)
Agedge_t * agnxtedge(Agraph_t *g, Agedge_t *e, Agnode_t *n)
Agedge_t * agfstedge(Agraph_t *g, Agnode_t *n)
Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Agnode_t * agfstnode(Agraph_t *g)
Agraph_t * agraphof(void *obj)
Agraph_t * graph(char *name)
static void color(Agraph_t *g)
Hierarchy * makeHier(int nn, int ne, v_data *graph, double *x_coords, double *y_coords, bool dist2_limit)
void positionAllItems(Hierarchy *hp, focus_t *fs, reposition_t *parms)
focus_t * initFocus(size_t ncnt)
void set_active_levels(Hierarchy *hierarchy, int *foci_nodes, int num_foci, levelparms_t *parms)
void find_closest_active_node(Hierarchy *hierarchy, double x, double y, int *closest_fine_node)
void find_old_physical_coords(Hierarchy *hierarchy, int level, int node, float *x, float *y)
void find_active_ancestor_info(Hierarchy *hierarchy, int level, int node, int *levell, int *nodee)
void find_physical_coords(Hierarchy *hierarchy, int level, int node, float *x, float *y)
type-generic dynamically expanding list
#define LIST_GET(list, index)
static int nedges
total no. of edges used in routing
float old_physical_y_coord
float old_physical_x_coord
double height
viewport height
double width
viewport width
struct topview::@22 fisheyeParams
void changetopfishfocus(topview *t, float *x, float *y, int num_foci)
static void get_interpolated_coords(float x0, float y0, float x1, float y1, int fr, int total_fr, float *x, float *y)
static void refresh_old_values(topview *t)
static int color_interpolation(glCompColor srcColor, glCompColor tarColor, glCompColor *color, int levelcount, int level)
static void drawtopfishedges(topview *t)
static void drawtopfishnodes(topview *t)
void drawtopologicalfisheye(topview *t)
static void get_active_frame(void)
static int get_temp_coords(topview *t, int level, int v, float *coord_x, float *coord_y)
void prepare_topological_fisheye(Agraph_t *g, topview *t)
static v_data * makeGraph(Agraph_t *gg, int *nedges)
char * get_attribute_value(char *attr, ViewInfo *vi, Agraph_t *g)