// glEnable(GL_LINE_SMOOTH);
gdk_gl_drawable_gl_end(gldrawable);
+
+
/*** OpenGL END ***/
return;
}
glMatrixMode(GL_MODELVIEW);
gdk_gl_drawable_gl_end(gldrawable);
/*** OpenGL END ***/
- return TRUE;
+
+
+ return TRUE;
}
/*
{
GdkGLContext *glcontext = gtk_widget_get_gl_context(widget);
GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable(widget);
+
+
/*** 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
+ glexpose_main(view); //draw all stuff
/* Swap buffers */
if (gdk_gl_drawable_is_double_buffered(gldrawable))
gdk_gl_drawable_swap_buffers(gldrawable);
glFlush();
gdk_gl_drawable_gl_end(gldrawable);
/*** OpenGL END ***/
- return TRUE;
+ if (view->initFile)
+ {
+ view->initFile=0;
+ if (view->activeGraph == 0)
+ close_graph(view,0);
+ add_graph_to_viewport_from_file(view->initFileName);
+ }
+
+ return TRUE;
}
#ifdef UNUSED
g_signal_connect((gpointer) gladewidget, "destroy",
G_CALLBACK(mQuitSlot), NULL);
glade_xml_signal_autoconnect(xml);
- gtk_gl_init(0, 0);
+ if (initFileName)
+ {
+ view->initFile=1;
+ view->initFileName=strdup(initFileName);
+ }
+ gtk_gl_init(0, 0);
/* Configure OpenGL framebuffer. */
glconfig = configure_gl();
gladewidget = glade_xml_get_widget(xml, "vbox2");
create_window(glconfig, gladewidget);
- if (initFileName)
- add_graph_to_viewport_from_file(initFileName);
change_cursor(GDK_TOP_LEFT_ARROW);
+ glutInit(&argc,&argv);
gtk_main();
int visiblenodecount; /*helper variable to know the number of the nodes being rendered, good data to optimize speed*/
md5_byte_t orig_key[16] ; /*md5 result for original graph*/
md5_byte_t final_key[16] ; /*md5 result right before graph is saved*/
+ char* initFileName; //file name from command line
+ int initFile;
} ViewInfo;
#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=0;
+static int FLUSH=1;
static void color_interpolation(glCompColor srcColor,glCompColor tarColor,glCompColor* color,int levelcount,int level)
{
void drawtopologicalfisheye(topview * t)
{
- get_active_frame(t);
- drawtopfishnodes(t);
-// drawtopologicalfisheyestatic(t);
-
- drawtopfishedges(t);
- if(!t->animate)
- drawtopfishnodelabels(t);
-
-
-/* if (FLUSH==1)
+ if (FLUSH==1)
{
+ get_active_frame(t);
+ drawtopfishnodes(t);
+ drawtopfishedges(t);
+ if(!t->animate)
+ drawtopfishnodelabels(t);
FLUSH=0;
- expose_event(view->drawing_area, NULL, NULL);
- ;
- }*/
-
+ }
}
{
g_timer_stop(view->timer);
view->Topview->animate=0;
- FLUSH=1;
return 0;
}
//FIXME: I don't think an openGL function can be called before it
// is initialized.
-#ifdef _WIN32
- glClearColor(view->bgColor.R, view->bgColor.G, view->bgColor.B, view->bgColor.A); //background color
-#endif
+ if (view->graphCount > 0)
+ glClearColor(view->bgColor.R, view->bgColor.G, view->bgColor.B, view->bgColor.A); //background color
}
static gboolean gl_main_expose(gpointer data) {
//returns 1 if successfull else 0
int ind=0;
Agraph_t *graph;
- graph = loadGraph(fileName);
+
+ graph = loadGraph(fileName);
if (graph) {
view->graphCount = view->graphCount + 1;
view->g =
sizeof(Agraph_t *) * view->graphCount);
view->g[view->graphCount - 1] = graph;
view->activeGraph = view->graphCount - 1;
- //GUI update , graph combo box on top-right should be updated
load_settings_from_graph(view->g[view->activeGraph]);
update_graph_from_settings(view->g[view->activeGraph]);
set_viewport_settings_from_template(view, view->g[view->activeGraph]);
fill_key(view->orig_key,get_md5_key(graph));
- printf ("graph original identification:");
- for (ind=0;ind < 16;ind ++)
- {
- printf ("%x ",view->orig_key[ind]);
- }
-
+ expose_event(view->drawing_area, NULL, NULL);
return 1;
} else
- return 0;
+ {
+ return 0;
+
+ }
}