]> granicus.if.org Git - graphviz/commitdiff
fines node labels
authorarif <devnull@localhost>
Tue, 17 Feb 2009 00:46:55 +0000 (00:46 +0000)
committerarif <devnull@localhost>
Tue, 17 Feb 2009 00:46:55 +0000 (00:46 +0000)
focused node label

cmd/smyrna/topfisheyeview.c
cmd/smyrna/topview.c

index ff1e5faadf6e10f8d5db34654b40c3366c738104..7fdae60ccfd7ac2300c86d91a1f9ea8b2940fb67 100644 (file)
@@ -308,8 +308,16 @@ void drawtopfishnodes(topview * t)
                        double x0,y0;
                        if (get_temp_coords(t,level,v,&x0,&y0))
                        {
-                               glColor3f((GLfloat) (hp->nlevels - level) /  (GLfloat) hp->nlevels,
+                               if (level !=0)
+                                       glColor3f((GLfloat)0,
                                  (GLfloat) level / (GLfloat) hp->nlevels, 0);
+                               else
+                               glColor3f((GLfloat) 1,
+                                 (GLfloat) level / (GLfloat) hp->nlevels*2, 0);
+
+/*                                                             glColor3f((GLfloat) (hp->nlevels - level)*0.5 /  (GLfloat) hp->nlevels,
+                                 (GLfloat) level / (GLfloat) hp->nlevels, 0);*/
+
                                glVertex3f((GLfloat) x0, (GLfloat) y0, (GLfloat) 0);
                        }
                }
@@ -317,6 +325,73 @@ void drawtopfishnodes(topview * t)
        glEnd();
 
 }
+void drawtopfishnodelabels(topview* t)
+{
+       int  v, i, n,value;
+       char* str;
+       float fs = view->FontSizeConst;
+       Hierarchy *hp = t->h;
+    str = agget(view->g[view->activeGraph], "topologicalfisheyelabelfinenodes");
+       value = (float) atof(str);
+       if(value>0)
+       {
+               for (v = 0; v < hp->nvtxs[0]; v++) 
+               {
+                       ex_vtx_data *gg = hp->geom_graphs[0];
+                       if (gg[v].active_level==0)      
+                       {
+       
+                               if(view->Topview->Nodes[v].Label)
+                                       str=view->Topview->Nodes[v].Label;
+                               else
+                                       itoa(v,str,10);
+                       fontSize(view->fontset->fonts[view->fontset->activefont],fs);
+                       fontColorA(view->fontset->fonts[view->fontset->activefont],0, 0, 0, 1);
+                       fontDrawString(view->fontset->fonts[view->fontset->activefont],gg[v].physical_x_coord,gg[v].physical_y_coord
+                      , (int)(fs*strlen(str)*0.6),str  );
+
+                       }
+
+               }
+       }
+
+       
+       //agattr(g, AGRAPH, attribute, buf);
+}
+void drawtopfishfocusnodelabels(topview* t)
+{
+       int  v, i, n,value;
+       char* str;
+       float fs = view->FontSizeConst;
+       Hierarchy *hp = t->h;
+    str = agget(view->g[view->activeGraph], "topologicalfisheyelabelfocus");
+       value = (float) atof(str);
+       if(value>0)
+       {
+               for (v = 0; v < hp->nvtxs[0]; v++) 
+               {
+                       ex_vtx_data *gg = hp->geom_graphs[0];
+                       if ((gg[v].active_level == 0) &&(v==t->fs->foci_nodes[0]))
+
+                       {
+       
+                               if(view->Topview->Nodes[v].Label)
+                                       str=view->Topview->Nodes[v].Label;
+                               else
+                                       itoa(v,str,10);
+                       fontSize(view->fontset->fonts[view->fontset->activefont],fs*1.5);
+                       fontColorA(view->fontset->fonts[view->fontset->activefont],0, 0, 1, 1);
+                       fontDrawString(view->fontset->fonts[view->fontset->activefont],gg[v].physical_x_coord,gg[v].physical_y_coord
+                      , (int)(fs*strlen(str)*0.7*1.5),str  );
+
+                       }
+
+               }
+       }
+
+       
+       //agattr(g, AGRAPH, attribute, buf);
+}
 void drawtopfishedges(topview * t)
 {
     int level, v, i, n;
@@ -336,7 +411,12 @@ void drawtopfishedges(topview * t)
                                {
                                        double x, y;
                                        n = g[v].edges[i];
-                                       glColor3f((GLfloat) (hp->nlevels - level) /     (GLfloat) hp->nlevels,      (GLfloat) level / (GLfloat) hp->nlevels*2, 0);
+                               if (level !=0)
+                                       glColor3f((GLfloat) (hp->nlevels - level)*0.2 /  (GLfloat) hp->nlevels,
+                                 (GLfloat) level / (GLfloat) hp->nlevels, 0);
+                               else
+                               glColor3f((GLfloat) 1,
+                                 (GLfloat) level / (GLfloat) hp->nlevels*2, 0);
                                        if      (get_temp_coords(t,level,n,&x,&y))
                                        {
                                                        glVertex3f((GLfloat) x0, (GLfloat) y0,(GLfloat) 0);
@@ -366,6 +446,11 @@ void drawtopologicalfisheye(topview * t)
 {
        drawtopfishnodes(t);
        drawtopfishedges(t);
+       if(!t->animate)
+       {
+               drawtopfishnodelabels(t);
+               drawtopfishfocusnodelabels(t);
+       }
 }
 
 
index 260be3b2abfeadef8a51b3665b70f45ce9bd11e8..2906bff9ddc9490a661735d99190049014cf95f3 100755 (executable)
@@ -855,6 +855,7 @@ static int draw_topview_label(topview_node * v, float zdepth)
        && (v->distorted_y / view->zoom * -1 < view->clipY2)) 
        {
                fs=calculate_font_size(v);
+               
        
 
 /*             fs = (v->degree ==1) ? 
@@ -1338,8 +1339,7 @@ static void menu_click_rotate(void *p)
 
        }
        /*DEBUG*/
-
-
+       drawtopfishnodelabels(view->Topview);
        view->mouse.mouse_mode = MM_ROTATE;
 }