37 ((float) level * tarColor.
R - (
float) level * srcColor.
R +
38 (float) levelcount * srcColor.
R) / (float) levelcount;
40 ((float) level * tarColor.
G - (
float) level * srcColor.
G +
41 (float) levelcount * srcColor.
G) / (float) levelcount;
43 ((float) level * tarColor.
B - (
float) level * srcColor.
B +
44 (float) levelcount * srcColor.
B) / (float) levelcount;
53 int *edges =
gv_calloc(2 * ne + nv,
sizeof(
int));
54 float *ewgts =
gv_calloc(2 * ne + nv,
sizeof(
float));
63 graph[i].edges = edges++;
64 graph[i].ewgts = ewgts++;
79 vp = tp == np ? hp : tp;
87 graph[i].nedges = i_nedges;
88 graph[i].edges[0] = i;
89 graph[i].ewgts[0] = 1 - i_nedges;
101 for (level = 0; level < hp->
nlevels; level++) {
102 for (v = 0; v < hp->
nvtxs[level]; v++) {
129 int closest_fine_node;
140 x_coords[i]=
ND_A(np).x;
141 y_coords[i]=
ND_A(np).y;
153 closest_fine_node = 0;
167 (
"topologicalfisheyefinestcolor",
view,
173 (
"topologicalfisheyecoarsestcolor",
view,
182 "topologicalfisheyedistortionfactor"),
"%lf",
189 "topologicalfisheyecoarseningfactor"),
"%lf",
209 static int max_visible_level = 0;
221 for (level = 0; level < hp->
nlevels; level++) {
222 for (v = 0; v < hp->
nvtxs[level]; v++) {
230 if (max_visible_level < level)
231 max_visible_level = level;
233 max_visible_level, level);
236 glVertex3f((
float)x0, (
float)y0, 0.0f);
252 static int max_visible_level = 0;
262 for (level = 0; level < hp->
nlevels; level++) {
263 for (v = 0; v < hp->
nvtxs[level]; v++) {
267 for (i = 1; i < g[v].
nedges; i++) {
272 if (max_visible_level < level)
273 max_visible_level = level;
275 max_visible_level, level);
279 glVertex3f((
float)x0, (
float)y0, 0.0f);
280 glVertex3f((
float)x, (
float)y, 0.0f);
300 glVertex3f((
float)x0, (
float)y0, 0.0f);
301 glVertex3f((
float)x, (
float)y, 0.0f);
316 fr = (int)(seconds * 1000.0);
317 if (fr < view->total_frames) {
341 int fr,
int total_fr,
double *x,
double *y)
343 *x = x0 + (x1 - x0) / (
double) total_fr *(double) (fr + 1);
344 *y = y0 + (y1 - y0) / (
double) total_fr *(double) (fr + 1);
354 if (gg[v].active_level != level)
357 *coord_x = (double) gg[v].physical_x_coord;
358 *coord_y = (double) gg[v].physical_y_coord;
362 double x0, y0, x1, y1;
372 if (OAL < level || AL < level)
374 if (OAL >= level || AL >= level)
376 if (OAL == level && AL == level)
378 x0 = (double) gg[v].old_physical_x_coord;
379 y0 = (double) gg[v].old_physical_y_coord;
380 x1 = (double) gg[v].physical_x_coord;
381 y1 = (double) gg[v].physical_y_coord;
383 if (OAL > level && AL == level)
386 x1 = (double) gg[v].physical_x_coord;
387 y1 = (double) gg[v].physical_y_coord;
389 if (OAL == level && AL > level)
392 x0 = (double) gg[v].old_physical_x_coord;
393 y0 = (double) gg[v].old_physical_y_coord;
397 if (x0 == 0 || x1 == 0)
411 int closest_fine_node;
417 for (i = 0; i < num_foci; i++) {
433 (
"topologicalfisheyefinestcolor",
view,
439 (
"topologicalfisheyecoarsestcolor",
view,
449 "topologicalfisheyedistortionfactor"),
"%lf",
456 "topologicalfisheyecoarseningfactor"),
"%lf",
Memory allocation wrappers that exit on failure.
static void * gv_calloc(size_t nmemb, size_t size)
void colorxlate(char *str, agxbuf *buf)
void freeGraph(v_data *graph)
int agnedges(Agraph_t *g)
int agnnodes(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, hierparms_t *parms)
void positionAllItems(Hierarchy *hp, focus_t *fs, reposition_t *parms)
focus_t * initFocus(int ncnt)
void set_active_levels(Hierarchy *hierarchy, int *foci_nodes, int num_foci, levelparms_t *parms)
double find_closest_active_node(Hierarchy *hierarchy, double x, double y, int *closest_fine_node)
void find_active_ancestor_info(Hierarchy *hierarchy, int level, int node, int *levell, int *nodee)
void find_old_physical_coords(Hierarchy *hierarchy, int level, int node, double *x, double *y)
void find_physical_coords(Hierarchy *hierarchy, int level, int node, double *x, double *y)
static int nedges
total no. of edges used in routing
ex_vtx_data ** geom_graphs
float old_physical_y_coord
float old_physical_x_coord
struct topview::@55 fisheyeParams
static void get_interpolated_coords(double x0, double y0, double x1, double y1, int fr, int total_fr, double *x, double *y)
void changetopfishfocus(topview *t, float *x, float *y, int num_foci)
static void color_interpolation(glCompColor srcColor, glCompColor tarColor, glCompColor *color, int levelcount, int level)
static void refresh_old_values(topview *t)
static void drawtopfishedges(topview *t)
static int get_temp_coords(topview *t, int level, int v, double *coord_x, double *coord_y)
static void drawtopfishnodes(topview *t)
static int get_active_frame(void)
void drawtopologicalfisheye(topview *t)
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)