From: arif Date: Mon, 7 Jul 2008 20:39:42 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: LAST_LIBGRAPH~32^2~3878 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0eefbbbb7bf93a9e6b1280587416b29f51a52a95;p=graphviz *** empty log message *** --- diff --git a/cmd/smyrna/draw.c b/cmd/smyrna/draw.c index f2dd4e7c1..bdf0baeaf 100755 --- a/cmd/smyrna/draw.c +++ b/cmd/smyrna/draw.c @@ -835,3 +835,15 @@ int draw_node_hintbox(GLfloat x,GLfloat y,GLfloat fs,GLfloat pad,GLfloat z,GLflo } +static GLUquadric* sphere; +void draw_sphere(float x,float y,float z,float r) +{ + if(!sphere) + fisheyesphere=gluNewQuadric(); + gluQuadricDrawStyle ( fisheyesphere, GLU_FILL ); + glTranslatef(x,y,z); + gluSphere(fisheyesphere,r,SPHERE_SLICE_COUNT,SPHERE_SLICE_COUNT); + glTranslatef(-x,-y,-z); +} + + diff --git a/cmd/smyrna/draw.h b/cmd/smyrna/draw.h index a8473fabd..b2a883364 100755 --- a/cmd/smyrna/draw.h +++ b/cmd/smyrna/draw.h @@ -44,4 +44,8 @@ extern RGBColor GetRGBColor(char *color); extern void drawBorders(ViewInfo * view); void drawEllipse(float xradius, float yradius,int angle1,int angle2); int draw_node_hintbox(GLfloat x,GLfloat y,GLfloat fs,GLfloat pad,GLfloat z,GLfloat kts,GLfloat z_offset); + +void draw_sphere(float x,float y,float z,float r); + #endif + diff --git a/cmd/smyrna/gltemplate.c b/cmd/smyrna/gltemplate.c index 5a47ca1b0..aa9dabf2f 100755 --- a/cmd/smyrna/gltemplate.c +++ b/cmd/smyrna/gltemplate.c @@ -123,7 +123,7 @@ static void realize(GtkWidget * widget, gpointer data) /*smyrna does not use any ligthting affects but can be turned on for more effects in the future */ GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 }; - GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat diffuse[] = { 0.5, 0.5, 0.5, 1.0 }; GLfloat position[] = { 0.0, 3.0, 3.0, 0.0 }; GLfloat lmodel_ambient[] = { 0.2f, 0.2f, 0.2f, 1.0f }; @@ -153,7 +153,7 @@ static void realize(GtkWidget * widget, gpointer data) glFrontFace(GL_CW); // glEnable (GL_LIGHTING); -// glEnable (GL_LIGHT0); +// glEnable (GL_LIGHT0); // glEnable (GL_AUTO_NORMAL); // glEnable (GL_NORMALIZE); glEnable(GL_DEPTH_TEST); diff --git a/cmd/smyrna/gui/topviewsettings.c b/cmd/smyrna/gui/topviewsettings.c index 908459285..dc7eb1188 100644 --- a/cmd/smyrna/gui/topviewsettings.c +++ b/cmd/smyrna/gui/topviewsettings.c @@ -139,27 +139,110 @@ static int get_spinbtn_widget_to_attribute(char *attribute, agattr(g, AGRAPH, attribute, buf); return 1; } +static int get_scalebtn_widget_to_attribute(char *attribute, + char *widget_name, Agraph_t * g) +{ + float value; + char buf[25]; + value = + (float) gtk_range_get_value((GtkRange *) + glade_xml_get_widget(xml, + widget_name)); + sprintf(buf, "%f", value); + // agattr( + agattr(g, AGRAPH, attribute, buf); + return 1; +} - -int load_settings_from_graph(Agraph_t * g) +static int set_scalebtn_widget_to_attribute(char *attribute, char *widget_name) { char *buf; + float value; + buf = agget(view->g[view->activeGraph], attribute); + if ((!buf) || (strcmp(buf, "") == 0)) + buf = agget(view->default_attributes, attribute); + if (buf) { + value = (float) atof(buf); + gtk_range_set_value((GtkSpinButton *) + glade_xml_get_widget(xml, widget_name), + value); + return 1; + } + return 0; +} +static int set_combobox_widget(char *attribute,char *widget_name) +{ + char *buf; + float value; + buf = agget(view->g[view->activeGraph], attribute); + + if ((!buf) || (strcmp(buf, "") == 0)) + buf = agget(view->default_attributes, attribute); + if (buf) + { + gtk_combo_box_set_active( + (GtkComboBox *) glade_xml_get_widget(xml,widget_name), + (int)value); + + return 1; + } + + return 0; +} +static int get_combobox_widget_to_attribute(char *attribute, char *widget_name, Agraph_t * g) +{ + char buf[25]; + float value; - set_color_button_widget("bgcolor", "settingsColorBtn1"); + value= + gtk_combo_box_get_active((GtkComboBox *) + glade_xml_get_widget(xml, + widget_name)); + + sprintf(buf, "%f", value); + agattr(g, AGRAPH, attribute, buf); + return 1; + + +} + + + +/* +Q-What are these set and get functions ? +A-These are functions to set and get data from GTK widgets based on what object they are +User click on setting windows, all window parameters are updated from current graph, +default values are stored in a template graph "" + +*/ + + + + + +int load_settings_from_graph(Agraph_t * g) +{ + char *buf; /*local buffer*/ + + + + + + set_color_button_widget("bgcolor", "settingsColorBtn1"); set_color_button_widget("bordercolor", "settingsColorBtn2"); set_color_button_widget("gridcolor", "settingsColorBtn3"); set_color_button_widget("highlightednodecolor", "settingsColorBtn6"); set_color_button_widget("highlightededgecolor", "settingsColorBtn7"); set_color_button_widget("selectednodecolor", "settingsColorBtn8"); set_color_button_widget("selectededgecolor", "settingsColorBtn9"); - get_color_button_widget_to_attribute("topologicaltopviewfinestcolor", + set_color_button_widget("topologicaltopviewfinestcolor", "settingsColorBtn9", g); - get_color_button_widget_to_attribute("topologicaltopviewcoarsestcolor", + set_color_button_widget("topologicaltopviewcoarsestcolor", "settingsColorBtn9", g); set_color_button_widget("topologicaltopviewfinestcolor", "settingsColorBtn10"); - set_color_button_widget("topologicaltopviewcoarsestcolor", + set_color_button_widget("topologicaltopviewcoarsestcolor ", "settingsColorBtn11"); @@ -188,7 +271,16 @@ int load_settings_from_graph(Agraph_t * g) set_checkbox_widget("topologicalfisheyelabelfocus", "settingsChkBox18"); - set_spinbtn_widget("defaultmagnifierwidth", "settingsspinbutton1"); + set_checkbox_widget("defaultnodeshapegl", + "settingsChkBox10_1"); + set_checkbox_widget("defaultnodeshapespherical", + "settingsChkBox10_2"); + set_checkbox_widget("defaultnodeshaperectangular", + "settingsChkBox10_3"); + + + + set_spinbtn_widget("defaultmagnifierwidth", "settingsspinbutton1"); set_spinbtn_widget("defaultmagnifierheight", "settingsspinbutton2"); set_spinbtn_widget("defaultmagnifierkts", "settingsspinbutton3"); set_spinbtn_widget("defaultfisheyemagnifierradius", @@ -201,9 +293,14 @@ int load_settings_from_graph(Agraph_t * g) "settingsspinbutton7"); set_spinbtn_widget("topologicalfisheyedistortionfactor", "settingsspinbutton8"); + + /*alpha values,1 for nodes 1 for edges*/ - /*font selection box */ + set_scalebtn_widget_to_attribute("defaultnodealpha", "settingsscale1"); /*node alpha*/ + set_scalebtn_widget_to_attribute("defaultedgealpha", "settingsscale2"); /*edge alpha*/ + + /*font selection box */ buf = agget(view->g[view->activeGraph], "defaultfontname"); if (!buf) buf = agget(view->default_attributes, "defaultfontname"); @@ -220,7 +317,7 @@ int load_settings_from_graph(Agraph_t * g) /*select the right item in combo box */ gtk_combo_box_set_active((GtkComboBox *) glade_xml_get_widget(xml, - "settingsFontSelection"), + "settingscombobox1"), atoi(buf)); } return 1; @@ -282,7 +379,10 @@ int update_graph_from_settings(Agraph_t * g) get_checkbox_widget_to_attribute("usermode", "settingsChkBox10", g); - get_checkbox_widget_to_attribute("nodesizewithdegree", + + + + get_checkbox_widget_to_attribute("nodesizewithdegree", "settingsChkBox11", g); get_checkbox_widget_to_attribute("antialiasing", "settingsChkBox12", g); @@ -316,8 +416,14 @@ int update_graph_from_settings(Agraph_t * g) "settingsspinbutton7", g); get_spinbtn_widget_to_attribute("topologicalfisheyedistortionfactor", "settingsspinbutton8", g); + /*added later*/ + get_scalebtn_widget_to_attribute("defaultnodealpha", + "settingsscale1", g); + get_scalebtn_widget_to_attribute("defaultedgealpha", + "settingsscale2", g); - return 1; + get_combobox_widget_to_attribute("defaultnodeshape","settingscombobox1", g) ; + return 1; } int show_settings_form() diff --git a/cmd/smyrna/smyrnadefs.h b/cmd/smyrna/smyrnadefs.h index 1a6f79f95..4b62d5389 100644 --- a/cmd/smyrna/smyrnadefs.h +++ b/cmd/smyrna/smyrnadefs.h @@ -75,6 +75,12 @@ #define NODE_ZOOM_LIMIT -25.3 #define NODE_CIRCLE_LIMIT -7.3 +#define GL_DOTSIZE_CONSTANT -5 + + +#define SPHERE_SLICE_COUNT 6 +#define DOT_SIZE_CORRECTION_FAC 0.3 + typedef enum { nodshapedot,nodeshapecircle} node_shape; typedef enum { leftmousebutton,rightmousebutton,thirdmousebutton} clicked_mouse_button; typedef enum { MOUSE_ROTATE_X,MOUSE_ROTATE_Y,MOUSE_ROTATE_XY,MOUSE_ROTATE_Z} mouse_rotate_axis; @@ -381,6 +387,12 @@ typedef struct _ViewInfo RGBColor selectedNodeColor; /*selected edge color*/ RGBColor selectedEdgeColor; + /*default node alpha*/ + float defaultnodealpha; + /*default edge alpha*/ + float defaultedgealpha; + /*default node shape*/ + int defaultnodeshape; /*default line width*/ float LineWidth; diff --git a/cmd/smyrna/topfisheyeview.c b/cmd/smyrna/topfisheyeview.c index 162c7463b..32c158982 100644 --- a/cmd/smyrna/topfisheyeview.c +++ b/cmd/smyrna/topfisheyeview.c @@ -254,7 +254,7 @@ void prepare_topological_fisheye(topview* t) draws all level 0 nodes and edges, during animation */ -void drawtopologicalfisheye2(topview * t) +int drawtopologicalfisheye2(topview * t) { int level, v, i, n; Hierarchy *hp = t->h; @@ -277,6 +277,8 @@ void drawtopologicalfisheye2(topview * t) if(get_temp_coords(t,level,v,&x0,&y0,&R,&G,&B)) { 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); } } @@ -288,6 +290,7 @@ void drawtopologicalfisheye2(topview * t) //draw edges + glLineWidth(2); glBegin(GL_LINES); for (level = 0; level < hp->nlevels; level++) { @@ -301,17 +304,20 @@ void drawtopologicalfisheye2(topview * t) for (i = 1; i < g[v].nedges; i++) { double x, y; + float RR,GG,BB; + RR=0;GG=0;BB=0; n = g[v].edges[i]; - if(get_temp_coords(t,level,n,&x,&y,&R,&G,&B)) + + if(get_temp_coords(t,level,n,&x,&y,&RR,&GG,&BB)) { 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); +// glColor3f(0,1,0); + glVertex3f((GLfloat) x0, (GLfloat) y0,(GLfloat) 0); glVertex3f((GLfloat) x, (GLfloat) y,(GLfloat) 0); } @@ -325,7 +331,8 @@ void drawtopologicalfisheye2(topview * t) } } - glEnd(); + glEnd(); + return 1; } int get_temp_coords(topview* t,int level,int v,double* coord_x,double* coord_y,float *R,float *G,float *B) @@ -334,6 +341,9 @@ int get_temp_coords(topview* t,int level,int v,double* coord_x,double* coord_y,f ex_vtx_data *gg = hp->geom_graphs[level]; /* v_data *g = hp->graphs[level]; */ int OAL,AL; + double x0,y0,x1,y1; + float R0,R1,G0,G1,B0,B1; + OAL=gg[v].old_active_level; AL=gg[v].active_level; /*if ((OAL > level) && (AL>level)) @@ -341,7 +351,7 @@ int get_temp_coords(topview* t,int level,int v,double* coord_x,double* coord_y,f if ((OAL < level) && (ALanimate) + /*if (!t->animate) { if (AL == level) { @@ -353,14 +363,16 @@ int get_temp_coords(topview* t,int level,int v,double* coord_x,double* coord_y,f return 0; } else - { + {*/ - double x0,y0,x1,y1; x0=0; y0=0; x1=0; y1=0; - + R0=1;R1=0; + G0=0;G1=1; + B0=0;B1=0; + get_active_frame(t); if ((OAL == level) && (AL==level)) { @@ -368,8 +380,9 @@ int get_temp_coords(topview* t,int level,int v,double* coord_x,double* coord_y,f y0=(double)gg[v].old_physical_y_coord; x1=(double)gg[v].physical_x_coord; y1=(double)gg[v].physical_y_coord; - *G=0; - *R=1; + R0=1;R1=1; + G0=0;G1=0; + B0=0;B1=0; } if ((OAL == level) && (AL>level)) @@ -378,7 +391,9 @@ int get_temp_coords(topview* t,int level,int v,double* coord_x,double* coord_y,f y0=(double)gg[v].old_physical_y_coord; find_physical_coords(t->h,level,v,&x1,&y1); *G=view->active_frame/view->total_frames; - *R=0; + R0=1;R1=0; + G0=0;G1=1; + B0=0;B1=0; } if ((OAL > level) && (AL==level)) @@ -388,22 +403,29 @@ int get_temp_coords(topview* t,int level,int v,double* coord_x,double* coord_y,f y1=(double)gg[v].physical_y_coord; *R=view->active_frame/view->total_frames; *G=1/(view->active_frame/view->total_frames+0.0000001); + R0=1;R1=1; + G0=0;G1=0; + B0=0;B1=0; + } if ((OAL > level) && (AL>level)) { find_old_physical_coords(t->h,level,v,&x0,&y0); find_physical_coords(t->h,level,v,&x1,&y1); - *G=1; - *R=0; + R0=0;R1=0; + G0=1;G1=1; + B0=0;B1=0; } + *R=R0+(R1-R0)/(double)view->total_frames*(double)(view->active_frame+1); + *G= G0+(G1-G0)/(double)view->total_frames*(double)(view->active_frame+1); + *B= B0+(B1-B0)/(double)view->total_frames*(double)(view->active_frame+1); get_interpolated_coords(x0,y0,x1,y1,view->active_frame,view->total_frames,coord_x,coord_y); - return 1; - } - return 0; + //} + return 1; } @@ -544,8 +566,18 @@ void refresh_old_values(topview* t) } void get_interpolated_coords(double x0,double y0,double x1,double y1,int fr,int total_fr, double* x,double* y) { - *x=x0+(x1-x0)/(double)total_fr*(double)(fr+1); - *y= y0+(y1-y0)/(double)total_fr*(double)(fr+1); + if (view->Topview->animate) + { + *x=x0+(x1-x0)/(double)total_fr*(double)(fr+1); + *y= y0+(y1-y0)/(double)total_fr*(double)(fr+1); + } + else + { + *x=x1; + *y= y1; + } + + } int get_active_frame(topview* t) { @@ -568,7 +600,7 @@ int get_active_frame(topview* t) else { g_timer_stop(view->timer); -// view->Topview->animate=0; + view->Topview->animate=0; return 0; } diff --git a/cmd/smyrna/topfisheyeview.h b/cmd/smyrna/topfisheyeview.h index a7f26a255..3e09b2678 100644 --- a/cmd/smyrna/topfisheyeview.h +++ b/cmd/smyrna/topfisheyeview.h @@ -23,7 +23,7 @@ void fisheye_spherical(double x_focus, double y_focus, double z_focus, topview * t); void prepare_topological_fisheye(topview*); void drawtopologicalfisheye(topview * t); -void drawtopologicalfisheye2(topview * t); +int drawtopologicalfisheye2(topview * t); void changetopfishfocus(topview * t, float *x, float *y, float *z, int num_foci); void refresh_old_values(topview* t); diff --git a/cmd/smyrna/topview.c b/cmd/smyrna/topview.c index d2c7f94a9..4d8591fb9 100755 --- a/cmd/smyrna/topview.c +++ b/cmd/smyrna/topview.c @@ -210,6 +210,77 @@ void preparetopview(Agraph_t * g, topview * t) t->picked_node_count = 0; t->picked_nodes = '\0'; } +/* + this function calculates and sets node size(opengl dots, they are squares not a dots + if anybody has any problem with dot size please just modify this function + active_camera=-1 means view is in 2D mode,0 and above means there is a 3D camera active. + I use different params for both situations since they are viewed differently.. + If node shape is other than opengl dots, '#r' is replaced with the calculated value +*/ +/* + Notes about xdot: + I am planning to combine small graphs , for that purpose if there is an xdot string attached the either node or + edge and if a node's draw_xdot attribute is set , xdot is drawn for the object + example node: + A[draw_xdot="1",_draw_="S 6 -filled c 7 -#741818 C 7 -#741818 P 5 125 528 96 543 67 528 67 505 125 505 ", _ldraw_="F 14.000000 11 -Times-Roman c 7 -#eaeb2a T 96 516 0 22 3 -S24"] + + smyrna draws a house instead of a dot. +*/ + +static float set_gl_dot_size(topview * t) +{ + float dotsize; + if (view->active_camera==-1) + dotsize = GL_DOTSIZE_CONSTANT / view->zoom; + else + dotsize = GL_DOTSIZE_CONSTANT / view->cameras[view->active_camera]->r*-1; + + dotsize=dotsize * DOT_SIZE_CORRECTION_FAC; + if (dotsize <=1) + dotsize=1; + glPointSize(dotsize); + return dotsize; + +} + +static int begintopviewnodes(Agraph_t* g) +{ + switch (view->defaultnodeshape) + { + case 0: + set_gl_dot_size(view->Topview); + glBegin(GL_POINTS); + break; + case 1: + set_gl_dot_size(view->Topview); + break; + default: + set_gl_dot_size(view->Topview); + glBegin(GL_POINTS); + + }; + return 1; +} + +static int endtopviewnodes(Agraph_t* g) +{ + switch (view->defaultnodeshape) + { + case 0: + glEnd(); + break; + case 1: + break; + default: + glEnd(); + break; + + }; + return 1; +} + + + static int drawtopviewnodes(Agraph_t * g) { @@ -217,20 +288,14 @@ static int drawtopviewnodes(Agraph_t * g) float ddx, ddy, ddz; int ind = 0; float dotsize = 0; - if (view->zoom > NODE_ZOOM_LIMIT) { - dotsize = 50 / view->zoom * -1; - if (dotsize > 1) - glPointSize(dotsize); - else - glPointSize(1); + dotsize=set_gl_dot_size(view->Topview); //sets the size of the gl points - - //draw nodes set_topview_options(); - glBegin(GL_POINTS); + begintopviewnodes(g); for (ind = 0; ((ind < view->Topview->Nodecount) && (view->drawnodes)); - ind++) { + ind++) + { if (((-view->Topview->Nodes[ind].x / view->zoom > view->clipX1) && (-view->Topview->Nodes[ind].x / view->zoom < view->clipX2) @@ -259,7 +324,7 @@ static int drawtopviewnodes(Agraph_t * g) } else //get the color from node { glColor4f(v->Color.R, v->Color.G, v->Color.B, - v->node_alpha); + v->node_alpha*view->defaultnodealpha); ddx = 0; ddy = 0; ddz = 0; @@ -269,12 +334,21 @@ static int drawtopviewnodes(Agraph_t * g) zdepth = (float) Z_FORWARD_PLANE; else zdepth = (float) Z_BACK_PLANE; - glVertex3f(v->distorted_x - ddx, - v->distorted_y - ddy, v->distorted_z - ddz); + + if ((view->defaultnodeshape==0) || dotsize == 1) + { + glVertex3f(v->distorted_x - ddx, + v->distorted_y - ddy, v->distorted_z - ddz); + } + else if (view->defaultnodeshape==1) + { + draw_sphere(v->distorted_x - ddx, + v->distorted_y - ddy, v->distorted_z - ddz,0.25); + + } } } - glEnd(); - } + endtopviewnodes(g); return 1; } @@ -629,9 +703,9 @@ static int draw_topview_label(topview_node * v, float zdepth) fs = (v->degree == 1) ? (float) (log((double) v->degree + 1) * - (double) 7) : (float) (log((double) v->degree + + (double) 3) : (float) (log((double) v->degree + (double) 0.5) * - (double) 7); + (double) 3); fs = fs * v->zoom_factor; if (OD_Selected(v->Node) == 1) { ddx = dx; @@ -713,7 +787,7 @@ static int get_color_from_edge(topview_edge * e) int return_value = 0; float Alpha = 0; GtkHScale *AlphaScale = - (GtkHScale *) glade_xml_get_widget(xml, "frmHostAlphaScale"); + (GtkHScale *) glade_xml_get_widget(xml, "settingsscale2"); Alpha = (float) gtk_range_get_value((GtkRange *) AlphaScale); //check visibility; @@ -1109,6 +1183,35 @@ static void menu_click_rotate_z(void *p) view->mouse.rotate_axis = MOUSE_ROTATE_Z; } +static void menu_click_center(void *p) +{ + if (view->active_camera == -1) /*2D mode*/ + { + view->panx=0; + view->pany=0; + view->panz=0; + view->zoom=-20; + } + else /*there is active camera , adjust it to look at the center*/ + { + view->cameras[view->active_camera]->targetx=0; + view->cameras[view->active_camera]->targety=0; + view->cameras[view->active_camera]->r=20; + + } +} + +/*1) 3D select or identify. +2) Should 3D nodes have a size? (Strange behavior: some 3D views have large node sizes. Why the difference?) +3) Sanity button - if I get lost in 3D, reset the viewpoint so that I have a good view of the graph +4) Additional selection options when selecting nodes - at present, we do union - nice to have intersection, subtraction +5) User control of alpha, so I can fade out the edges. + +I'll see if I can track down the color bug.*/ + + + + static char *smyrna_icon_pan; static char *smyrna_icon_zoom; static char *smyrna_icon_zoomplus; @@ -1246,7 +1349,8 @@ static glCompSet *glcreate_gl_topview_menu() b->panel = p; b->groupid = 1; b->callbackfunc = menu_click_rotate_xy; - glCompSetAddButton(s, b); + + glCompSetAddButton(s, b); b = glCompButtonNew(125, 231, 40, 20, "Z", '\0', 0, 0); b->customptr = view; b->panel = p; @@ -1254,6 +1358,19 @@ static glCompSet *glcreate_gl_topview_menu() b->callbackfunc = menu_click_rotate_z; glCompSetAddButton(s, b); + //sanity button to center the drawing and fit it in the screen + b = glCompButtonNew(80, 201, 90, 20, "center", '\0', 0, 0); + b->customptr = view; + b->panel = p; + b->groupid = 0; + b->callbackfunc = menu_click_center; + b->color.R=0; + b->color.G=1; + b->color.B=0; + glCompSetAddButton(s, b); + + + //pan button b = glCompButtonNew(5, 120, 72, 72, "adasasds", smyrna_icon_pan, 72, diff --git a/cmd/smyrna/viewport.c b/cmd/smyrna/viewport.c index 4ced3651e..b3acd33f0 100755 --- a/cmd/smyrna/viewport.c +++ b/cmd/smyrna/viewport.c @@ -156,7 +156,10 @@ set_viewport_settings_from_template(ViewInfo * view, Agraph_t * g) get_attribute_value("gridsize", view, g)); - view->gridVisible = atoi(get_attribute_value("gridvisible", view, g)); + view->defaultnodeshape=atoi(buf=get_attribute_value("defaultnodeshape", view,g)); + + + view->gridVisible = atoi(get_attribute_value("gridvisible", view, g)); //mouse mode=pan @@ -205,6 +208,14 @@ set_viewport_settings_from_template(ViewInfo * view, Agraph_t * g) view->highlightedEdgeColor.A = (float) atof(get_attribute_value("highlightededgecoloralpha", view, g)); + view->defaultnodealpha = + (float) + atof(get_attribute_value("defaultnodealpha", view, g)); + + view->defaultedgealpha = + (float) + atof(get_attribute_value("defaultedgealpha", view, g)); + /* @@ -1186,6 +1197,11 @@ int gl_main_expose() { return 1; } + +/*following code does not do what i like it to do*/ +/*I liked to have a please wait window on the screen all i got was the outer borders of the window +GTK requires a custom widget expose function +*/ void please_wait() { gtk_widget_hide(glade_xml_get_widget(xml, "frmWait")); diff --git a/share/gui/smyrna.glade b/share/gui/smyrna.glade index 812c35960..de174e0f0 100755 --- a/share/gui/smyrna.glade +++ b/share/gui/smyrna.glade @@ -1,6 +1,6 @@ - + 470 @@ -787,7 +787,7 @@ topview True - dot + Dot True @@ -795,7 +795,7 @@ topview True - neato + Neato True @@ -803,7 +803,7 @@ topview True - twopi + Twopi True @@ -811,7 +811,7 @@ topview True - circo + Circo True @@ -819,7 +819,7 @@ topview True - fdp + Fdp True @@ -970,7 +970,7 @@ topview 80 26 True - Open graph + Open Graph @@ -983,7 +983,7 @@ topview 80 26 True - Save graph + Save Graph @@ -996,7 +996,7 @@ topview 96 26 True - Remove graph + Remove Graph @@ -1009,7 +1009,7 @@ topview 80 26 True - New graph + New Graph @@ -1066,7 +1066,7 @@ topview 60 26 True - circo + Circo @@ -1093,7 +1093,7 @@ topview 62 26 True - neato + Neato GTK_RELIEF_HALF 0.54000002145767212 GTK_POS_BOTTOM @@ -1986,36 +1986,37 @@ topview 3 2 - + 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 @@ -2025,33 +2026,6 @@ topview 1 2 - - - - - True - 0 - Selection - - - - - True - 0 - Visible - - - 1 - 2 - - - - - True - 0 - Highlighted - - 2 3 @@ -2101,37 +2075,65 @@ topview - + + True + 0 + Highlighted + + + 2 + 3 + + + + + True + 0 + Visible + + + 1 + 2 + + + + + True + 0 + Selection + + + + 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 @@ -2141,8 +2143,6 @@ topview 1 2 - 2 - 3 @@ -2178,54 +2178,48 @@ topview 2 5 - - 2 + True >= - 1 - 2 - GTK_FILL + 3 + 4 + 1 + 2 - + True - >= + DATA 2 - 1 - 2 + 2 + 3 1 2 - - 180 - True - - - - - 180 + True 4 5 + 1 + 2 - - 63 + + 180 True - DATA 1 - 2 - 3 + 1 + 2 @@ -2239,48 +2233,54 @@ topview - - 180 + + 63 True + DATA 1 - 1 - 2 + 2 + 3 - + + 180 True 4 5 - 1 - 2 - + + 180 True - DATA 2 + + + + + True + >= - 2 - 3 + 1 + 2 1 2 - + + 2 True >= - 3 - 4 - 1 - 2 + 1 + 2 + GTK_FILL @@ -2530,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 - 1 - 2 + 2 + 3 - + + 56 True - 0 - Distortion factor - 2 - 3 + 1 + 2 - + + 56 True - 0 - Coersening factor + 1 + 2 1 2 - + + 56 True - 0 - Num. of fine Nodes + + 1 + 2 + 2 + 3 + @@ -2820,140 +2820,167 @@ topview - + True True 2 3 - 11 - 12 + 10 + 11 GTK_EXPAND - + True - 0 - 5 - Draw Labels + True - 11 - 12 + 2 + 3 + 9 + 10 + GTK_EXPAND - + True - #000000000000 + 0 + 5 + Draw Edges - 1 - 2 - 8 - 9 + 10 + 11 - + True 0 5 - Selected Edge Color + Draw Nodes - 8 - 9 + 9 + 10 - + True - True + 0 + 5 + Background Color + + + + + True + #000000000000 - 2 - 3 - 4 - 5 - GTK_EXPAND + 1 + 2 - + True - True + 0 + 5 + Border Color - 2 - 3 - 3 - 4 - GTK_EXPAND + 1 + 2 - + True - True + 0 + 5 + Grid Color - 2 - 3 2 3 - GTK_EXPAND - + True - True + 0 + 5 + Randomize Node Colors - 2 - 3 - 1 - 2 - GTK_EXPAND + 3 + 4 - + True - #000000000000 + 0 + 5 + Randomize Edge Colors - 1 - 2 - 7 - 8 + 4 + 5 - + True - #000000000000 + 0 + 5 + Highlighted Node Color + + + 5 + 6 + + + + + True + 0 + 5 + Highlighted Edge Color - 1 - 2 6 7 - + + True + 0 + 5 + Selected Node Color + + + 7 + 8 + + + + True #000000000000 1 2 - 5 - 6 + 1 + 2 @@ -2969,166 +2996,139 @@ topview - + True #000000000000 1 2 - 1 - 2 + 5 + 6 - + True - 0 - 5 - Selected Node Color + #000000000000 - 7 - 8 + 1 + 2 + 6 + 7 - + True - 0 - 5 - Highlighted Edge Color + #000000000000 - 6 - 7 + 1 + 2 + 7 + 8 - + True - 0 - 5 - Highlighted Node Color + True - 5 - 6 + 2 + 3 + 1 + 2 + GTK_EXPAND - + True - 0 - 5 - Randomize Edge Colors + True - 4 - 5 + 2 + 3 + 2 + 3 + GTK_EXPAND - + True - 0 - 5 - Randomize Node Colors + True + 2 + 3 3 4 + GTK_EXPAND - + True - 0 - 5 - Grid Color + True - 2 - 3 + 2 + 3 + 4 + 5 + GTK_EXPAND - + True 0 5 - Border Color + Selected Edge Color - 1 - 2 + 8 + 9 - + True #000000000000 1 2 + 8 + 9 - - True - 0 - 5 - Background Color - - - - - True - 0 - 5 - Draw Nodes - - - 9 - 10 - - - - + True 0 5 - Draw Edges - - - 10 - 11 - - - - - True - True + Draw Labels - 2 - 3 - 9 - 10 - GTK_EXPAND + 11 + 12 - + True True 2 3 - 10 - 11 + 11 + 12 GTK_EXPAND @@ -3274,65 +3274,86 @@ topview True - 363 - 192 + 397 + 266 True - 4 + 6 2 - + True - 0 - 5 - Advanced Mode + 0 + OpenGL dots +Spherical +Custom + + 1 + 2 + 1 + 2 + - + True - 0 - 5 - Node Shape + 1 0 1 0.01 0 0 - 1 - 2 + 1 + 2 + 5 + 6 - + + True + 1 0 1 0.01 0 0 + + + 1 + 2 + 4 + 5 + + + + True 0 5 - Node Size with Degree + Edge Alpha - 2 - 3 + 5 + 6 - + True 0 5 - Anti-aliasing + Node Alpha - 3 - 4 + 4 + 5 - + True True 1 2 + 3 + 4 GTK_FILL - + GTK_EXPAND @@ -3346,43 +3367,69 @@ topview 2 3 GTK_FILL - + GTK_EXPAND - + True True 1 2 + GTK_FILL + GTK_EXPAND + + + + + True + 0 + 5 + Anti-aliasing + + 3 4 - GTK_FILL - - + + True + 0 + 5 + Node Size with Degree + + + 2 + 3 + + + + True - openGL dots -Circle -Box - + 0 + 5 + Node Shape - 1 - 2 1 2 - + + + True + 0 + 5 + Advanced Mode + + - 29 - 34 + 28 + 26 @@ -3416,100 +3463,100 @@ Box 2 2 - - 84 - True - 0 - Width - PANGO_WRAP_WORD_CHAR - - - GTK_EXPAND - - - - + True True - 3 0 5000 1 50 10 + 2 2 20 1 50 10 + 2 1 2 - 1 - 2 + 2 + 3 GTK_FILL - - 128 + + 84 True - True - 3 0 5000 1 50 10 + 0 + Zoom X + PANGO_WRAP_WORD_CHAR - 1 - 2 + 2 + 3 + GTK_EXPAND - + + 84 True 0 - 5 Height + PANGO_WRAP_WORD_CHAR - 1 - 2 1 2 + GTK_EXPAND - - 84 + True 0 + 5 Height - PANGO_WRAP_WORD_CHAR + 1 + 2 1 2 - GTK_EXPAND - - 84 + + 128 True - 0 - Zoom X - PANGO_WRAP_WORD_CHAR + True + 3 0 5000 1 50 10 - 2 - 3 - GTK_EXPAND + 1 + 2 - + True True - 2 2 20 1 50 10 - 2 + 3 0 5000 1 50 10 1 2 - 2 - 3 + 1 + 2 GTK_FILL + + + 84 + True + 0 + Width + PANGO_WRAP_WORD_CHAR + + + GTK_EXPAND + + 37 @@ -3575,54 +3622,54 @@ Box 2 2 - + 84 True 0 - Distortion + Radius PANGO_WRAP_WORD_CHAR - 1 - 2 GTK_EXPAND - - 128 + True True - 5 0 5000 1 50 10 + 4 0 5000 1 50 10 1 2 + 1 + 2 + GTK_FILL - + + 128 True True - 4 0 5000 1 50 10 + 5 0 5000 1 50 10 1 2 - 1 - 2 - GTK_FILL - + 84 True 0 - Radius + Distortion PANGO_WRAP_WORD_CHAR + 1 + 2 GTK_EXPAND @@ -3674,40 +3721,31 @@ Box - - 1 - True - 0 - 5 - # of fine nodes - - - GTK_FILL - - - - + True True - 0 0 9999999 1 10 10 + 0 0 9999999 0.10000000000000001 10 10 + 4 1 2 + 2 + 3 - - 1 + True - 0 - 5 - Coarsening factor + True + 0 0 9999999 0.10000000000000001 10 10 + 4 + 1 + 2 1 2 - GTK_FILL @@ -3725,31 +3763,40 @@ Box - + + 1 True - True - 0 0 9999999 0.10000000000000001 10 10 - 4 + 0 + 5 + Coarsening factor - 1 - 2 1 2 + GTK_FILL - + True True - 0 0 9999999 0.10000000000000001 10 10 - 4 + 0 0 9999999 1 10 10 1 2 - 2 - 3 + + + + + 1 + True + 0 + 5 + # of fine nodes + + + GTK_FILL @@ -3774,70 +3821,70 @@ Box 2 3 - + True - Dist 2 limit + Label focus True + + 2 + 3 + 1 + 2 + - + True - Animate + Color edges True 1 2 + 1 + 2 - + True - Label fine nodes + Color nodes True - 2 - 3 + 1 + 2 - + True - Color nodes + Label fine nodes True - 1 - 2 + 2 + 3 - + True - Color edges + Animate True 1 2 - 1 - 2 - + True - Label focus + Dist 2 limit True - - 2 - 3 - 1 - 2 - @@ -3876,7 +3923,18 @@ Box - + + 47 + True + #000000000000 + + + 4 + 5 + + + + 122 32 True @@ -3885,6 +3943,8 @@ Box Finest: + 3 + 4 GTK_FILL @@ -3900,7 +3960,7 @@ Box - + 122 32 True @@ -3909,23 +3969,10 @@ Box Finest: - 3 - 4 GTK_FILL - - - 47 - True - #000000000000 - - - 4 - 5 - - False @@ -4028,26 +4075,44 @@ Box 9 1 - + + True + 0 + 0.89999997615814209 + 5 + Position + + + + + 8 + True + + + 1 + 2 + GTK_FILL + + + + True 3 2 - - 8 + + 50 True 0 5 - Z + X - 2 - 3 GTK_FILL - + 7 True 0 @@ -4061,22 +4126,24 @@ Box - - 50 + + 8 True 0 5 - X + Z + 2 + 3 GTK_FILL - + True True - 100 -360 360 1 10 10 + 0 -500000 50000 1 10 10 1 @@ -4084,10 +4151,10 @@ Box - + True True - 1 -360 360 1 10 10 + 100 -500000 500000 1 10 10 1 @@ -4097,10 +4164,10 @@ Box - + True True - 100 -360 360 1 10 10 + -50000 -50000 50000 1 10 10 1 @@ -4111,43 +4178,20 @@ Box - 8 - 9 - - - - - 8 - True - - - 7 - 8 - GTK_FILL + 2 + 3 - + True 0 - 0.89999997615814209 5 - Camera Vector - - - 6 - 7 - - - - - 8 - True + Target - 4 - 5 - GTK_FILL + 3 + 4 @@ -4156,40 +4200,31 @@ Box 3 2 - + + 8 True - True - 100 -500000 5000000 1 10 10 + 0 + 5 + Z - 1 - 2 2 3 + GTK_FILL - + + 7 True - True - 1 -500000 500000 1 10 10 + 0 + 5 + Y - 1 - 2 1 2 - - - - - True - True - 100 -500000 500000 1 10 10 - - - 1 - 2 + GTK_FILL @@ -4205,31 +4240,40 @@ Box - - 7 + True - 0 - 5 - Y + True + 100 -500000 500000 1 10 10 + 1 + 2 + + + + + True + True + 1 -500000 500000 1 10 10 + + + 1 + 2 1 2 - GTK_FILL - - 8 + True - 0 - 5 - Z + True + 100 -500000 5000000 1 10 10 + 1 + 2 2 3 - GTK_FILL @@ -4239,27 +4283,50 @@ Box - + + 8 + True + + + 4 + 5 + GTK_FILL + + + + True 0 + 0.89999997615814209 5 - Target + Camera Vector - 3 - 4 + 6 + 7 - + + 8 + True + + + 7 + 8 + GTK_FILL + + + + True 3 2 - + True True - -50000 -50000 50000 1 10 10 + 100 -360 360 1 10 10 1 @@ -4269,10 +4336,10 @@ Box - + True True - 100 -500000 500000 1 10 10 + 1 -360 360 1 10 10 1 @@ -4282,10 +4349,10 @@ Box - + True True - 0 -500000 50000 1 10 10 + 100 -360 360 1 10 10 1 @@ -4293,21 +4360,19 @@ Box - - 8 + + 50 True 0 5 - Z + X - 2 - 3 GTK_FILL - + 7 True 0 @@ -4321,43 +4386,25 @@ Box - - 50 + + 8 True 0 5 - X + Z + 2 + 3 GTK_FILL - 2 - 3 - - - - - 8 - True - - - 1 - 2 - GTK_FILL + 8 + 9 - - - True - 0 - 0.89999997615814209 - 5 - Position - - 9