From: erg Date: Mon, 1 Feb 2010 21:31:52 +0000 (+0000) Subject: Add license, vi comments, and cvs tags. X-Git-Tag: LAST_LIBGRAPH~32^2~1456 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b350cb2a135668afc38ac763b01abcff1230d6dd;p=graphviz Add license, vi comments, and cvs tags. Comment out unused and/or bad code --- diff --git a/cmd/smyrna/polytess.c b/cmd/smyrna/polytess.c index dea06f518..eb522d505 100644 --- a/cmd/smyrna/polytess.c +++ b/cmd/smyrna/polytess.c @@ -1,7 +1,22 @@ +/* $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; +#if 0 GLdouble star[5][3] = { 0.6f, -0.1f, 0.0f, 1.35f, 1.4f, 0.0f, 2.1f, -0.1f, 0.0f, @@ -75,7 +90,8 @@ GLdouble complex[25][3] = { 0.0f, 0.0f, 0.0f, -void CALLBACK combineCallback(GLdouble coords[3], GLdouble *vertex_data[4],GLfloat weight[4], GLdouble **dataOut) +#endif +void combineCallback(GLdouble coords[3], GLdouble *vertex_data[4],GLfloat weight[4], GLdouble **dataOut) { GLdouble *vertex; int i; @@ -95,7 +111,7 @@ void CALLBACK combineCallback(GLdouble coords[3], GLdouble *vertex_data[4],GLflo *dataOut = vertex; } -void CALLBACK vertexCallback(GLvoid *vertex) +void vertexCallback(GLvoid *vertex) { GLdouble *ptr; ptr = (GLdouble *) vertex; @@ -131,12 +147,12 @@ static int Render_Contour2(GLUtesselator *tobj,sdot_op* p) { GLdouble** d; int x=0; - int y=0; + /* int y=0; */ d=(GLdouble**) malloc(sizeof(GLdouble)* p->op.u.polygon.cnt); for (x=0;x < p->op.u.polygon.cnt; x++) { - GLdouble temp; + /* GLdouble temp; */ d[x]=(GLdouble*)(malloc(sizeof(GLdouble)*3)); d[x][0]=p->op.u.polygon.pts[x].x; d[x][1]=p->op.u.polygon.pts[x].y; @@ -159,6 +175,7 @@ static int Render_Contour2(GLUtesselator *tobj,sdot_op* p) return(1); } +#if 0 static int Render_Contour(GLUtesselator *tobj, GLdouble obj_data[][3],int cnt) { @@ -167,13 +184,13 @@ static int Render_Contour(GLUtesselator *tobj, GLdouble obj_data[][3],int cnt) // GLdouble d[1][3]; static GLdouble**d; int x=0; - int y=0; + /* int y=0; */ if (!d) { d=(GLdouble**) malloc(sizeof(GLdouble)* cnt); for (x=0;x < cnt; x++) { - GLdouble temp; + /* GLdouble temp; */ d[x]=(GLdouble*)(malloc(sizeof(GLdouble)*3)); d[x][0]=obj_data[x][0]; d[x][1]=obj_data[x][1]; @@ -207,11 +224,7 @@ static int Render_Contour(GLUtesselator *tobj, GLdouble obj_data[][3],int cnt) return(1); } - - - - - +#endif static int Begin_Polygon(GLUtesselator *tobj) { @@ -245,6 +258,7 @@ static int freeTes(GLUtesselator *tobj) } int drawTessPolygon(sdot_op* p) { + static tessPoly TP; if (!TP.tobj) { TP.tobj=Init(); diff --git a/cmd/smyrna/smyrna_utils.c b/cmd/smyrna/smyrna_utils.c index 349e0895a..709ed196f 100644 --- a/cmd/smyrna/smyrna_utils.c +++ b/cmd/smyrna/smyrna_utils.c @@ -1,5 +1,20 @@ +/* $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 "smyrna_utils.h" -static boolean mapbool(char *p) +static int mapbool(char *p) { if (p == NULL) return FALSE; @@ -14,6 +29,7 @@ static boolean mapbool(char *p) return atoi(p); } +#if 0 static int late_int(void *obj,Agsym_t* attr, int def, int low) { char *p; @@ -43,13 +59,6 @@ static double late_double(void *obj, Agsym_t* attr, double def, double low) return rv; } -static char* late_string(void *obj, Agsym_t * attr, char *def) -{ - if (!attr || !obj) - return def; - return agxget(obj, attr); -} - static char *late_nnstring(void *obj, Agsym_t * attr, char *def) { char *rv = late_string(obj, attr, def); @@ -58,7 +67,16 @@ static char *late_nnstring(void *obj, Agsym_t * attr, char *def) return rv; } -static boolean late_bool(void *obj, Agsym_t * attr, int def) +#endif + +static char* late_string(void *obj, Agsym_t * attr, char *def) +{ + if (!attr || !obj) + return def; + return agxget(obj, attr); +} + +static int late_bool(void *obj, Agsym_t * attr, int def) { if (attr == NULL) return def; @@ -119,13 +137,16 @@ void setColor(glCompColor* c,GLfloat R,GLfloat G,GLfloat B,GLfloat A) c->B=B; c->A=A; } + +#if 0 static float interpol(float minv, float maxv, float minc, float maxc, float x) { return ((x - minv) * (maxc - minc) / (maxv - minv) + minc); } -/*void getcolorfromschema(colorschemaset * sc, float l, float maxl,glCompColor * c) +void +getcolorfromschema(colorschemaset * sc, float l, float maxl,glCompColor * c) { int ind; float percl = l / maxl * 100.00; @@ -151,4 +172,5 @@ static float interpol(float minv, float maxv, float minc, float maxc, float x) c->B = sc->s[ind].c.B; c->A = 1; } -}*/ +} +#endif diff --git a/cmd/smyrna/smyrna_utils.h b/cmd/smyrna/smyrna_utils.h index 5f69e2ec0..500c78bf5 100644 --- a/cmd/smyrna/smyrna_utils.h +++ b/cmd/smyrna/smyrna_utils.h @@ -1,3 +1,18 @@ +/* $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 * +**********************************************************/ #ifndef SMYRNA_UTILS_H #define SMYRNA_UTILS_H diff --git a/cmd/smyrna/topview.c b/cmd/smyrna/topview.c index 9495dccdb..4c9b4e113 100755 --- a/cmd/smyrna/topview.c +++ b/cmd/smyrna/topview.c @@ -197,7 +197,7 @@ void settvcolorinfo(Agraph_t * g, topview * t) Agsym_t *ecolor = agattr(g, AGEDGE, "color", 0); Agsym_t *edgeid = agattr(g, AGEDGE, "edgeid", 0); Agsym_t *poss = agattr(g, AGNODE, "pos", 0); - int setpos=1; + /* int setpos=1; */ assert(poss); maxedgelen = 0; xmax = ymax = -MAXFLOAT; @@ -228,7 +228,7 @@ void settvcolorinfo(Agraph_t * g, topview * t) if(tempStr) { if (strlen(tempStr) > 0) /*set node size */ - t->Nodes[ind].size = atof(tempStr); + t->Nodes[ind].size = 0.01*atof(tempStr); } } @@ -388,8 +388,75 @@ static void reset_refresh(ViewInfo* v) } +static int drawtopviewlabels(Agraph_t * g) +{ + //drawing labels + int ind = 0; + topview_node *v; + float f; + + if (((view->visiblenodecount > view->labelnumberofnodes) + && (view->active_camera == -1)) + || (!view->labelshownodes) || (!view->drawnodes)) + return 0; + if (view->Topview->maxnodedegree > 15) + f = 15; + else + f = view->Topview->maxnodedegree; + for (ind = 0; ind < view->Topview->Nodecount; ind++) { + + v = &view->Topview->Nodes[ind]; + + if (view->active_camera == -1) { + if (((float) view->visiblenodecount > + view->labelnumberofnodes * v->degree / f) + && view->labelwithdegree) + continue; + } + if (!node_visible(v)) + continue; + draw_topview_label(v, 1); + } + return 1; +} + +static int drawtopviewedgelabels(Agraph_t * g) +{ + //drawing labels + int ind = 0; + topview_edge *e; + float f; + + if ((view->visiblenodecount > view->labelnumberofnodes) + || (!view->labelshowedges)) + return 0; + if (view->Topview->maxnodedegree > 15) + f = 15; + else + f = view->Topview->maxnodedegree; + for (ind = 0; ind < view->Topview->Edgecount; ind++) { + + e = &view->Topview->Edges[ind]; + + if ((((float) view->visiblenodecount > + view->labelnumberofnodes * e->Node1->degree / f) + && view->labelwithdegree) + && + (((float) view->visiblenodecount > + view->labelnumberofnodes * e->Node2->degree / f) + && view->labelwithdegree) + ) + continue; + if ((!node_visible(e->Node1)) && (!node_visible(e->Node2))) + continue; + draw_topview_edge_label(e, 0.001); + } + return 1; +} + -static create_DL() +#if 0 +static void create_DL() { Agraph_t* g=view->g[view->activeGraph]; glNewList(1,GL_COMPILE); @@ -402,6 +469,7 @@ static create_DL() glEndList(); } +#endif void update_topview(Agraph_t * g, topview * t, int init) { @@ -863,78 +931,12 @@ static void drawtopviewedges(Agraph_t * g) } -static int drawtopviewlabels(Agraph_t * g) -{ - //drawing labels - int ind = 0; - topview_node *v; - float f; - - if (((view->visiblenodecount > view->labelnumberofnodes) - && (view->active_camera == -1)) - || (!view->labelshownodes) || (!view->drawnodes)) - return 0; - if (view->Topview->maxnodedegree > 15) - f = 15; - else - f = view->Topview->maxnodedegree; - for (ind = 0; ind < view->Topview->Nodecount; ind++) { - - v = &view->Topview->Nodes[ind]; - - if (view->active_camera == -1) { - if (((float) view->visiblenodecount > - view->labelnumberofnodes * v->degree / f) - && view->labelwithdegree) - continue; - } - if (!node_visible(v)) - continue; - draw_topview_label(v, 1); - } - return 1; -} -static int drawtopviewedgelabels(Agraph_t * g) -{ - //drawing labels - int ind = 0; - topview_edge *e; - float f; - - if ((view->visiblenodecount > view->labelnumberofnodes) - || (!view->labelshowedges)) - return 0; - if (view->Topview->maxnodedegree > 15) - f = 15; - else - f = view->Topview->maxnodedegree; - for (ind = 0; ind < view->Topview->Edgecount; ind++) { - - e = &view->Topview->Edges[ind]; - - if ((((float) view->visiblenodecount > - view->labelnumberofnodes * e->Node1->degree / f) - && view->labelwithdegree) - && - (((float) view->visiblenodecount > - view->labelnumberofnodes * e->Node2->degree / f) - && view->labelwithdegree) - ) - continue; - if ((!node_visible(e->Node1)) && (!node_visible(e->Node2))) - continue; - draw_topview_edge_label(e, 0.001); - } - return 1; -} - void drawTopViewGraph(Agraph_t * g) { - -/* glEnable (GL_BLEND); + glEnable (GL_BLEND); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glDisable(GL_DEPTH_TEST);*/ + glDisable(GL_DEPTH_TEST); // glDisable(GL_DEPTH_TEST); // glCallList (1); @@ -1498,14 +1500,15 @@ void setMultiedges(Agraph_t * g, char *attrname) } freePM(map); } -void CALLBACK tessBeginCB(GLenum which) + +void tessBeginCB(GLenum which) { glBegin(which); } -void CALLBACK tessEndCB() +void tessEndCB() { glEnd(); } @@ -1518,6 +1521,7 @@ void errorCallback(GLenum errorCode) exit (0); } +#if 0 void tesstest() { @@ -1543,8 +1547,8 @@ void tesstest() // gluTessCallback(tobj, GLU_TESS_VERTEX,(GLvoid (*) ()) &glVertex3dv); - gluTessCallback(tobj, GLU_TESS_BEGIN, (void (CALLBACK *)())tessBeginCB); - gluTessCallback(tobj, GLU_TESS_END, (void (CALLBACK *)())tessEndCB); + gluTessCallback(tobj, GLU_TESS_BEGIN, (void (*)())tessBeginCB); + gluTessCallback(tobj, GLU_TESS_END, (void (*)())tessEndCB); glShadeModel(GL_FLAT); @@ -1574,4 +1578,5 @@ void tesstest() gluTessVertex(tobj, star[4], star[4]); gluTessEndContour(tobj); gluTessEndPolygon(tobj); -} \ No newline at end of file +} +#endif