From: arif Date: Wed, 23 Apr 2008 18:14:04 +0000 (+0000) Subject: selection enabled X-Git-Tag: LAST_LIBGRAPH~32^2~4238 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=60883e6a706c5f2b0378cb4f5ac8ba7dd879e477;p=graphviz selection enabled subgraph saving function fixed only node graphs --- diff --git a/lib/topfish/hierarchy.c b/lib/topfish/hierarchy.c index f4fafb971..69d5d3441 100644 --- a/lib/topfish/hierarchy.c +++ b/lib/topfish/hierarchy.c @@ -1491,6 +1491,22 @@ find_physical_coords(Hierarchy * hierarchy, int level, int node, double *x, *x = hierarchy->geom_graphs[level][node].physical_x_coord; *y = hierarchy->geom_graphs[level][node].physical_y_coord; } +/* find_old_physical_coords: + * find the 'old_physical_coords' of the old active-ancestor of 'node' + */ +void +find_old_physical_coords(Hierarchy * hierarchy, int level, int node, double *x, + double *y) +{ + int active_level = hierarchy->geom_graphs[level][node].old_active_level; + while (active_level > level) { + node = hierarchy->v2cv[level][node]; + level++; + } + + *x = hierarchy->geom_graphs[level][node].old_physical_x_coord; + *y = hierarchy->geom_graphs[level][node].old_physical_y_coord; +} /* find_active_ancestor: * find the 'ancestorIndex' of the active-ancestor of 'node' diff --git a/lib/topfish/hierarchy.h b/lib/topfish/hierarchy.h index acdfa558b..bba3344b8 100644 --- a/lib/topfish/hierarchy.h +++ b/lib/topfish/hierarchy.h @@ -32,6 +32,12 @@ typedef struct { // position of node in physical (device) coordinate system float physical_x_coord; float physical_y_coord; + //previous coords and active level (for animation) + float old_physical_x_coord; + float old_physical_y_coord; + int old_active_level; + + } ex_vtx_data; typedef struct { @@ -96,10 +102,14 @@ void rescale_layout_polar(double * x_coords, double * y_coords, double width, double height, double margin, double distortion); void find_physical_coords(Hierarchy*, int, int, double *x, double *y); +void find_old_physical_coords(Hierarchy * hierarchy, int level, int node, double *x,double *y); + + int find_active_ancestor(Hierarchy*, int, int); int locateByIndex(Hierarchy*, int, int*); int findGlobalIndexesOfActiveNeighbors(Hierarchy*, int, int**); + void freeGraph(vtx_data * graph); #endif diff --git a/share/gui/smyrna.glade b/share/gui/smyrna.glade index dca5b3d71..1c1ca1296 100755 --- a/share/gui/smyrna.glade +++ b/share/gui/smyrna.glade @@ -1,6 +1,6 @@ - + 470 @@ -1748,6 +1748,19 @@ topview 4 + + + 150 + 25 + True + Save As Subgraph + + + + 616 + 4 + + False @@ -1973,37 +1986,36 @@ topview 3 2 - + True - + 15 True All - 0 True - + 75 True - Highlighted + Selected 0 True - rbTVFilterHigh1 + rbTVFilterSel1 1 - + 100 True - Not Highlighted + Non-selected True - rbTVFilterHigh1 + rbTVFilterSel1 2 @@ -2013,6 +2025,33 @@ topview 1 2 + + + + + True + 0 + Selection + + + + + True + 0 + Visible + + + 1 + 2 + + + + + True + 0 + Highlighted + + 2 3 @@ -2062,65 +2101,37 @@ topview - - True - 0 - Highlighted - - - 2 - 3 - - - - - True - 0 - Visible - - - 1 - 2 - - - - - True - 0 - Selection - - - - + True - + 15 True All + 0 True - + 75 True - Selected + Highlighted 0 True - rbTVFilterSel1 + rbTVFilterHigh1 1 - + 100 True - Non-selected + Not Highlighted True - rbTVFilterSel1 + rbTVFilterHigh1 2 @@ -2130,6 +2141,8 @@ topview 1 2 + 2 + 3 @@ -2165,48 +2178,54 @@ topview 2 5 - + + 2 True >= - 3 - 4 - 1 - 2 + 1 + 2 + GTK_FILL - + True - DATA 2 + >= - 2 - 3 + 1 + 2 1 2 - + + 180 + True + + + + + 180 True 4 5 - 1 - 2 - - 180 + + 63 True + DATA 1 - 1 - 2 + 2 + 3 @@ -2220,54 +2239,48 @@ topview - - 63 + + 180 True - DATA 1 - 2 - 3 + 1 + 2 - - 180 + True 4 5 + 1 + 2 - - 180 - True - - - - + True - >= + DATA 2 - 1 - 2 + 2 + 3 1 2 - - 2 + True >= - 1 - 2 - GTK_FILL + 3 + 4 + 1 + 2 @@ -2517,67 +2530,67 @@ topview 3 2 - + + 56 True - 0 - Num. of fine Nodes + + 1 + 2 + 2 + 3 + - + + 56 True - 0 - Coersening factor + 1 + 2 1 2 - + + 56 True - 0 - Distortion factor - 2 - 3 + 1 + 2 - - 56 + True + 0 + Distortion factor - 1 - 2 + 2 + 3 - - 56 + True + 0 + Coersening factor - 1 - 2 1 2 - - 56 + True + 0 + Num. of fine Nodes - - 1 - 2 - 2 - 3 - @@ -2789,117 +2802,115 @@ topview - - True - 0 - 5 - Background Color - - - - + True #000000000000 1 2 + 8 + 9 - + True 0 5 - Border Color + Selected Edge Color - 1 - 2 + 8 + 9 - + True - 0 - 5 - Grid Color + True - 2 - 3 + 2 + 3 + 4 + 5 + GTK_EXPAND - + True - 0 - 5 - Randomize Node Colors + True + 2 + 3 3 4 + GTK_EXPAND - + True - 0 - 5 - Randomize Edge Colors + True - 4 - 5 + 2 + 3 + 2 + 3 + GTK_EXPAND - + True - 0 - 5 - Highlighted Node Color + True - 5 - 6 + 2 + 3 + 1 + 2 + GTK_EXPAND - + True - 0 - 5 - Highlighted Edge Color + #000000000000 - 6 - 7 + 1 + 2 + 7 + 8 - + True - 0 - 5 - Selected Node Color + #000000000000 - 7 - 8 + 1 + 2 + 6 + 7 - + True #000000000000 1 2 - 1 - 2 + 5 + 6 @@ -2915,117 +2926,119 @@ topview - + True #000000000000 1 2 - 5 - 6 + 1 + 2 - + True - #000000000000 + 0 + 5 + Selected Node Color - 1 - 2 - 6 - 7 + 7 + 8 - + True - #000000000000 + 0 + 5 + Highlighted Edge Color - 1 - 2 - 7 - 8 + 6 + 7 - + True - True + 0 + 5 + Highlighted Node Color - 2 - 3 - 1 - 2 - GTK_EXPAND + 5 + 6 - + True - True + 0 + 5 + Randomize Edge Colors - 2 - 3 - 2 - 3 - GTK_EXPAND + 4 + 5 - + True - True + 0 + 5 + Randomize Node Colors - 2 - 3 3 4 - GTK_EXPAND - + True - True + 0 + 5 + Grid Color - 2 - 3 - 4 - 5 - GTK_EXPAND + 2 + 3 - + True 0 5 - Selected Edge Color + Border Color - 8 - 9 + 1 + 2 - + True #000000000000 1 2 - 8 - 9 + + + True + 0 + 5 + Background Color + + 6 @@ -3174,105 +3187,105 @@ topview 4 2 - + True - openGL dots -Circle -Box - + 0 + 5 + Advanced Mode + + + + + True + 0 + 5 + Node Shape - 1 - 2 1 2 - - + True - True + 0 + 5 + Node Size with Degree + + + 2 + 3 + + + + + True + 0 + 5 + Anti-aliasing - 1 - 2 3 4 - GTK_FILL - - + True True 1 2 - 2 - 3 GTK_FILL - + True True 1 2 + 2 + 3 GTK_FILL - + True - 0 - 5 - Anti-aliasing + True + 1 + 2 3 4 + GTK_FILL + - - True - 0 - 5 - Node Size with Degree - - - 2 - 3 - - - - + True - 0 - 5 - Node Shape + openGL dots +Circle +Box + + 1 + 2 1 2 + - - - True - 0 - 5 - Advanced Mode - - 29 @@ -3310,60 +3323,29 @@ Box 2 2 - - True - True - 2 2 20 1 50 10 - 2 - - - 1 - 2 - 2 - 3 - GTK_FILL - - - - - 84 - True - 0 - Zoom X - PANGO_WRAP_WORD_CHAR - - - 2 - 3 - GTK_EXPAND - - - - + 84 True 0 - Height + Width PANGO_WRAP_WORD_CHAR - 1 - 2 GTK_EXPAND - + True - 0 - 5 - Height + True + 3 0 5000 1 50 10 1 2 1 2 + GTK_FILL @@ -3379,31 +3361,62 @@ Box - + True - True - 3 0 5000 1 50 10 + 0 + 5 + Height 1 2 1 2 - GTK_FILL - + 84 True 0 - Width + Height + PANGO_WRAP_WORD_CHAR + + + 1 + 2 + GTK_EXPAND + + + + + 84 + True + 0 + Zoom X PANGO_WRAP_WORD_CHAR + 2 + 3 GTK_EXPAND + + + True + True + 2 2 20 1 50 10 + 2 + + + 1 + 2 + 2 + 3 + GTK_FILL + + 37 @@ -3469,54 +3482,54 @@ Box 2 2 - + 84 True 0 - Radius + Distortion PANGO_WRAP_WORD_CHAR + 1 + 2 GTK_EXPAND - + + 128 True True - 4 0 5000 1 50 10 + 5 0 5000 1 50 10 1 2 - 1 - 2 - GTK_FILL - - 128 + True True - 5 0 5000 1 50 10 + 4 0 5000 1 50 10 1 2 + 1 + 2 + GTK_FILL - + 84 True 0 - Distortion + Radius PANGO_WRAP_WORD_CHAR - 1 - 2 GTK_EXPAND @@ -3568,82 +3581,82 @@ Box - + + 1 True - True - 0 0 9999999 0.10000000000000001 10 10 - 4 + 0 + 5 + # of fine nodes - 1 - 2 - 2 - 3 + GTK_FILL - + True True - 0 0 9999999 0.10000000000000001 10 10 - 4 + 0 0 9999999 1 10 10 1 2 - 1 - 2 - - 122 + + 1 True 0 5 - Distortion factor + Coarsening factor - 2 - 3 + 1 + 2 GTK_FILL - - 1 + + 122 True 0 5 - Coarsening factor + Distortion factor - 1 - 2 + 2 + 3 GTK_FILL - + True True - 0 0 9999999 1 10 10 + 0 0 9999999 0.10000000000000001 10 10 + 4 1 2 + 1 + 2 - - 1 + True - 0 - 5 - # of fine nodes + True + 0 0 9999999 0.10000000000000001 10 10 + 4 - GTK_FILL + 1 + 2 + 2 + 3 @@ -3668,70 +3681,70 @@ Box 2 3 - + True - Label focus + Dist 2 limit True - - 2 - 3 - 1 - 2 - - + True - Color edges + Animate True 1 2 - 1 - 2 - + True - Color nodes + Label fine nodes True - 1 - 2 + 2 + 3 - + True - Label fine nodes + Color nodes True - 2 - 3 + 1 + 2 - + True - Animate + Color edges True 1 2 + 1 + 2 - + True - Dist 2 limit + Label focus True + + 2 + 3 + 1 + 2 + @@ -3770,18 +3783,7 @@ Box - - 47 - True - #000000000000 - - - 4 - 5 - - - - + 122 32 True @@ -3789,9 +3791,7 @@ Box 30 Finest: - - 3 - 4 + GTK_FILL @@ -3807,7 +3807,7 @@ Box - + 122 32 True @@ -3816,10 +3816,23 @@ Box Finest: + 3 + 4 GTK_FILL + + + 47 + True + #000000000000 + + + 4 + 5 + + False @@ -3922,44 +3935,26 @@ Box 9 1 - - True - 0 - 0.89999997615814209 - 5 - Position - - - - - 8 - True - - - 1 - 2 - GTK_FILL - - - - + True 3 2 - - 50 + + 8 True 0 5 - X + Z + 2 + 3 GTK_FILL - + 7 True 0 @@ -3973,24 +3968,22 @@ Box - - 8 + + 50 True 0 5 - Z + X - 2 - 3 GTK_FILL - + True True - 0 -500000 50000 1 10 10 + 100 -360 360 1 10 10 1 @@ -3998,10 +3991,10 @@ Box - + True True - 100 -500000 500000 1 10 10 + 1 -360 360 1 10 10 1 @@ -4011,10 +4004,10 @@ Box - + True True - -50000 -50000 50000 1 10 10 + 100 -360 360 1 10 10 1 @@ -4025,20 +4018,43 @@ Box - 2 - 3 + 8 + 9 - + + 8 + True + + + 7 + 8 + GTK_FILL + + + + True 0 + 0.89999997615814209 5 - Target + Camera Vector - 3 - 4 + 6 + 7 + + + + + 8 + True + + + 4 + 5 + GTK_FILL @@ -4047,80 +4063,80 @@ Box 3 2 - - 8 + True - 0 - 5 - Z + True + 100 -500000 5000000 1 10 10 + 1 + 2 2 3 - GTK_FILL - - 7 + True - 0 - 5 - Y + True + 1 -500000 500000 1 10 10 + 1 + 2 1 2 - GTK_FILL - - 50 + True - 0 - 5 - X + True + 100 -500000 500000 1 10 10 - GTK_FILL + 1 + 2 - + + 50 True - True - 100 -500000 500000 1 10 10 + 0 + 5 + X - 1 - 2 + GTK_FILL - + + 7 True - True - 1 -500000 500000 1 10 10 + 0 + 5 + Y - 1 - 2 1 2 + GTK_FILL - + + 8 True - True - 100 -500000 5000000 1 10 10 + 0 + 5 + Z - 1 - 2 2 3 + GTK_FILL @@ -4130,50 +4146,27 @@ Box - - 8 - True - - - 4 - 5 - GTK_FILL - - - - + True 0 - 0.89999997615814209 5 - Camera Vector - - - 6 - 7 - - - - - 8 - True + Target - 7 - 8 - GTK_FILL + 3 + 4 - + True 3 2 - + True True - 100 -360 360 1 10 10 + -50000 -50000 50000 1 10 10 1 @@ -4183,10 +4176,10 @@ Box - + True True - 1 -360 360 1 10 10 + 100 -500000 500000 1 10 10 1 @@ -4196,10 +4189,10 @@ Box - + True True - 100 -360 360 1 10 10 + 0 -500000 50000 1 10 10 1 @@ -4207,19 +4200,21 @@ Box - - 50 + + 8 True 0 5 - X + Z + 2 + 3 GTK_FILL - + 7 True 0 @@ -4233,25 +4228,43 @@ Box - - 8 + + 50 True 0 5 - Z + X - 2 - 3 GTK_FILL - 8 - 9 + 2 + 3 + + + + + 8 + True + + + 1 + 2 + GTK_FILL + + + True + 0 + 0.89999997615814209 + 5 + Position + + 9