From 8bb67e68ab63c62edf40b85361041a0130806183 Mon Sep 17 00:00:00 2001 From: arif Date: Tue, 12 May 2009 15:23:37 +0000 Subject: [PATCH] timeout bug is fixed (topfish animation hasnt been working right for a while) --- cmd/smyrna/gltemplate.c | 36 +++++++++++++++++++----------------- cmd/smyrna/smyrnadefs.h | 1 + cmd/smyrna/topfisheyeview.c | 8 ++------ cmd/smyrna/topview.c | 1 + cmd/smyrna/viewport.c | 4 ++-- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/cmd/smyrna/gltemplate.c b/cmd/smyrna/gltemplate.c index 82e4d0607..344e6e566 100755 --- a/cmd/smyrna/gltemplate.c +++ b/cmd/smyrna/gltemplate.c @@ -225,26 +225,28 @@ gboolean expose_event(GtkWidget * widget, GdkEventExpose * event, GdkGLContext *glcontext = gtk_widget_get_gl_context(widget); GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable(widget); - + if(view->flush==1) + { /*** OpenGL BEGIN ***/ - if (!gdk_gl_drawable_gl_begin(gldrawable, glcontext)) - return FALSE; - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glLoadIdentity(); - glexpose_main(view); //draw all stuff + if (!gdk_gl_drawable_gl_begin(gldrawable, glcontext)) + return FALSE; + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glLoadIdentity(); + glexpose_main(view); //draw all stuff /* Swap buffers */ - if (gdk_gl_drawable_is_double_buffered(gldrawable)) - gdk_gl_drawable_swap_buffers(gldrawable); - else - glFlush(); - gdk_gl_drawable_gl_end(gldrawable); + if (gdk_gl_drawable_is_double_buffered(gldrawable)) + gdk_gl_drawable_swap_buffers(gldrawable); + else + glFlush(); + gdk_gl_drawable_gl_end(gldrawable); /*** OpenGL END ***/ - if (view->initFile) - { - view->initFile=0; - if (view->activeGraph == 0) - close_graph(view,0); - add_graph_to_viewport_from_file(view->initFileName); + if (view->initFile) + { + view->initFile=0; + if (view->activeGraph == 0) + close_graph(view,0); + add_graph_to_viewport_from_file(view->initFileName); + } } return TRUE; diff --git a/cmd/smyrna/smyrnadefs.h b/cmd/smyrna/smyrnadefs.h index bef44a804..0be00fc99 100644 --- a/cmd/smyrna/smyrnadefs.h +++ b/cmd/smyrna/smyrnadefs.h @@ -542,6 +542,7 @@ typedef struct _ViewInfo char* template_file; char* glade_file; char* attr_file; + int flush; diff --git a/cmd/smyrna/topfisheyeview.c b/cmd/smyrna/topfisheyeview.c index e6e2bcdbd..d0102828a 100644 --- a/cmd/smyrna/topfisheyeview.c +++ b/cmd/smyrna/topfisheyeview.c @@ -37,7 +37,6 @@ static int get_temp_coords(topview* t,int level,int v,double* coord_x,double* co #ifdef UNUSED static int get_temp_coords2(topview* t,int level,int v,double* coord_x,double* coord_y,float *R,float *G,float *B); #endif -static int FLUSH=1; static void color_interpolation(glCompColor srcColor,glCompColor tarColor,glCompColor* color,int levelcount,int level) { @@ -518,15 +517,12 @@ void drawtopfishedges(topview * t) void drawtopologicalfisheye(topview * t) { - if (FLUSH==1) - { get_active_frame(t); drawtopfishnodes(t); drawtopfishedges(t); if(!t->animate) - drawtopfishnodelabels(t); - FLUSH=0; - } + drawtopfishnodelabels(t); + } diff --git a/cmd/smyrna/topview.c b/cmd/smyrna/topview.c index 4999a9bf1..ccc4519a2 100755 --- a/cmd/smyrna/topview.c +++ b/cmd/smyrna/topview.c @@ -279,6 +279,7 @@ void preparetopview(Agraph_t * g, topview * t) t->Nodes[ind].degree = agdegree(g, v, 1, 1); if (t->Nodes[ind].degree > t->maxnodedegree) t->maxnodedegree=t->Nodes[ind].degree; + view->Topview->Nodes[ind].Label=NULL; t->Nodes[ind].node_alpha = 1; for (e = agfstout(g, v); e; e = agnxtout(g, e)) diff --git a/cmd/smyrna/viewport.c b/cmd/smyrna/viewport.c index a9067f814..c25031126 100755 --- a/cmd/smyrna/viewport.c +++ b/cmd/smyrna/viewport.c @@ -315,7 +315,7 @@ static gboolean gl_main_expose(gpointer data) { expose_event(view->drawing_area, NULL, NULL); return 1; } - return 0; + return 1; } void get_data_dir() @@ -486,7 +486,7 @@ void init_viewport(ViewInfo * view) view->Topview->Graphdata.selectedEdgesCount=0; view->Topview->Graphdata.selectedNodes=0; view->colschms=NULL; - + view->flush=1; //create fontset -- 2.40.0