+/* $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,
-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;
*dataOut = vertex;
}
-void CALLBACK vertexCallback(GLvoid *vertex)
+void vertexCallback(GLvoid *vertex)
{
GLdouble *ptr;
ptr = (GLdouble *) vertex;
{
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;
return(1);
}
+#if 0
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];
return(1);
}
-
-
-
-
-
+#endif
static int Begin_Polygon(GLUtesselator *tobj)
{
}
int drawTessPolygon(sdot_op* p)
{
+ static tessPoly TP;
if (!TP.tobj)
{
TP.tobj=Init();
+/* $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;
return atoi(p);
}
+#if 0
static int late_int(void *obj,Agsym_t* attr, int def, int low)
{
char *p;
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);
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;
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;
c->B = sc->s[ind].c.B;
c->A = 1;
}
-}*/
+}
+#endif
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;
if(tempStr)
{
if (strlen(tempStr) > 0) /*set node size */
- t->Nodes[ind].size = atof(tempStr);
+ t->Nodes[ind].size = 0.01*atof(tempStr);
}
}
}
+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);
glEndList();
}
+#endif
void update_topview(Agraph_t * g, topview * t, int init)
{
}
-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);
}
freePM(map);
}
-void CALLBACK tessBeginCB(GLenum which)
+
+void tessBeginCB(GLenum which)
{
glBegin(which);
}
-void CALLBACK tessEndCB()
+void tessEndCB()
{
glEnd();
}
exit (0);
}
+#if 0
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);
gluTessVertex(tobj, star[4], star[4]);
gluTessEndContour(tobj);
gluTessEndPolygon(tobj);
-}
\ No newline at end of file
+}
+#endif