static void drawtopfishnodes(topview * t) { glCompColor srcColor; glCompColor tarColor; glCompColor color; int level, v; Hierarchy *hp = t->fisheyeParams.h; static int max_visible_level = 0; srcColor.R = view->Topview->fisheyeParams.srcColor.R; srcColor.G = view->Topview->fisheyeParams.srcColor.G; srcColor.B = view->Topview->fisheyeParams.srcColor.B; tarColor.R = view->Topview->fisheyeParams.tarColor.R; tarColor.G = view->Topview->fisheyeParams.tarColor.G; tarColor.B = view->Topview->fisheyeParams.tarColor.B; //draw focused node little bigger than others /* ex_vtx_data *gg = hp->geom_graphs[0]; if ((gg[v].active_level == 0) &&(v==t->fisheyeParams.fs->foci_nodes[0]))*/ //drawing nodes glPointSize(7); level = 0; glBegin(GL_POINTS); for (level = 0; level < hp->nlevels; level++) { for (v = 0; v < hp->nvtxs[level]; v++) { double x0, y0; if (get_temp_coords(t, level, v, &x0, &y0)) { if (!(((-x0 / view->zoom > view->clipX1) && (-x0 / view->zoom < view->clipX2) && (-y0 / view->zoom > view->clipY1) && (-y0 / view->zoom < view->clipY2)))) continue; // if (level !=0) // glColor4f((GLfloat) (hp->nlevels - level)*(GLfloat)0.5 / (GLfloat) hp->nlevels, // (GLfloat) level / (GLfloat) hp->nlevels, (GLfloat)0,(GLfloat)view->defaultnodealpha); // else // glColor4f((GLfloat) 1, // (GLfloat) level / (GLfloat) hp->nlevels*2, 0,view->defaultnodealpha); if (max_visible_level < level) max_visible_level = level; color_interpolation(srcColor, tarColor, &color, max_visible_level, level); glColor4f(color.R, color.G, color.B, (GLfloat) view->defaultnodealpha); /* glColor3f((GLfloat) (hp->nlevels - level)*0.5 / (GLfloat) hp->nlevels, (GLfloat) level / (GLfloat) hp->nlevels, 0);*/ glVertex3f((GLfloat) x0, (GLfloat) y0, (GLfloat) 0); } } } glEnd(); }
/* draws all level 0 nodes and edges, during animation */ void printalllevels(topview * t) { int level, v; Hierarchy *hp = t->fisheyeParams.h; glPointSize(5); glBegin(GL_POINTS); for (level = 0; level < hp->nlevels; level++) { for (v = 0; v < hp->nvtxs[level]; v++) { ex_vtx_data *gg = hp->geom_graphs[level]; if (gg[v].active_level == level) { double x0, y0; get_temp_coords(t, level, v, &x0, &y0); glColor3f((GLfloat) (hp->nlevels - level) / (GLfloat) hp->nlevels, (GLfloat) level / (GLfloat) hp->nlevels, 0); glVertex3f((GLfloat) x0, (GLfloat) y0, (GLfloat) 0); } } } glEnd(); }
static void drawtopfishedges(topview * t) { glCompColor srcColor; glCompColor tarColor; glCompColor color; int level, v, i, n; Hierarchy *hp = t->fisheyeParams.h; static int max_visible_level = 0; srcColor.R = view->Topview->fisheyeParams.srcColor.R; srcColor.G = view->Topview->fisheyeParams.srcColor.G; srcColor.B = view->Topview->fisheyeParams.srcColor.B; tarColor.R = view->Topview->fisheyeParams.tarColor.R; tarColor.G = view->Topview->fisheyeParams.tarColor.G; tarColor.B = view->Topview->fisheyeParams.tarColor.B; //and edges glBegin(GL_LINES); for (level = 0; level < hp->nlevels; level++) { for (v = 0; v < hp->nvtxs[level]; v++) { v_data *g = hp->graphs[level]; double x0, y0; if (get_temp_coords(t, level, v, &x0, &y0)) { for (i = 1; i < g[v].nedges; i++) { double x, y; n = g[v].edges[i]; if (max_visible_level < level) max_visible_level = level; color_interpolation(srcColor, tarColor, &color, max_visible_level, level); glColor4f(color.R, color.G, color.B, (GLfloat) view->defaultnodealpha); if (get_temp_coords(t, level, n, &x, &y)) { glVertex3f((GLfloat) x0, (GLfloat) y0, (GLfloat) 0); glVertex3f((GLfloat) x, (GLfloat) y, (GLfloat) 0); } else // if (gg[n].active_level > level) { int levell, nodee; find_active_ancestor_info(hp, level, n, &levell, &nodee); // find_physical_coords(hp, level, n, &x, &y); if (get_temp_coords(t, levell, nodee, &x, &y)) { if ((!(((-x0 / view->zoom > view->clipX1) && (-x0 / view->zoom < view->clipX2) && (-y0 / view->zoom > view->clipY1) && (-y0 / view->zoom < view->clipY2)))) && (!(((-x / view->zoom > view->clipX1) && (-x / view->zoom < view->clipX2) && (-y / view->zoom > view->clipY1) && (-y / view->zoom < view->clipY2))))) continue; glVertex3f((GLfloat) x0, (GLfloat) y0, (GLfloat) 0); glVertex3f((GLfloat) x, (GLfloat) y, (GLfloat) 0); } } } } } } glEnd(); }
void drawtopologicalfisheye(topview * t) { int level, v, i, n; float R,G,B; Hierarchy *hp = t->h; //draw only nodes and super nodes glPointSize(5); glBegin(GL_POINTS); for (level = 0; level < hp->nlevels; level++) { for (v = 0; v < hp->nvtxs[level]; v++) { ex_vtx_data *gg = hp->geom_graphs[level]; if (gg[v].active_level == level) { double x0,y0; t->animate=0; get_temp_coords(t,level,v,&x0,&y0,&R,&G,&B); glColor3f((GLfloat) (hp->nlevels - level) / (GLfloat) hp->nlevels, (GLfloat) level / (GLfloat) hp->nlevels, 0); glVertex3f((GLfloat) x0, (GLfloat) y0, (GLfloat) 0); t->animate=1; } } } glEnd(); //draw edges glBegin(GL_LINES); for (level = 0; level < hp->nlevels; level++) { for (v = 0; v < hp->nvtxs[level]; v++) { ex_vtx_data *gg = hp->geom_graphs[level]; v_data *g = hp->graphs[level]; if (gg[v].active_level == level) { double x0,y0; get_temp_coords(t,level,v,&x0,&y0,&R,&G,&B); for (i = 1; i < g[v].nedges; i++) { double x, y; n = g[v].edges[i]; glColor3f((GLfloat) (hp->nlevels - level) / (GLfloat) hp->nlevels, (GLfloat) level / (GLfloat) hp->nlevels, 0); if (gg[n].active_level == level) { if (v < n) { get_temp_coords(t,level,n,&x,&y,&R,&G,&B); glVertex3f((GLfloat) x0, (GLfloat) y0,(GLfloat) 0); glVertex3f((GLfloat) x, (GLfloat) y,(GLfloat) 0); } } else if (gg[n].active_level > level) { find_physical_coords(hp, level, n, &x, &y); glVertex3f((GLfloat) x0, (GLfloat) y0,(GLfloat) 0); glVertex3f((GLfloat) x, (GLfloat) y, (GLfloat) 0); } } } } } glEnd(); }
void drawtopologicalfisheye2(topview * t) { int level, v, i, n; Hierarchy *hp = t->h; float R,G,B; static int debug_mode=1; view->Topview->animate=1; //draw only nodes and super nodes glPointSize(4); glBegin(GL_POINTS); for (level = 0; level < hp->nlevels; level++) { for (v = 0; v < hp->nvtxs[level]; v++) { { /* ex_vtx_data *gg = hp->geom_graphs[level]; */ double x0,y0; if(get_temp_coords(t,level,v,&x0,&y0,&R,&G,&B)) { glColor3f((GLfloat)R,(GLfloat)G,(GLfloat)B); glVertex3f((GLfloat) x0, (GLfloat) y0, (GLfloat) 0); } } } } glEnd(); //draw edges glBegin(GL_LINES); for (level = 0; level < hp->nlevels; level++) { for (v = 0; v < hp->nvtxs[level]; v++) { ex_vtx_data *gg = hp->geom_graphs[level]; v_data *g = hp->graphs[level]; double x0,y0; if(get_temp_coords(t,level,v,&x0,&y0,&R,&G,&B)&& ((gg[v].active_level ==level ) || (gg[v].old_active_level ==level)) ) { for (i = 1; i < g[v].nedges; i++) { double x, y; n = g[v].edges[i]; if(get_temp_coords(t,level,n,&x,&y,&R,&G,&B)) { if (((x0==0)||(x==0) || (y0==0) || (y==0)) &&(debug_mode)) { /*printf ("(%f,%f)->(%f,%f)\n",x0,y0,x,y);*/ } else { glColor3f((GLfloat)R,(GLfloat)G,(GLfloat)B); // glColor3f((GLfloat) (hp->nlevels - level) / (GLfloat) hp->nlevels,(GLfloat) level / (GLfloat) hp->nlevels, 0); glVertex3f((GLfloat) x0, (GLfloat) y0,(GLfloat) 0); glVertex3f((GLfloat) x, (GLfloat) y,(GLfloat) 0); } } else { //get_temp_coords(t,level,n,&x,&y); } } } } } glEnd(); }