endif
endif
-noinst_HEADERS = arcball.h btree.h draw.h drawxdot.h filter.h glexpose.h \
+noinst_HEADERS = arcball.h btree.h draw.h filter.h glexpose.h \
glmotion.h gltemplate.h gui/appmouse.h gui/callbacks.h \
hotkeymap.h materials.h md5.h polytess.h selectionfuncs.h \
smyrna_utils.h smyrnadefs.h support.h topfisheyeview.h \
topviewdata.h topviewdefs.h topviewfuncs.h trackball.h tvnodes.h \
viewport.h viewportcamera.h \
- gui/datalistcallbacks.h gui/filterscallbacks.h gui/frmobjectui.h \
+ gui/datalistcallbacks.h gui/frmobjectui.h \
gui/glcompui.h gui/gui.h gui/menucallbacks.h \
gui/toolboxcallbacks.h gui/topviewsettings.h gvprpipe.h hier.h
-smyrna_SOURCES = arcball.c btree.c draw.c drawxdot.c filter.c glexpose.c \
+smyrna_SOURCES = arcball.c btree.c draw.c filter.c glexpose.c \
glmotion.c gltemplate.c gui/appmouse.c gui/callbacks.c \
gvprpipe.c hier.c hotkeymap.c main.c md5.c polytess.c \
- selectionfuncs.c smyrna_utils.c support.c template.c topfisheyeview.c \
+ selectionfuncs.c smyrna_utils.c support.c topfisheyeview.c \
topviewdata.c topviewfuncs.c trackball.c tvnodes.c \
viewport.c viewportcamera.c \
- gui/datalistcallbacks.c gui/filterscallbacks.c gui/frmobjectui.c \
+ gui/datalistcallbacks.c gui/frmobjectui.c \
gui/glcompui.c gui/gui.c gui/menucallbacks.c \
gui/toolboxcallbacks.c gui/topviewsettings.c
int print_children(btree_node * n)
{
int i = 0;
- static int prev_rank = 0;
if (n->node_type == 2)
printf(" %*s=%s(%i)\n", n->rank * 5 + 1, n->attr_name,
n->regex, n->rank);
else
printf("%*s %c(%i)\n", n->rank * 5 + 1, "", n->op, n->rank);
- prev_rank = n->rank;
for (i = 0; i < n->child_count; i++)
{
print_children(n->childs[i]);
+++ /dev/null
-/* $Id$ $Revision$ */
-/* vim:set shiftwidth=4 ts=8: */
-
-/**********************************************************
-* This software is part of the graphviz package *
-* http://www.graphviz.org/ *
-* *
-* Copyright (c) 1994-2004 AT&T Corp. *
-* and is licensed under the *
-* Common Public License, Version 1.0 *
-* by AT&T Corp. *
-* *
-* Information and Software Systems Research *
-* AT&T Research, Florham Park NJ *
-**********************************************************/
-
-/*
-
-XDOT DRAWING FUNCTIONS, maybe need to move them somewhere else
- for now keep them at the bottom
-*/
-#include "draw.h"
-#include "drawxdot.h"
-/* #include "topview.h" */
-#include "colorprocs.h"
-#include "glutils.h"
-#include "math.h"
-
-#include "xdot.h"
-#include "viewport.h"
-#include "topfisheyeview.h"
-
-/* static float globalz = 0.0; */
-
-#ifdef UNUSED
-//delta values
-static float dx = 0.0;
-static float dy = 0.0;
-
-static void set_options(sdot_op * op, int param)
-{
-
- if ((param == 1) && (view->mouse.mouse_mode == 10) && (view->mouse.mouse_down == 1)) //selected, if there is move, move it
- {
- dx = view->GLx - view->GLx2;
- dy = view->GLy - view->GLy2;
- } else {
- dx = 0;
- dy = 0;
- }
-
-}
-
-static void SetFont(xdot_op * op, int param)
-{
- //activate the right font
- view->fontset->activefont = add_font(view->fontset, op->u.font.name); //load or set active font
- view->FontSize = (int) op->u.font.size;
-}
-
-static void relocate_spline(sdot_op * sop, int param)
-{
- Agedge_t *e;
- Agnode_t *tn; //tail node
- Agnode_t *hn; //head node
- int i = 0;
- xdot_op *op = &sop->op;
- if (AGTYPE(sop->obj) == AGEDGE) {
- e = sop->obj;
- tn = agtail(e);
- hn = aghead(e);
- if ((OD_Selected(hn) == 1) && (OD_Selected(tn) == 0)) {
- set_options(sop, 1);
- for (i = 1; i < op->u.bezier.cnt - 1; i = i + 1) {
- if ((dx != 0) || (dy != 0)) {
- op->u.bezier.pts[i].x =
- op->u.bezier.pts[i].x -
- (int) (dx * (float) i /
- (float) (op->u.bezier.cnt));
- op->u.bezier.pts[i].y =
- op->u.bezier.pts[i].y -
- (int) (dy * (float) i /
- (float) (op->u.bezier.cnt));
- }
- }
- if ((dx != 0) || (dy != 0)) {
- op->u.bezier.pts[op->u.bezier.cnt - 1].x =
- op->u.bezier.pts[op->u.bezier.cnt - 1].x - (int) dx;
- op->u.bezier.pts[op->u.bezier.cnt - 1].y =
- op->u.bezier.pts[op->u.bezier.cnt - 1].y - (int) dy;
- }
- } else if ((OD_Selected(hn) == 0) && (OD_Selected(tn) == 1)) {
- set_options(sop, 1);
- for (i = op->u.bezier.cnt - 1; i > 0; i = i - 1) {
- if ((dx != 0) || (dy != 0)) {
- op->u.bezier.pts[i].x =
- op->u.bezier.pts[i].x -
- (int) (dx * (float) (op->u.bezier.cnt - i) /
- (float) (op->u.bezier.cnt));
- op->u.bezier.pts[i].y =
- op->u.bezier.pts[i].y -
- (int) (dy * (float) (op->u.bezier.cnt - i) /
- (float) (op->u.bezier.cnt));
- }
- }
- if ((dx != 0) || (dy != 0)) {
- op->u.bezier.pts[0].x = op->u.bezier.pts[0].x - (int) dx;
- op->u.bezier.pts[0].y = op->u.bezier.pts[0].y - (int) dy;
- }
- } else if ((OD_Selected(hn) == 1) && (OD_Selected(tn) == 1)) {
- set_options(sop, 1);
- for (i = 0; i < op->u.bezier.cnt; i = i + 1) {
- if ((dx != 0) || (dy != 0)) {
- op->u.bezier.pts[i].x =
- op->u.bezier.pts[i].x - (int) dx;
- op->u.bezier.pts[i].y =
- op->u.bezier.pts[i].y - (int) dy;
- }
- }
- }
- }
-}
-
-static void DrawBeziers(xdot_op * op, int param)
-{
- //SEND ALL CONTROL POINTS IN 3D ARRAYS
-
- GLfloat tempX[4];
- GLfloat tempY[4];
- GLfloat tempZ[4];
- int temp = 0;
- int filled;
- int i = 0;
-// SelectBeziers((sdot_op *) op);
- relocate_spline((sdot_op *) op, param);
- if (op->kind == xd_filled_bezier)
- filled = 1;
- else
- filled = 0;
-
- for (i = 0; i < op->u.bezier.cnt; i = i + 1) {
- if (temp == 4) {
- DrawBezier(tempX, tempY, tempZ, filled, param);
- tempX[0] = (GLfloat) op->u.bezier.pts[i - 1].x;
- tempY[0] = (GLfloat) op->u.bezier.pts[i - 1].y;
- tempZ[0] = (GLfloat) op->u.bezier.pts[i - 1].z;
- temp = 1;
- tempX[temp] = (GLfloat) op->u.bezier.pts[i].x;
- tempY[temp] = (GLfloat) op->u.bezier.pts[i].y;
- tempZ[temp] = (GLfloat) op->u.bezier.pts[i].z;
- temp = temp + 1;
- } else {
- tempX[temp] = (GLfloat) op->u.bezier.pts[i].x;
- tempY[temp] = (GLfloat) op->u.bezier.pts[i].y;
- tempZ[temp] = (GLfloat) op->u.bezier.pts[i].z;
- temp = temp + 1;
- }
- }
- DrawBezier(tempX, tempY, tempZ, filled, param);
-}
-#endif
-
-/*function to load .raw files*/
-#ifdef UNUSED
-static void
-load_raw_texture(char *file_name, int width, int height, int depth,
- GLenum colour_type, GLenum filter_type)
-{
- //Line 3 creates a pointer to an (as yet unallocated) array of gl unsigned bytes -
- //this will store our image until we've passed it to opengl. Line 4 stores the file pointer, don't worry about that.
- GLubyte *raw_bitmap;
- FILE *file;
-
- //The if statement from line 6-10 opens the file and reports an error if it doesn't exist.
-
- if ((file = fopen(file_name, "rb")) == NULL) {
- printf("File Not Found : %s\n", file_name);
- exit(1);
- }
- //Line 11 allocates the correct number of bytes for the size and depth of the image. Remember, our image depth will usually be 3 -- one 'channel' each for red, green and blue values.
- //Lines 13-18 check if the memory was allocated correctly and quit the program if there was a problem.
-
- raw_bitmap = N_GNEW(width * height * depth, GLubyte);
-
- if (raw_bitmap == NULL) {
- printf("Cannot allocate memory for texture\n");
- fclose(file);
- exit(1);
- }
- //Line 19 reads the required number of bytes from the file and places them into our glubyte array. Line 20 closes the close as it isn't required anymore.
- fread(raw_bitmap, width * height * depth, 1, file);
- fclose(file);
-
- //Lines 22-25 set the texture's mapping type and environment settings. GL_TEXTURE_MAG_FILTER and GL_TEXTURE_MIN_FILTER are enumerands that let us change the way in which opengl magnifies and minifies the texture. If we passed GL_LINEAR to the function, our texture would be interpolated using bilinear filtering (in other words, it'd appear smoothed). If we passed GL_NEAREST then no smoothing would occur. By passing GL_MODULATE to the texture environment function, we tell opengl to blend the texture with the base colour of the object. Had we specified GL_DECAL or GL_REPLACE then the base colour (and therefore our lighting effect) would be replaced purely with the colours of the texture.
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter_type);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter_type);
-
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- //Line 27 passes the image to opengl using the function gluBuild2DMipmaps.
- //Read a graphics book for a description of mipmaps.
- //This function will also resize the texture map if it doesn't conform
- //to the opengl restriction of height and width values being a power of 2.
- gluBuild2DMipmaps(GL_TEXTURE_2D, colour_type, width, height,
- colour_type, GL_UNSIGNED_BYTE, raw_bitmap);
-
- //We don't need our texture in the temporary array anymore as it has been passed to opengl.
- //We use the standard C library call 'free' to return the allocated memory.
- free(raw_bitmap);
-}
-#endif
-
-
-#if 0
-static void drawXdot(xdot * xDot, int param, void *p)
-{
- int id;
- sdot_op *ops = (sdot_op *) (xDot->ops);
- sdot_op *op;
- //to avoid the overlapping , z is slightly increased for each xdot of a particular object
- if (AGTYPE(p) == AGEDGE)
- globalz = 1;
- else
- globalz = 0;
-
- for (id = 0; id < xDot->cnt; id++) {
- globalz += GLOBAL_Z_OFFSET;
- op = ops + id;
- op->obj = p;
- op->op.drawfunc(&(op->op), param);
- }
-}
-
-
-
-static void drawXdotwithattr(void *p, char *attr, int param)
-{
- xdot *xDot;
- if ((xDot = parseXDotF(agget(p, attr), OpFns, sizeof(sdot_op)))) {
- drawXdot(xDot, param, p);
- freeXDot(xDot);
- }
-}
-
-static void drawXdotwithattrs(void *e, int param)
-{
- drawXdotwithattr(e, "_draw_", param);
- drawXdotwithattr(e, "_ldraw_", param);
- drawXdotwithattr(e, "_hdraw_", param);
- drawXdotwithattr(e, "_tdraw_", param);
- drawXdotwithattr(e, "_hldraw_", param);
- drawXdotwithattr(e, "_tldraw_", param);
-}
-#endif
-
-
-
-/*
- this function is used to cache fonts in view->fontset
-*/
-
-#if UNUSED
-static void scanXdot(xdot * xDot, void *p)
-{
- int id;
- sdot_op *ops = (sdot_op *) (xDot->ops);
- sdot_op *op;
-
- for (id = 0; id < xDot->cnt; id++) {
- op = ops + id;
- op->obj = p;
- if (op->op.kind == xd_font) {
- add_font(view->fontset, op->op.u.font.name); //load or set active font
- }
- }
-}
-
-
-static void scanXdotwithattr(void *p, char *attr)
-{
- xdot *xDot;
- if ((xDot = parseXDotF(agget(p, attr), OpFns, sizeof(sdot_op)))) {
- scanXdot(xDot, p);
- freeXDot(xDot);
- }
-}
-
-static void scanXdotwithattrs(void *e)
-{
- scanXdotwithattr(e, "_draw_");
- scanXdotwithattr(e, "_ldraw_");
- scanXdotwithattr(e, "_hdraw_");
- scanXdotwithattr(e, "_tdraw_");
- scanXdotwithattr(e, "_hldraw_");
- scanXdotwithattr(e, "_tldraw_");
-}
-
-
-
-
-/*
- iterate in nodes and edges to cache fonts, run this once or whenever a new font is added to the graph
-*/
-
-
-void scanGraph(Agraph_t * g)
-{
- Agnode_t *v;
- Agedge_t *e;
- for (v = agfstnode(g); v; v = agnxtnode(g, v)) {
- scanXdotwithattr(v, "_draw_");
- scanXdotwithattr(v, "_ldraw_");
- for (e = agfstout(g, v); e; e = agnxtout(g, e)) {
- scanXdotwithattrs(e);
- }
- }
-
-}
-#endif
-
-
-
-#ifdef UNUSED
-char *create_us_map()
-{
- float x1, y1, x2, y2;
- float ox1, oy1, ox2, oy2;
- static const char filename[] = "file.txt";
- FILE *file = fopen(filename, "r");
- char line[128]; /* or other suitable maximum line size */
- int firstline = 1;
- while (fgets(line, sizeof line, file) != NULL) { /* read a line */
- fputs(line, stdout); /* write the line */
- sscanf(line, "%f %f %f %f", &x1, &y1, &x2, &y2);
-
- if (firstline) {
- ox1 = x1;
- oy1 = y1;
- ox2 = x2;
- oy2 = y2;
- firstline = 0;
- } else if ((x1 == ox1) && (y1 == oy1) && (x2 == ox2) && (y2 == oy2)) { /*polygon is closed here */
-
-
- }
-
-
- }
- fclose(file);
- return 0;
-}
-#endif
#include "topviewfuncs.h"
- static float prevX=0;
- static float prevY=0;
- static int lastAction;
+static float prevX=0;
+static float prevY=0;
+static int lastAction;
static void apply_actions(ViewInfo* v,int x,int y)
{
int a;
}
static void appmouse_drag(ViewInfo* v,int x,int y)
{
- static float x2,y2;
v->mouse.pos.x=x;
v->mouse.pos.y=y;
to3D( x,y, &v->mouse.GLpos.x,&v->mouse.GLpos.y,&v->mouse.GLpos.z);
- x2=v->mouse.GLpos.x;
- y2=v->mouse.GLpos.y;
- prevX=x2;
- prevY=y2;
+ prevX=v->mouse.GLpos.x;
+ prevY=v->mouse.GLpos.y;
apply_actions(v,x,y);
-
}
void appmouse_left_click_down(ViewInfo* v,int x,int y)
return guibuffer;
}
}
+#if UNUSED
void change_selected_graph_attributes(Agraph_t * g, char *attrname,
char *attrvalue)
{
char *attrvalue)
{
int ind = 0;
- agattr(g, AGNODE, attrname, "");
+ Agsym_t* ap = agattr(g, AGNODE, attrname, NULL);
+
+ if (!ap)
+ ap = agattr(g, AGNODE, attrname, "");
+
for (ind = 0; ind < view->Topview->Nodecount; ind++) {
if (view->Topview->Nodes[ind].data.Selected == 1)
- agset(view->Topview->Nodes[ind].Node, attrname, attrvalue);
+ agxset(view->Topview->Nodes[ind].Node, ap, attrvalue);
}
}
void change_selected_edge_attributes(Agraph_t * g, char *attrname,
char *attrvalue)
{
int ind = 0;
- agattr(g, AGEDGE, attrname, "");
+ Agsym_t* ap = agattr(g, AGEDGE, attrname, NULL);
+ if (!ap)
+ ap = agattr(g, AGEDGE, attrname, "");
+
for (ind = 0; ind < view->Topview->Edgecount; ind++) {
if (view->Topview->Edges[ind].data.Selected == 1)
- agset(view->Topview->Edges[ind].Edge, attrname, attrvalue);
-
+ agxset(view->Topview->Edges[ind].Edge, ap, attrvalue);
}
}
+#endif
void load_attributes(void)
{
sprintf(buf, "%f", value);
agattr(g, AGRAPH, attribute, buf);
- printf ("%s %f \n",attribute,value);
+ /* printf ("%s %f \n",attribute,value); */
return 1;
return 1;
}
+/* graphRecord:
+ * add graphRec to graph if necessary.
+ * update fields of graphRec.
+ * We assume the graph has attributes nodelabelattribute, edgelabelattribute,
+ * nodelabelcolor and edgelabelcolor from template.dot.
+ * We assume nodes have pos attributes.
+ */
+static void
+graphRecord (Agraph_t* g)
+{
+ agbindrec(g, "graphRec", sizeof(graphRec), 1);
+
+ GG_nodelabelcolor(g) = agattr (g, AGRAPH, "nodelabelcolor", 0);
+ GG_edgelabelcolor(g) = agattr (g, AGRAPH, "edgelabelcolor", 0);
+
+ GN_pos(g) = agattr (g, AGNODE, "pos", 0);
+ GN_size(g) = agattr (g, AGNODE, "size", 0);
+ GN_visible(g) = agattr (g, AGNODE, "visible", 0);
+ GN_selected(g) = agattr (g, AGNODE, "selected", 0);
+ GN_labelattribute(g) = agattr (g, AGNODE, agget(g,"nodelabelattribute"), 0);
+
+ GE_visible(g) = agattr (g, AGEDGE, "visible", 0);
+ GE_selected(g) = agattr (g, AGEDGE, "selected", 0);
+ GE_labelattribute(g) = agattr (g, AGEDGE, agget(g,"edgelabelattribute"), 0);
+}
+
int update_graph_from_settings(Agraph_t * g)
{
get_spinbtn_widget_to_attribute(sym->name, agget(view->systemGraphs.attrs_widgets,sym->name),g);
if(strncmp (sym->name,"scale_button",strlen("scale_button"))==0)
get_scalebtn_widget_to_attribute(sym->name, agget(view->systemGraphs.attrs_widgets,sym->name),g);
-
-
}
+ graphRecord(g);
return 1;
}
+/* $Id$Revision: */
+/* vim:set shiftwidth=4 ts=8: */
+
+/**********************************************************
+* This software is part of the graphviz package *
+* http://www.graphviz.org/ *
+* *
+* Copyright (c) 1994-2004 AT&T Corp. *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Corp. *
+* *
+* Information and Software Systems Research *
+* AT&T Research, Florham Park NJ *
+**********************************************************/
+
#include "polytess.h"
#include "xdot.h"
tessPoly TP;
return(1);
}
+
+#if UNUSED
static int Render_Contour(GLUtesselator *tobj, GLdouble obj_data[][3],int cnt)
{
/* int y=0; */
if (!d)
{
- d=(GLdouble**) malloc(sizeof(GLdouble)* cnt);
+ d = (GLdouble**) malloc(sizeof(GLdouble)* cnt);
for (x=0;x < cnt; x++)
{
/* GLdouble temp; */
return(1);
}
+#endif
static void select_node(Agraph_t* g,Agnode_t* obj,int reverse)
{
- static Agsym_t* sel_attr=(Agsym_t*)0;
+ Agsym_t* sel_attr = GN_selected(g);
+
if(!sel_attr)
- sel_attr=agattr(g, AGNODE,"selected","0");
+ sel_attr = GN_selected(g) = agattr(g, AGNODE,"selected","0");
if(!reverse)
{
agxset(obj,sel_attr,"1");
- ((nodeRec*)(aggetrec(obj,"nodeRec",0)))->selected=1;
+ ND_selected(obj) = 1;
}
else
{
- if(((nodeRec*)(aggetrec(obj,"nodeRec",0)))->selected==1)
+ if(ND_selected(obj)==1)
{
agxset(obj,sel_attr,"0");
- ((nodeRec*)(aggetrec(obj,"nodeRec",0)))->selected=0;
- ((nodeRec*)(aggetrec(obj,"nodeRec",0)))->printLabel=0;
-
-
+ ND_selected(obj) = 0;
+ ND_printLabel(obj) = 0;
}
else
{
agxset(obj,sel_attr,"1");
- ((nodeRec*)(aggetrec(obj,"nodeRec",0)))->selected=1;
-
+ ND_selected(obj) = 1;
}
}
}
static void select_edge(Agraph_t* g,Agedge_t* obj,int reverse)
{
- static Agsym_t* sel_attr=(Agsym_t*)0;
- if(!sel_attr)
- sel_attr=agattr(g, AGEDGE,"selected","0");
+ Agsym_t* sel_attr = GE_selected(g);
+
+ if (!sel_attr)
+ sel_attr = GE_selected(g) = agattr(g, AGEDGE,"selected","0");
if (!reverse)
{
agxset(obj,sel_attr,"1");
- ((edgeRec*)(aggetrec(obj,"edgeRec",0)))->selected=1;
+ ED_selected(obj) = 1;
}
else
{
- if(((edgeRec*)(aggetrec(obj,"edgeRec",0)))->selected==1)
+ if (ED_selected(obj) == 1)
{
agxset(obj,sel_attr,"0");
- ((edgeRec*)(aggetrec(obj,"edgeRec",0)))->selected=0;
- ((edgeRec*)(aggetrec(obj,"edgeRec",0)))->printLabel=0;
+ ED_selected(obj) = 0;
+ ED_printLabel(obj) = 0;
}
else
{
agxset(obj,sel_attr,"1");
- ((edgeRec*)(aggetrec(obj,"edgeRec",0)))->selected=1;
+ ED_selected(obj) = 1;
}
}
static void pick_objects_in_rect(Agraph_t* g,GLfloat x1,GLfloat y1,GLfloat x2,GLfloat y2)
{
- static Agnode_t *v;
- static Agedge_t *e;
- static glCompPoint posT;
- static glCompPoint posH;
- static glCompPoint posN;
+ Agnode_t *v;
+ Agedge_t *e;
+ glCompPoint posT;
+ glCompPoint posH;
+ glCompPoint posN;
- for (v = agfstnode(g); v; v = agnxtnode(g, v))
+ for (v = agfstnode(g); v; v = agnxtnode(g, v))
{
if(view->Topview->sel.selectNodes==1)
{
- posN=((nodeRec*)(aggetrec(v,"nodeRec",0)))->A;
- if(!((nodeRec*)(aggetrec(v,"nodeRec",0)))->visible)
+ posN = ND_A(v);
+ if(!ND_visible(v))
continue;
if(is_point_in_rectangle(posN.x,posN.y,x1,y1,x2-x1,y2-y1) )
select_node(g,v,0);
}
- if(view->Topview->sel.selectEdges==1)
- for (e = agfstout(g, v); e; e = agnxtout(g, e))
+ if(view->Topview->sel.selectEdges==1) {
+ for (e = agfstout(g, v); e; e = agnxtout(g, e))
{
- posT=((edgeRec*)(aggetrec(e,"edgeRec",0)))->posTail;
- posH=((edgeRec*)(aggetrec(e,"edgeRec",0)))->posHead;
+ posT = ED_posTail(e);
+ posH = ED_posHead(e);
if(is_point_in_rectangle(posT.x,posT.y,x1,y1,x2-x1,y2-y1))
if(is_point_in_rectangle(posH.x,posH.y,x1,y1,x2-x1,y2-y1))
select_edge(g,e,0);
}
+ }
}
}
static void* pick_object(Agraph_t* g,glCompPoint p)
{
- static Agsym_t* size_attr=(Agsym_t*)0;
- static Agsym_t* pos_attr=(Agsym_t*)0;
-
- static Agnode_t *v;
- static Agedge_t *e;
- static glCompPoint posT;
- static glCompPoint posH;
- static glCompPoint posN;
+ Agnode_t *v;
+ Agedge_t *e;
+ glCompPoint posT;
+ glCompPoint posH;
+ glCompPoint posN;
int defaultNodeShape;
- float dist=999999999;
- static GLfloat nd=0; /*node distance to point*/
- static GLfloat ed=0; /*edge distance to point*/
- static GLfloat nodeSize=0;
- void* rv=(void*)0;
- nd=0; /*node distance to point*/
- ed=0; /*edge distance to point*/
-
- defaultNodeShape=getAttrBool(g,g,"defaultnodeshape",0);
-
- if(!size_attr)
- size_attr=agattr(g, AGNODE,"size",0);
+ float dist=999999999;
+ GLfloat nd; /*node distance to point*/
+ GLfloat ed; /*edge distance to point*/
+ GLfloat nodeSize=0;
+ void* rv=(void*)0;
- if(!pos_attr)
- pos_attr=agattr(g, AGNODE,"pos",0);
+ defaultNodeShape=getAttrBool(g,g,"defaultnodeshape",0);
if(defaultNodeShape==0)
nodeSize=GetOGLDistance(view->nodeScale*view->Topview->fitin_zoom/view->zoom);
for (v = agfstnode(g); v; v = agnxtnode(g, v))
{
- if(!((nodeRec*)(aggetrec(v,"nodeRec",0)))->visible)
+ if(!ND_visible(v))
continue;
- posN=((nodeRec*)(aggetrec(v,"nodeRec",0)))->A;
+ posN = ND_A(v);
if(defaultNodeShape==1)
{
- nodeSize=((nodeRec*)(aggetrec(v,"nodeRec",0)))->size;
+ nodeSize = ND_size(v);
}
nd=distBetweenPts(posN,p,nodeSize);
for (e = agfstout(g, v); e; e = agnxtout(g, e))
{
- posT=((edgeRec*)(aggetrec(e,"edgeRec",0)))->posTail;
- posH=((edgeRec*)(aggetrec(e,"edgeRec",0)))->posHead;
+ posT = ED_posTail(e);
+ posH = ED_posHead(e);
ed=point_to_lineseg_dist(p, posT,posH);
if( ed < dist ) {rv=e;dist=ed;}
}
void pick_object_xyz(Agraph_t* g,topview* t,GLfloat x,GLfloat y,GLfloat z)
{
- static glCompPoint p;
+ glCompPoint p;
void* a;
p.x=x;p.y=y;p.z=z;
a=pick_object(g,p);
return;
if(agobjkind(a)==AGNODE)
{
-
select_node(g,a,1);
- ((nodeRec*)(aggetrec(a,"nodeRec",0)))->printLabel=1;
+ ND_printLabel((Agnode_t*)a) = 1;
cacheSelectedNodes(g,t);
{
select_edge(g,a,1);
cacheSelectedEdges(g,t);
- ((edgeRec*)(aggetrec(a,"edgeRec",0)))->printLabel=1;
+ ED_printLabel((Agedge_t*)a) = 1;
}
}
void pick_objects_rect(Agraph_t* g)
{
- static GLfloat x1;
- static GLfloat y1;
- static GLfloat x2;
- static GLfloat y2;
+ GLfloat x1;
+ GLfloat y1;
+ GLfloat x2;
+ GLfloat y2;
if(view->mouse.GLfinalPos.x > view->mouse.GLinitPos.x)
{
x1=view->mouse.GLinitPos.x;
void deselect_all(Agraph_t* g)
{
- static Agnode_t *v;
- static Agedge_t *e;
- static Agsym_t* nsel_attr=(Agsym_t*)0;
- static Agsym_t* esel_attr=(Agsym_t*)0;
+ Agnode_t *v;
+ Agedge_t *e;
+ Agsym_t* nsel_attr = GN_selected(g);
+ Agsym_t* esel_attr = GE_selected(g);
if(!nsel_attr)
- nsel_attr=agattr(g, AGNODE,"selected","0");
+ nsel_attr = GN_selected(g) = agattr(g, AGNODE,"selected","0");
if(!esel_attr)
- esel_attr=agattr(g, AGEDGE,"selected","0");
+ esel_attr = GE_selected(g) = agattr(g, AGEDGE,"selected","0");
for (v = agfstnode(g); v; v = agnxtnode(g, v))
{
agxset(v,nsel_attr,"0");
- ((nodeRec*)(aggetrec(v,"nodeRec",0)))->selected=0;
- ((edgeRec*)(aggetrec(v,"nodeRec",0)))->printLabel=0;
+ ND_selected(v) = 0;
+ ND_printLabel(v) = 0;
for (e = agfstout(g, v); e; e = agnxtout(g, e))
{
agxset(e,esel_attr,"0");
- ((edgeRec*)(aggetrec(e,"edgeRec",0)))->selected=0;
- ((edgeRec*)(aggetrec(e,"edgeRec",0)))->printLabel=0;
+ ED_selected(e) = 0;
+ ED_printLabel(e) = 0;
}
}
cacheSelectedNodes(g,view->Topview);
cacheSelectedEdges(g,view->Topview);
-
}
+
void clear_selpoly(glCompPoly* sp)
{
sp->pts=realloc(sp->pts,0);
static void select_polygon (Agraph_t* g,glCompPoly* selPoly)
{
- static Agnode_t *v;
- static glCompPoint posN;
+ Agnode_t *v;
+ glCompPoint posN;
- for (v = agfstnode(g); v; v = agnxtnode(g, v))
+ for (v = agfstnode(g); v; v = agnxtnode(g, v))
{
- posN=((nodeRec*)(aggetrec(v,"nodeRec",0)))->A;
+ posN = ND_A(v);
if(point_in_polygon(selPoly,posN))
select_node(g,v,0);
}
* AT&T Research, Florham Park NJ *
**********************************************************/
#include "smyrna_utils.h"
-static int mapbool(char *p)
+int mapbool(char *p)
{
if (p == NULL)
return FALSE;
attr = agattr(g, AGTYPE(obj), attr_name,0);
return late_bool(obj, attr,def);
}
-/* Differs from getAttrBool in that a value of "" returns def */
-int getAttrBool1(Agraph_t* g,void* obj,char* attr_name,int def)
-{
- Agsym_t* attr;
- char* s;
- if ((attr = agattr(g, AGTYPE(obj), attr_name,0))) {
- s = agxget (obj, attr);
- if (*s) return mapbool(s);
- else return def;
- }
- else return def;
-}
int getAttrInt(Agraph_t* g,void* obj,char* attr_name,int def)
{
Agsym_t* attr;
glCompPoint p;
char* a;
- static char bf[512];
+ char bf[512];
strcpy(bf,str);
p.x=0;
p.y=0;
extern int l_int(void *obj, Agsym_t * attr, int def);
extern float l_float(void *obj, Agsym_t * attr, float def);
+extern int mapbool(char *p);
extern int getAttrBool(Agraph_t* g,void* obj,char* attr_name,int def);
-extern int getAttrBool1(Agraph_t* g,void* obj,char* attr_name,int def);
extern int getAttrInt(Agraph_t* g,void* obj,char* attr_name,int def);
extern float getAttrFloat(Agraph_t* g,void* obj,char* attr_name,float def);
extern char* getAttrStr(Agraph_t* g,void* obj,char* attr_name,char* def);
int printLabel;
int TVref;
}nodeRec;
+#define NREC(n) ((nodeRec*)(aggetrec(n,"nodeRec",0)))
+#define ND_visible(n) (NREC(n)->visible)
+#define ND_selected(n) (NREC(n)->selected)
+#define ND_printLabel(n) (NREC(n)->printLabel)
+#define ND_A(n) (NREC(n)->A)
+#define ND_size(n) (NREC(n)->size)
+#define ND_TVref(n) (NREC(n)->TVref)
+
typedef struct{
Agrec_t h;
glCompPoint posTail;
int visible;
int printLabel;
}edgeRec;
+#define EREC(e) ((edgeRec*)(aggetrec(e,"edgeRec",0)))
+#define ED_visible(e) (EREC(e)->visible)
+#define ED_selected(e) (EREC(e)->selected)
+#define ED_printLabel(e) (EREC(e)->printLabel)
+#define ED_posTail(e) (EREC(e)->posTail)
+#define ED_posHead(e) (EREC(e)->posHead)
+
+ typedef struct{
+ Agrec_t h;
+ Agsym_t* N_pos;
+ Agsym_t* N_size;
+ Agsym_t* N_visible;
+ Agsym_t* N_selected;
+ Agsym_t* G_nodelabelcolor;
+ Agsym_t* N_labelattribute;
+ Agsym_t* E_visible;
+ Agsym_t* E_selected;
+ Agsym_t* G_edgelabelcolor;
+ Agsym_t* E_labelattribute;
+ } graphRec;
+#define GREC(g) ((graphRec*)(AGDATA(g)))
+#define GN_pos(g) (GREC(g)->N_pos)
+#define GN_size(g) (GREC(g)->N_size)
+#define GN_visible(g) (GREC(g)->N_visible)
+#define GN_selected(g) (GREC(g)->N_selected)
+#define GG_nodelabelcolor(g) (GREC(g)->G_nodelabelcolor)
+#define GN_labelattribute(g) (GREC(g)->N_labelattribute)
+#define GE_visible(g) (GREC(g)->E_visible)
+#define GE_selected(g) (GREC(g)->E_selected)
+#define GG_edgelabelcolor(g) (GREC(g)->G_edgelabelcolor)
+#define GE_labelattribute(g) (GREC(g)->E_labelattribute)
typedef struct _selection {
glCompPoly selPoly;
+++ /dev/null
-/* $Id$Revision: */
-/* vim:set shiftwidth=4 ts=8: */
-
-/**********************************************************
-* This software is part of the graphviz package *
-* http://www.graphviz.org/ *
-* *
-* Copyright (c) 1994-2004 AT&T Corp. *
-* and is licensed under the *
-* Common Public License, Version 1.0 *
-* by AT&T Corp. *
-* *
-* Information and Software Systems Research *
-* AT&T Research, Florham Park NJ *
-**********************************************************/
-
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-#include <gtk/gtkgl.h>
-/*** Use OpenGL extensions. ***/
-/* #include <gdk/gdkglglext.h> */
-
-#ifdef G_OS_WIN32
-#define WIN32_LEAN_AND_MEAN 1
-#include <windows.h>
-#endif
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-
-
-/**************************************************************************
- * The following section contains all the macro definitions.
- **************************************************************************/
-
-/***
- *** Change these three macros to customise the
- *** default width and height of the drawing
- *** area, plus the default title of the window.
- ***/
-#define DEFAULT_WIDTH 200
-#define DEFAULT_HEIGHT 200
-#define TIMEOUT_INTERVAL 10
-
-
-/**************************************************************************
- * Global variable declarations.
- **************************************************************************/
-
-
-
-/**************************************************************************
- * The following section contains the function prototype declarations.
- **************************************************************************/
-
-#ifdef UNUSED
-static void timeout_add(GtkWidget * widget);
-static void timeout_remove(GtkWidget * widget);
-
-static void toggle_animation(GtkWidget * widget);
-
-static GdkGLConfig *configure_gl(void);
-
-static GtkWidget *create_popup_menu(GtkWidget * drawing_area);
-static GtkWidget *create_window(GdkGLConfig * glconfig);
-#endif
-
-
-/**************************************************************************
- * The following section contains all the callback function definitions.
- **************************************************************************/
-
-/***
- *** The "realize" signal handler. All the OpenGL initialization
- *** should be performed here, such as default background colour,
- *** certain states etc.
- ***/
-#ifdef UNUSED
-static void realize(GtkWidget * widget, gpointer data)
-{
- GdkGLContext *glcontext = gtk_widget_get_gl_context(widget);
- GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable(widget);
-
- g_print("%s: \"realize\"\n", gtk_widget_get_name(widget));
-
- /*** OpenGL BEGIN ***/
- if (!gdk_gl_drawable_gl_begin(gldrawable, glcontext))
- return;
-
- /*** Fill in the details here. ***/
-
- gdk_gl_drawable_gl_end(gldrawable);
- /*** OpenGL END ***/
-}
-#endif
-
-#ifdef UNUSED
-/***
- *** The "configure_event" signal handler. Any processing required when
- *** the OpenGL-capable drawing area is re-configured should be done here.
- *** Almost always it will be used to resize the OpenGL viewport when
- *** the window is resized.
- ***/
-static gboolean
-configure_event(GtkWidget * widget,
- GdkEventConfigure * event, gpointer data)
-{
- GdkGLContext *glcontext = gtk_widget_get_gl_context(widget);
- GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable(widget);
-
- GLfloat w = widget->allocation.width;
- GLfloat h = widget->allocation.height;
-
- g_print("%s: \"configure_event\"\n", gtk_widget_get_name(widget));
-
- /*** OpenGL BEGIN ***/
- if (!gdk_gl_drawable_gl_begin(gldrawable, glcontext))
- return FALSE;
-
- /*** Fill in the details here. ***/
-
- glViewport(0, 0, w, h);
-
- gdk_gl_drawable_gl_end(gldrawable);
- /*** OpenGL END ***/
-
- return TRUE;
-}
-
-/***
- *** The "expose_event" signal handler. All the OpenGL re-drawing should
- *** be done here. This is repeatedly called as the painting routine
- *** every time the 'expose'/'draw' event is signalled.
- ***/
-static gboolean
-expose_event(GtkWidget * widget, GdkEventExpose * event, gpointer data)
-{
- GdkGLContext *glcontext = gtk_widget_get_gl_context(widget);
- GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable(widget);
-
- g_print("%s: \"expose_event\"\n", gtk_widget_get_name(widget));
-
- /*** OpenGL BEGIN ***/
- if (!gdk_gl_drawable_gl_begin(gldrawable, glcontext))
- return FALSE;
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- /*** Fill in the details here. ***/
-
- /* Swap buffers */
- if (gdk_gl_drawable_is_double_buffered(gldrawable))
- gdk_gl_drawable_swap_buffers(gldrawable);
- else
- glFlush();
-
- gdk_gl_drawable_gl_end(gldrawable);
- /*** OpenGL END ***/
-
- return TRUE;
-}
-
-/***
- *** The timeout function. Often in animations,
- *** timeout functions are suitable for continous
- *** frame updates.
- ***/
-static gboolean timeout(GtkWidget * widget)
-{
- g_print(".");
-
- /*** Fill in the details here ***/
-
- /* Invalidate the whole window. */
- gdk_window_invalidate_rect(widget->window, &widget->allocation, FALSE);
-
- /* Update synchronously. */
- gdk_window_process_updates(widget->window, FALSE);
-
- return TRUE;
-}
-
-/***
- *** The "unrealize" signal handler. Any processing required when
- *** the OpenGL-capable window is unrealized should be done here.
- ***/
-static void unrealize(GtkWidget * widget, gpointer data)
-{
- GdkGLContext *glcontext = gtk_widget_get_gl_context(widget);
- GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable(widget);
-
- g_print("%s: \"unrealize\"\n", gtk_widget_get_name(widget));
-
- /*** OpenGL BEGIN ***/
- if (!gdk_gl_drawable_gl_begin(gldrawable, glcontext))
- return;
-
- /*** Fill in the details here. ***/
-
- gdk_gl_drawable_gl_end(gldrawable);
- /*** OpenGL END ***/
-}
-
-/***
- *** The "motion_notify_event" signal handler. Any processing required when
- *** the OpenGL-capable drawing area is under drag motion should be done here.
- ***/
-static gboolean
-motion_notify_event(GtkWidget * widget,
- GdkEventMotion * event, gpointer data)
-{
- g_print("%s: \"motion_notify_event\": button",
- gtk_widget_get_name(widget));
-
- /*** Fill in the details here. ***/
-
- if (event->state & GDK_BUTTON1_MASK) {
- g_print(" 1");
- }
-
- if (event->state & GDK_BUTTON2_MASK) {
- g_print(" 2");
- }
-
- if (event->state & GDK_BUTTON3_MASK) {
- g_print(" 3");
- }
-
- g_print("\n");
-
- return FALSE;
-}
-
-/***
- *** The "button_press_event" signal handler. Any processing required when
- *** mouse buttons (only left and middle buttons) are pressed on the OpenGL-
- *** capable drawing area should be done here.
- ***/
-static gboolean
-button_press_event(GtkWidget * widget,
- GdkEventButton * event, gpointer data)
-{
- g_print("%s: \"button_press_event\": ", gtk_widget_get_name(widget));
-
- if (event->button == 1) {
- /*** Fill in the details here. ***/
- g_print("button 1\n");
-
- return TRUE;
- }
-
- if (event->button == 2) {
- /*** Fill in the details here. ***/
- g_print("button 2\n");
-
- return TRUE;
- }
-
- g_print("\n");
-
- return FALSE;
-}
-
-/* For popup menu. */
-static gboolean
-button_press_event_popup_menu(GtkWidget * widget,
- GdkEventButton * event, gpointer data)
-{
- g_print("%s: \"button_press_event_popup\": ",
- gtk_widget_get_name(widget));
-
- if (event->button == 3) {
- g_print("button 3\n");
-
- /* Popup menu. */
- gtk_menu_popup(GTK_MENU(widget), NULL, NULL, NULL, NULL,
- event->button, event->time);
- return TRUE;
- }
-
- g_print("\n");
-
- return FALSE;
-}
-
-/***
- *** The "key_press_event" signal handler. Any processing required when key
- *** presses occur should be done here.
- ***/
-static gboolean
-key_press_event(GtkWidget * widget, GdkEventKey * event, gpointer data)
-{
- g_print("%s: \"key_press_event\": ", gtk_widget_get_name(widget));
-
- switch (event->keyval) {
- /*** Fill in the details here. ***/
-
- case GDK_a:
- g_print("a key\n");
-// toggle_animation (widget);
- break;
-
- case GDK_Escape:
- g_print("Escape key\n");
- gtk_main_quit();
- break;
-
- default:
- g_print("\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/**************************************************************************
- * The following section contains the timeout function management routines.
- **************************************************************************/
-
-/***
- *** Helper functions to add or remove the timeout function.
- ***/
-
-static guint timeout_id = 0;
-
-static void timeout_add(GtkWidget * widget)
-{
- if (timeout_id == 0) {
- timeout_id = g_timeout_add(TIMEOUT_INTERVAL,
- (GSourceFunc) timeout, widget);
- }
-}
-
-static void timeout_remove(GtkWidget * widget)
-{
- if (timeout_id != 0) {
- g_source_remove(timeout_id);
- timeout_id = 0;
- }
-}
-
-/***
- *** The "map_event" signal handler. Any processing required when the
- *** OpenGL-capable drawing area is mapped should be done here.
- ***/
-static gboolean
-map_event(GtkWidget * widget, GdkEvent * event, gpointer data)
-{
- g_print("%s: \"map_event\":\n", gtk_widget_get_name(widget));
- return TRUE;
-}
-
-/***
- *** The "unmap_event" signal handler. Any processing required when the
- *** OpenGL-capable drawing area is unmapped should be done here.
- ***/
-static gboolean
-unmap_event(GtkWidget * widget, GdkEvent * event, gpointer data)
-{
- g_print("%s: \"unmap_event\":\n", gtk_widget_get_name(widget));
- timeout_remove(widget);
-
- return TRUE;
-}
-
-/***
- *** The "visibility_notify_event" signal handler. Any processing required
- *** when the OpenGL-capable drawing area is visually obscured should be
- *** done here.
- ***/
-static gboolean
-visibility_notify_event(GtkWidget * widget,
- GdkEventVisibility * event, gpointer data)
-{
-
- return TRUE;
-}
-#endif
-
-
-
-/**************************************************************************
- * The following section contains the GUI building function definitions.
- **************************************************************************/
-
-/***
- *** Creates the popup menu to be displayed.
- ***/
-#ifdef UNUSED
-static GtkWidget *create_popup_menu(GtkWidget * drawing_area)
-{
- GtkWidget *menu;
- GtkWidget *menu_item;
-
- menu = gtk_menu_new();
-
- /* Toggle animation */
- menu_item = gtk_menu_item_new_with_label("Toggle Animation");
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
-// g_signal_connect_swapped (G_OBJECT (menu_item), "activate",
-// G_CALLBACK (toggle_animation), drawing_area);
- gtk_widget_show(menu_item);
-
- /* Quit */
- menu_item = gtk_menu_item_new_with_label("Quit");
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
- g_signal_connect(G_OBJECT(menu_item), "activate",
- G_CALLBACK(gtk_main_quit), NULL);
- gtk_widget_show(menu_item);
-
- return menu;
-}
-#endif
-
-/***
- *** Creates the simple application window with one
- *** drawing area that has an OpenGL-capable visual.
- ***/
-#ifdef UNUSED
-static GtkWidget *create_window(GdkGLConfig * glconfig)
-{
- GtkWidget *window;
- GtkWidget *vbox;
- GtkWidget *drawing_area;
- GtkWidget *menu;
- GtkWidget *button;
-
- /*
- * Top-level window.
- */
-
-// window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-// gtk_window_set_title (GTK_WINDOW (window), DEFAULT_TITLE);
-
- /* Get automatically redrawn if any of their children changed allocation. */
- gtk_container_set_reallocate_redraws(GTK_CONTAINER(window), TRUE);
-
- /* Connect signal handlers to the window */
- g_signal_connect(G_OBJECT(window), "delete_event",
- G_CALLBACK(gtk_main_quit), NULL);
-
- /*
- * VBox.
- */
-
- vbox = gtk_vbox_new(FALSE, 0);
- gtk_container_add(GTK_CONTAINER(window), vbox);
- gtk_widget_show(vbox);
-
- /*
- * Drawing area to draw OpenGL scene.
- */
-
- drawing_area = gtk_drawing_area_new();
- gtk_widget_set_size_request(drawing_area, DEFAULT_WIDTH,
- DEFAULT_HEIGHT);
-
- /* Set OpenGL-capability to the widget */
- gtk_widget_set_gl_capability(drawing_area,
- glconfig, NULL, TRUE, GDK_GL_RGBA_TYPE);
-
- gtk_widget_add_events(drawing_area,
- GDK_BUTTON1_MOTION_MASK |
- GDK_BUTTON2_MOTION_MASK |
- GDK_BUTTON_PRESS_MASK |
- GDK_VISIBILITY_NOTIFY_MASK);
-
- /* Connect signal handlers to the drawing area */
- g_signal_connect_after(G_OBJECT(drawing_area), "realize",
- G_CALLBACK(realize), NULL);
- g_signal_connect(G_OBJECT(drawing_area), "configure_event",
- G_CALLBACK(configure_event), NULL);
- g_signal_connect(G_OBJECT(drawing_area), "expose_event",
- G_CALLBACK(expose_event), NULL);
- g_signal_connect(G_OBJECT(drawing_area), "unrealize",
- G_CALLBACK(unrealize), NULL);
-
- g_signal_connect(G_OBJECT(drawing_area), "motion_notify_event",
- G_CALLBACK(motion_notify_event), NULL);
- g_signal_connect(G_OBJECT(drawing_area), "button_press_event",
- G_CALLBACK(button_press_event), NULL);
-
- /* key_press_event handler for top-level window */
- g_signal_connect_swapped(G_OBJECT(window), "key_press_event",
- G_CALLBACK(key_press_event), drawing_area);
-
- /* For timeout function. */
- g_signal_connect(G_OBJECT(drawing_area), "map_event",
- G_CALLBACK(map_event), NULL);
- g_signal_connect(G_OBJECT(drawing_area), "unmap_event",
- G_CALLBACK(unmap_event), NULL);
- g_signal_connect(G_OBJECT(drawing_area), "visibility_notify_event",
- G_CALLBACK(visibility_notify_event), NULL);
-
- gtk_box_pack_start(GTK_BOX(vbox), drawing_area, TRUE, TRUE, 0);
-
- gtk_widget_show(drawing_area);
-
- /*
- * Popup menu.
- */
-
- menu = create_popup_menu(drawing_area);
-
- g_signal_connect_swapped(G_OBJECT(drawing_area), "button_press_event",
- G_CALLBACK(button_press_event_popup_menu),
- menu);
-
- /*
- * Simple quit button.
- */
-
- button = gtk_button_new_with_label("Quit");
-
- g_signal_connect(G_OBJECT(button), "clicked",
- G_CALLBACK(gtk_main_quit), NULL);
-
- gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
-
- gtk_widget_show(button);
-
- return window;
-}
-#endif
-
-
-/**************************************************************************
- * The following section contains utility function definitions.
- **************************************************************************/
-
-/***
- *** Configure the OpenGL framebuffer.
- ***/
-#ifdef UNUSED
-static GdkGLConfig *configure_gl(void)
-{
- GdkGLConfig *glconfig;
-
- /* Try double-buffered visual */
- glconfig = gdk_gl_config_new_by_mode(GDK_GL_MODE_RGB |
- GDK_GL_MODE_DEPTH |
- GDK_GL_MODE_DOUBLE);
- if (glconfig == NULL) {
- g_print("\n*** Cannot find the double-buffered visual.\n");
- g_print("\n*** Trying single-buffered visual.\n");
-
- /* Try single-buffered visual */
- glconfig = gdk_gl_config_new_by_mode(GDK_GL_MODE_RGB |
- GDK_GL_MODE_DEPTH);
- if (glconfig == NULL) {
- g_print("*** No appropriate OpenGL-capable visual found.\n");
- exit(1);
- }
- }
-
- return glconfig;
-}
-#endif
ne++;
i_nedges++;
// *edges++ = ((temp_node_record *) AGDATA(vp))->TVref;
- *edges++ =((nodeRec*)(aggetrec(vp,"nodeRec",0)))->TVref;
+ *edges++ = ND_TVref(vp);
*ewgts++ = 1;
}
i=0;
for (np = agfstnode(g); np; np = agnxtnode(g, np))
{
- x_coords[i]=((nodeRec*)(aggetrec(np,"nodeRec",0)))->A.x;
- y_coords[i]=((nodeRec*)(aggetrec(np,"nodeRec",0)))->A.y;
+ x_coords[i]=ND_A(np).x;
+ y_coords[i]=ND_A(np).y;
i++;
}
hp = t->fisheyeParams.h =
#include "glutils.h"
#include "selectionfuncs.h"
-#define WITH_CGRAPH 1
-static xdot *parseXdotwithattrs(void *e);
-static Agsym_t* pos_attr=(Agsym_t*)0;
-
-
+static xdot *parseXdotwithattrs(void *e)
+{
+
+ int cnt=0;
+ xdot* xDot=NULL;
+ xDot=parseXDotFOn (agget(e,"_draw_" ), OpFns,sizeof(sdot_op), xDot);
+ xDot=parseXDotFOn (agget(e,"_ldraw_" ), OpFns,sizeof(sdot_op), xDot);
+ xDot=parseXDotFOn (agget(e,"_hdraw_" ), OpFns,sizeof(sdot_op), xDot);
+ xDot=parseXDotFOn (agget(e,"_tdraw_" ), OpFns,sizeof(sdot_op), xDot);
+ xDot=parseXDotFOn (agget(e,"_hldraw_" ), OpFns,sizeof(sdot_op), xDot);
+ xDot=parseXDotFOn (agget(e,"_tldraw_" ), OpFns,sizeof(sdot_op), xDot);
+ if(xDot)
+ {
+ for (cnt=0;cnt < xDot->cnt ; cnt++)
+ {
+ ((sdot_op*)(xDot->ops))[cnt].obj=e;
+ }
+ }
+ return xDot;
+}
static void set_boundaries(Agraph_t * g, topview * t)
{
Agnode_t *v;
- static glCompPoint pos;
+ Agsym_t* pos_attr = GN_pos(g);
+ glCompPoint pos;
float left, right, top, bottom;
int id=0;
- if(!pos_attr)
- pos_attr=agattr(g, AGNODE,"pos",0);
+
for (v = agfstnode(g); v; v = agnxtnode(g, v))
{
pos=getPointFromStr(agxget(v, pos_attr));
view->bdzTop = 0;
view->bdzBottom = 0;
-
-
-
}
+#if UNUSED
static float init_node_size(Agraph_t * g, topview * t)
{
float vsize;
return sz;
}
-
+#endif
static void draw_xdot(xdot* x,float base_z)
}
static void glCompColorxlate(glCompColor* c,char* str)
{
- static gvcolor_t cl;
+ gvcolor_t cl;
colorxlate(str, &cl, RGBA_DOUBLE);
c->R=cl.u.RGBA[0];
c->G=cl.u.RGBA[1];
c->A=cl.u.RGBA[3];
}
+/* If the "visible" attribute is not set or "", return true
+ * else evaluate as boolean
+ */
+int visible(Agsym_t* attr, void* obj)
+{
+ char* s;
+
+ if (attr) {
+ s = agxget (obj, attr);
+ if (*s) return mapbool(s);
+ else return 1;
+ }
+ else return 1;
+}
int object_color(void* obj,glCompColor* c)
{
- static gvcolor_t cl;
+ gvcolor_t cl;
Agraph_t* g=view->g[view->activeGraph];
+ Agraph_t* objg=agraphof(obj);
int return_value = 1;
int objType;
float Alpha = 1;
char* bf;
+ Agsym_t* vis;
objType=AGTYPE(obj);
- if(objType==AGEDGE)
- Alpha=getAttrFloat(g,agraphof(obj),"defaultedgealpha",1);
- if(objType==AGNODE)
- Alpha=getAttrFloat(g,agraphof(obj),"defaultnodealpha",1);
- if(!getAttrBool1(g,obj,"visible",1))
+ if(objType==AGEDGE) {
+ Alpha=getAttrFloat(g,objg,"defaultedgealpha",1);
+ vis = GE_visible (objg);
+ }
+ if(objType==AGNODE) {
+ Alpha=getAttrFloat(g,objg,"defaultnodealpha",1);
+ vis = GN_visible (objg);
+ }
+ if (!visible(vis,obj))
return 0;
+
/*get edge's color attribute */
setColorScheme (agget (obj, "colorscheme"));
bf=getAttrStr(g,obj,"color",NULL);
void renderSelectedNodes(Agraph_t * g)
{
Agnode_t *v;
- static xdot * x;
- static glCompPoint pos;
-
-
- static Agsym_t* l_color_attr=(Agsym_t*)0;
- static glCompColor c;
-
-
-
-
+ xdot * x;
+ glCompPoint pos;
+ Agsym_t* l_color_attr = GG_nodelabelcolor(g);
+ glCompColor c;
+ int defaultNodeShape;
+ GLfloat nodeSize;
- static int defaultNodeShape=0;
- static GLfloat nodeSize=0;
- if(!l_color_attr)
- l_color_attr=agattr(g, AGRAPH,"nodelabelcolor",0);
glCompColorxlate(&c,agxget(g,l_color_attr));
-
defaultNodeShape=getAttrBool(g,g,"defaultnodeshape",0);
if(defaultNodeShape==0)
glBegin(GL_POINTS);
for (v = agfstnode(g); v; v = agnxtnode(g, v))
{
- if(!((nodeRec*)(aggetrec(v,"nodeRec",0)))->selected);
+ if(!ND_selected(v));
continue;
x=parseXdotwithattrs(v);
draw_xdot(x,-1);
freeXDot (x);
}
-
for (v = agfstnode(g); v; v = agnxtnode(g, v))
{
- if(!((nodeRec*)(aggetrec(v,"nodeRec",0)))->selected)
+ if(!ND_selected(v))
continue;
glColor4f(view->selectedNodeColor.R, view->selectedNodeColor.G,view->selectedNodeColor.B, view->selectedNodeColor.A);
- pos=((nodeRec*)(aggetrec(v,"nodeRec",0)))->A;
- nodeSize=((nodeRec*)(aggetrec(v,"nodeRec",0)))->size;
+ pos = ND_A(v);
+ nodeSize = ND_size(v);
if (defaultNodeShape == 0)
glVertex3f(pos.x,pos.y,pos.z+0.001);
else if (defaultNodeShape == 1)
drawCircle(pos.x,pos.y,nodeSize,pos.z+0.001);
- if(((nodeRec*)(aggetrec(v,"nodeRec",0)))->printLabel==1)
+ if (ND_printLabel(v)==1)
{
glColor4f(c.R, c.G,c.B, c.A);
glprintfglut(view->glutfont,pos.x+nodeSize,pos.y+nodeSize,pos.z,agnameof(v));
void renderNodes(Agraph_t * g)
{
Agnode_t *v;
- static glCompPoint pos;
- static Agsym_t* size_attr=(Agsym_t*)0;
- static Agsym_t* selected_attr=(Agsym_t*)0;
- static int defaultNodeShape=0;
- static GLfloat nodeSize=0;
- static glCompColor c;
+ glCompPoint pos;
+ Agsym_t* pos_attr = GN_pos(g);
+ Agsym_t* size_attr = GN_size(g);
+ Agsym_t* selected_attr = GN_selected(g);
+ int defaultNodeShape;
+ GLfloat nodeSize;
+ glCompColor c;
xdot * x;
int ind;
-
defaultNodeShape=getAttrBool(g,g,"defaultnodeshape",0);
- if(!pos_attr)
- pos_attr=agattr(g, AGNODE,"pos",0);
- if(!size_attr)
- size_attr=agattr(g, AGNODE,"size",0);
- if(!selected_attr)
- selected_attr=agattr(g, AGNODE,"selected",0);
-
for (v = agfstnode(g); v; v = agnxtnode(g, v))
{
x=parseXdotwithattrs(v);
draw_xdot(x,-0.1);
-
if(x)
freeXDot (x);
}
-
-
if(defaultNodeShape==0)
glBegin(GL_POINTS);
-
-
-
-
-
ind=0;
for (v = agfstnode(g); v; v = agnxtnode(g, v))
{
- ((nodeRec*)(aggetrec(v,"nodeRec",0)))->TVref=ind;
+ ND_TVref(v) = ind;
if(!object_color(v,&c))
{
- ((nodeRec*)(aggetrec(v,"nodeRec",0)))->visible=0;
+ ND_visible(v) = 0;
continue;
}
else
- ((nodeRec*)(aggetrec(v,"nodeRec",0)))->visible=1;
-
+ ND_visible(v) = 1;
if(l_int(v, selected_attr,0))
{
- ((nodeRec*)(aggetrec(v,"nodeRec",0)))->selected=1;
+ ND_selected(v) = 1;
}
glColor4f(c.R,c.G,c.B,c.A);
pos=getPointFromStr(agxget(v, pos_attr));
nodeSize=(GLfloat)l_float(v, size_attr,0);
- ((nodeRec*)(aggetrec(v,"nodeRec",0)))->A=pos;
+ ND_A(v) = pos;
if (nodeSize > 0)
nodeSize=nodeSize*view->nodeScale;
nodeSize=view->nodeScale;
if(defaultNodeShape==0)
nodeSize=1;
- ((nodeRec*)(aggetrec(v,"nodeRec",0)))->size=nodeSize;
+ ND_size(v) = nodeSize;
if (defaultNodeShape == 0)
glVertex3f(pos.x,pos.y,pos.z);
else if (defaultNodeShape == 1)
Agedge_t *e;
Agnode_t *v;
- static xdot * x;
- static glCompPoint posT; /*Tail position*/
- static glCompPoint posH; /*Head position*/
- static glCompColor c;
+ xdot * x;
+ glCompPoint posT; /*Tail position*/
+ glCompPoint posH; /*Head position*/
+ glCompColor c;
/*xdots tend to be drawn as background shapes,that is why they are being rendered before edges*/
for (v = agfstnode(g); v; v = agnxtnode(g, v))
{
for (e = agfstout(g, v); e; e = agnxtout(g, e))
{
- if(!((edgeRec*)(aggetrec(e,"edgeRec",0)))->selected)
+ if(!ED_selected(e))
continue;
if(!object_color(e,&c))
continue;
{
for (e = agfstout(g, v); e; e = agnxtout(g, e))
{
- if(!((edgeRec*)(aggetrec(e,"edgeRec",0)))->selected)
+ if(!ED_selected(e))
continue;
if(!object_color(e,&c))
continue;
glColor4f(1,0,0,1);
- posT=((edgeRec*)(aggetrec(e,"edgeRec",0)))->posTail;
- posH=((edgeRec*)(aggetrec(e,"edgeRec",0)))->posHead;
+ posT = ED_posTail(e);
+ posH = ED_posHead(e);
posT.z +=0.01;
posH.z +=0.01;
draw_edge(&posT,&posH,getEdgeLength(e),0);
void renderEdges(Agraph_t * g)
{
-
Agedge_t *e;
Agnode_t *v;
- static xdot * x;
- static glCompPoint posT; /*Tail position*/
- static glCompPoint posH; /*Head position*/
- static glCompColor c;
- if(!pos_attr)
- pos_attr=agattr(g, AGNODE,"pos",0);
+ Agsym_t* pos_attr = GN_pos(g);
+ xdot * x;
+ glCompPoint posT; /*Tail position*/
+ glCompPoint posH; /*Head position*/
+ glCompColor c;
/*xdots tend to be drawn as background shapes,that is why they are being rendered before edges*/
for (v = agfstnode(g); v; v = agnxtnode(g, v))
{
for (e = agfstout(g, v); e; e = agnxtout(g, e))
{
- if(
- (((nodeRec*)(aggetrec(agtail(e),"nodeRec",0)))->visible==0)
- ||
- (((nodeRec*)(aggetrec(aghead(e),"nodeRec",0)))->visible==0))
+ if ((ND_visible(agtail(e))==0) || (ND_visible(aghead(e))==0))
continue;
if(!object_color(e,&c))
{
- ((edgeRec*)(aggetrec(e,"edgeRec",0)))->visible=0;
+ ED_visible(e) = 0;
continue;
}
else
- ((edgeRec*)(aggetrec(e,"edgeRec",0)))->visible=1;
+ ED_visible(e) = 1;
x=parseXdotwithattrs(e);
draw_xdot(x,0);
}
}
-
-
-
glBegin(GL_LINES);
for (v = agfstnode(g); v; v = agnxtnode(g, v))
{
for (e = agfstout(g, v); e; e = agnxtout(g, e))
{
- if(
- (((nodeRec*)(aggetrec(agtail(e),"nodeRec",0)))->visible==0)
- ||
- (((nodeRec*)(aggetrec(aghead(e),"nodeRec",0)))->visible==0))
+ if ((ND_visible(agtail(e))==0) || (ND_visible(aghead(e))==0))
continue;
if(!object_color(e,&c))
continue;
- if(((edgeRec*)(aggetrec(e,"edgeRec",0)))->selected)
+ if(ED_selected(e))
continue;
glColor4f(c.R,c.G,c.B,c.A);
posT=getPointFromStr(agxget(agtail(e), pos_attr));
posH=getPointFromStr(agxget(aghead(e), pos_attr));
draw_edge(&posT,&posH,getEdgeLength(e),0);
- ((edgeRec*)(aggetrec(e,"edgeRec",0)))->posTail=posT;
- ((edgeRec*)(aggetrec(e,"edgeRec",0)))->posHead=posH;
-
-
+ ED_posTail(e) = posT;
+ ED_posHead(e) = posH;
}
}
glEnd();
void renderNodeLabels(Agraph_t * g)
{
Agnode_t *v;
- static glCompPoint pos;
- static Agsym_t* data_attr=(Agsym_t*)0;
- static Agsym_t* l_color_attr=(Agsym_t*)0;
- static GLfloat nodeSize=0;
- static glCompColor c;
- if(!data_attr)
- data_attr=agattr(g, AGNODE,agget(g, "nodelabelattribute"),0);
- if(!l_color_attr)
- l_color_attr=agattr(g, AGRAPH,"nodelabelcolor",0);
-
-
-
+ glCompPoint pos;
+ Agsym_t* data_attr = GN_labelattribute(g);
+ Agsym_t* l_color_attr = GG_nodelabelcolor(g);
+ GLfloat nodeSize;
+ glCompColor c;
glCompColorxlate(&c,agxget(g,l_color_attr));
-
for (v = agfstnode(g); v; v = agnxtnode(g, v))
{
- if(((nodeRec*)(aggetrec(v,"nodeRec",0)))->visible==0)
+ if(ND_visible(v)==0)
continue;
- if(((nodeRec*)(aggetrec(v,"nodeRec",0)))->selected==1)
+ if(ND_selected(v)==1)
continue;
- pos=((nodeRec*)(aggetrec(v,"nodeRec",0)))->A;
- nodeSize=((nodeRec*)(aggetrec(v,"nodeRec",0)))->size;
+ pos = ND_A(v);
+ nodeSize = ND_size(v);
glColor4f(c.R,c.G,c.B,c.A);
if(!data_attr)
glprintfglut(view->glutfont,pos.x+nodeSize,pos.y+nodeSize,pos.z,agnameof(v));
glprintfglut(view->glutfont,pos.x+nodeSize,pos.y+nodeSize,pos.z,agxget(v,data_attr));
}
}
+
void renderEdgeLabels(Agraph_t * g)
{
Agedge_t *e;
Agnode_t *v;
- static glCompPoint posT;
- static glCompPoint posH;
- static Agsym_t* data_attr=(Agsym_t*)0;
- static Agsym_t* l_color_attr=(Agsym_t*)0;
- /* static GLfloat nodeSize=0; */
- static glCompColor c;
+ glCompPoint posT;
+ glCompPoint posH;
+ Agsym_t* data_attr = GE_labelattribute(g);
+ Agsym_t* l_color_attr = GG_edgelabelcolor(g);
+ glCompColor c;
GLfloat x,y,z;
- if(!data_attr)
- data_attr=agattr(g, AGNODE,agget(g, "edgelabelattribute"),0);
- if(!l_color_attr)
- l_color_attr=agattr(g, AGRAPH,"edgelabelcolor",0);
-
glCompColorxlate(&c,agxget(g,l_color_attr));
- if(!data_attr)
+ if(!data_attr || !l_color_attr)
return;
for (v = agfstnode(g); v; v = agnxtnode(g, v))
for (e = agfstout(g, v); e; e = agnxtout(g, e))
{
- if(((edgeRec*)(aggetrec(v,"nodeRec",0)))->visible==0)
+ if (ND_visible(v)==0)
continue;
- posT=((edgeRec*)(aggetrec(e,"edgeRec",0)))->posTail;
- posH=((edgeRec*)(aggetrec(e,"edgeRec",0)))->posHead;
+ posT = ED_posTail(e);
+ posH = ED_posHead(e);
glColor4f(c.R,c.G,c.B,c.A);
x=posH.x+(posT.x-posH.x)/2;
y=posH.y+(posT.y-posH.y)/2;
-static xdot *parseXdotwithattrs(void *e)
-{
-
- int cnt=0;
- xdot* xDot=NULL;
- xDot=parseXDotFOn (agget(e,"_draw_" ), OpFns,sizeof(sdot_op), xDot);
- xDot=parseXDotFOn (agget(e,"_ldraw_" ), OpFns,sizeof(sdot_op), xDot);
- xDot=parseXDotFOn (agget(e,"_hdraw_" ), OpFns,sizeof(sdot_op), xDot);
- xDot=parseXDotFOn (agget(e,"_tdraw_" ), OpFns,sizeof(sdot_op), xDot);
- xDot=parseXDotFOn (agget(e,"_hldraw_" ), OpFns,sizeof(sdot_op), xDot);
- xDot=parseXDotFOn (agget(e,"_tldraw_" ), OpFns,sizeof(sdot_op), xDot);
- if(xDot)
- {
- for (cnt=0;cnt < xDot->cnt ; cnt++)
- {
- ((sdot_op*)(xDot->ops))[cnt].obj=e;
- }
- }
- return xDot;
-
-}
-
void cacheNodes(Agraph_t * g,topview* t)
{
if(t->cache.node_id!=-1) /*clean existing cache*/
#include "btree.h"
#include "viewport.h"
#include "topviewfuncs.h"
-
#include "memory.h"
typedef struct{
static void set_visibility(Agraph_t* g,int visibility)
{
-
Agnode_t *v;
- static char bf1[2];
- static char* bf2;
- static Agsym_t* visible_attr=(Agsym_t*)0;
- static Agsym_t* selected_attr=(Agsym_t*)0;
- if(!visible_attr)
- visible_attr=agattr(g, AGNODE,"visible","1");
- if(!selected_attr)
- selected_attr=agattr(g, AGNODE,"selected",0);
+ char bf1[2];
+ char* bf2;
+ Agsym_t* visible_attr = GN_visible(g);
+ Agsym_t* selected_attr = GN_selected(g);
+
+ if (!visible_attr)
+ visible_attr = GN_visible(g) = agattr(g, AGNODE,"visible","1");
+ if (!selected_attr)
+ return;
sprintf(bf1,"%d",visibility);
for (v = agfstnode(g); v; v = agnxtnode(g, v))
{
bf2=agxget(v,selected_attr);
- if((!bf2) || (strcmp(bf2,"0")==0))
+ if((*bf2 == '\0') || (strcmp(bf2,"0")==0))
continue;
agxset(v,visible_attr,bf1);
}
-
}
int tv_show_all(void)
gtk_tree_view_column_set_resizable (column,1);
}
+#ifdef UNUSED
static int boolStrMap(char* str)
{
if (strcmp(str,"1") ||strcmp(str,"true")|| strcmp(str,"TRUE") || strcmp(str,"True"))
}
-
+#endif
int id=0;
if(tree!=NULL)
{
- while(column=gtk_tree_view_get_column(tree,0)) /*clear all columns*/
+ while ((column=gtk_tree_view_get_column(tree,0))) /*clear all columns*/
gtk_tree_view_remove_column(tree,column);
store=(GtkTreeStore*)gtk_tree_view_get_model(tree);
}
G_TYPE_INT:
G_TYPE_BOOLEAN:
*/
- static char* buf=NULL;
- static GtkTreeStore *store=NULL;
- static GtkTreeView *tree=NULL;
- grid* gr=NULL;
- buf=agget(g,"datacolumns");
-
-// tree=(GtkTreeView *) glade_xml_get_widget(xml, "treeview1");
- gr=update_colums(gr,buf);
+ char* buf = agget(g,"datacolumns");
+ grid* gr = update_colums(NULL,buf);
+ static GtkTreeView *tree;
+
tree=update_tree (tree,gr);
populate_data(g,gr);
}
char *buf;
colorxlate(get_attribute_value("bordercolor", view, g), &cl,
RGBA_DOUBLE);
- glEnable(GL_POINT_SMOOTH);
+ /* glEnable(GL_POINT_SMOOTH); */
view->borderColor.R = (float) cl.u.RGBA[0];
view->borderColor.G = (float) cl.u.RGBA[1];
view->borderColor.B = (float) cl.u.RGBA[2];
/* If no position info, run layout with -Txdot
*/
if (!agattr(g, AGNODE, "pos", NULL)) {
- g_print("There is no position info in %s\n", filename);
+ g_print("There is no position info in graph %s in %s\n", agnameof(g), filename);
+ agclose (g);
return 0;
}
// free(view->Topview->Graphdata.GraphFileName);
</widget>
</child>
- <child>
- <widget class="GtkMenuItem" id="menuitem6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Select</property>
- <property name="use_underline">True</property>
-
- <child>
- <widget class="GtkMenu" id="menuitem6_menu">
-
- <child>
- <widget class="GtkImageMenuItem" id="mSelectAll">
- <property name="visible">True</property>
- <property name="label">gtk-select-all</property>
- <property name="use_stock">True</property>
- <signal name="activate" handler="mSelectAllSlot"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="mUnselectAll">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Unselect All</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="mUnselectAllSlot"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="menuitem7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Select All Nodes</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="mSelectAllNodesSlot"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="menuitem8">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Select All Edges</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="mSelectAllEdgesSlot"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="menuitem9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Select All Clusters</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="mSelectAllClustersSlot"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="menuitem10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Unselect All Nodes</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="mUnselectAllNodesSlot"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="menuitem11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Unselect All Edges</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="mUnselectAllEdgesSlot"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="menuitem12">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Unselect All Clusters</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="mUnselectAllClustersSlot"/>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
<child>
<widget class="GtkMenuItem" id="menuitem4">
<property name="visible">True</property>
<property name="hadjustment">0 0 710 0 639 710</property>
<property name="vadjustment">0 0 400 0 36 40</property>
- <child>
- <widget class="GtkButton" id="btnTVFirst">
- <property name="width_request">40</property>
- <property name="height_request">25</property>
- <property name="visible">True</property>
- <property name="label" translatable="yes"><<</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <signal name="clicked" handler="btnTVFirst_clicked_cb"/>
- </widget>
- <packing>
- <property name="x">5</property>
- <property name="y">10</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="btnTVPrevious">
- <property name="width_request">40</property>
- <property name="height_request">25</property>
- <property name="visible">True</property>
- <property name="label" translatable="yes"><</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <signal name="clicked" handler="btnTVPrevious_clicked_cb"/>
- </widget>
- <packing>
- <property name="x">51</property>
- <property name="y">10</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="btnTVNext">
- <property name="width_request">40</property>
- <property name="height_request">25</property>
- <property name="visible">True</property>
- <property name="label" translatable="yes">></property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <signal name="clicked" handler="btnTVNext_clicked_cb"/>
- </widget>
- <packing>
- <property name="x">95</property>
- <property name="y">10</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="btnTVLast">
- <property name="width_request">40</property>
- <property name="height_request">25</property>
- <property name="visible">True</property>
- <property name="label" translatable="yes">>></property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <signal name="clicked" handler="btnTVLast_clicked_cb"/>
- </widget>
- <packing>
- <property name="x">140</property>
- <property name="y">10</property>
- </packing>
- </child>
-
<child>
<widget class="GtkLabel" id="lblTVPage">
<property name="width_request">136</property>
</packing>
</child>
- <child>
- <widget class="GtkButton" id="btnTVGotopage">
- <property name="width_request">90</property>
- <property name="height_request">25</property>
- <property name="visible">True</property>
- <property name="label" translatable="yes">Go to page #</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <signal name="clicked" handler="btnTVGotopage_clicked_cb"/>
- </widget>
- <packing>
- <property name="x">317</property>
- <property name="y">10</property>
- </packing>
- </child>
-
<child>
<widget class="GtkSpinButton" id="spnTVGotopage">
<property name="width_request">99</property>
</child>
</widget>
-<widget class="GtkDialog" id="dlgTVFilter">
- <property name="border_width">5</property>
- <property name="width_request">590</property>
- <property name="height_request">196</property>
- <property name="title" translatable="yes"></property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">590</property>
- <property name="default_height">350</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area2">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="btnTVFilterCancel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Cancel</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">2</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="btnTVFilterApply">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Apply</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">1</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLayout" id="layout11">
- <property name="visible">True</property>
- <property name="width">400</property>
- <property name="height">400</property>
- <property name="hadjustment">0 0 576 0 518.4 576</property>
- <property name="vadjustment">0 0 400 0 128.7 143</property>
-
- <child>
- <widget class="GtkTable" id="table1">
- <property name="width_request">419</property>
- <property name="height_request">80</property>
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">0</property>
- <property name="column_spacing">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="rbTVFilterSel1">
- <property name="width_request">15</property>
- <property name="visible">True</property>
- <property name="label" translatable="yes">All</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="rbTVFilterSel2">
- <property name="width_request">75</property>
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selected</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">rbTVFilterSel1</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="rbTVFilterSel3">
- <property name="width_request">100</property>
- <property name="visible">True</property>
- <property name="label" translatable="yes">Non-selected</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">rbTVFilterSel1</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selection</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Visible</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label10">
- <property name="label" translatable="yes">Highlighted</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox3">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="rbTVFilterVisible1">
- <property name="width_request">15</property>
- <property name="visible">True</property>
- <property name="label" translatable="yes">All</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="rbTVFilterVisible2">
- <property name="width_request">75</property>
- <property name="visible">True</property>
- <property name="label" translatable="yes">Visible</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">rbTVFilterVisible1</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="rbTVFilterVisible3">
- <property name="width_request">100</property>
- <property name="visible">True</property>
- <property name="label" translatable="yes">Hidden</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">rbTVFilterVisible1</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox4">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="rbTVFilterHigh1">
- <property name="width_request">15</property>
- <property name="label" translatable="yes">All</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="rbTVFilterHigh2">
- <property name="width_request">75</property>
- <property name="label" translatable="yes">Highlighted</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">rbTVFilterHigh1</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="rbTVFilterHigh3">
- <property name="width_request">100</property>
- <property name="label" translatable="yes">Not Highlighted</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">rbTVFilterHigh1</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="x">2</property>
- <property name="y">30</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label13">
- <property name="width_request">181</property>
- <property name="height_request">20</property>
- <property name="visible">True</property>
- <property name="label" translatable="yes">FILTER CRITERIAS</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="x">0</property>
- <property name="y">0</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator4">
- <property name="width_request">581</property>
- <property name="height_request">20</property>
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="x">0</property>
- <property name="y">13</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="btnTVFilterClear">
- <property name="width_request">100</property>
- <property name="height_request">29</property>
- <property name="visible">True</property>
- <property name="label" translatable="yes">Clear Filter</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <signal name="clicked" handler="btnTVFilterClear_clicked_cb"/>
- </widget>
- <packing>
- <property name="x">467</property>
- <property name="y">32</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
<widget class="GtkDialog" id="dlgSettings">
<property name="border_width">5</property>
<property name="width_request">676</property>