From: erg Date: Wed, 19 Mar 2008 21:43:58 +0000 (+0000) Subject: Clean up smyrna files: X-Git-Tag: LAST_LIBGRAPH~32^2~4469 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1436fef2e5cf60fad1ac6e586b3c658ef73459ea;p=graphviz Clean up smyrna files: remove unnecessary globals modify libraries not to rely on code in cmd/smyrna remove static declarations from .h files remove unnecessary libraries mark unused code and clean up warnings --- diff --git a/lib/glcomp/glutils.c b/lib/glcomp/glutils.c index d4b13fae2..aafe6273e 100644 --- a/lib/glcomp/glutils.c +++ b/lib/glcomp/glutils.c @@ -1,74 +1,94 @@ +/* vim:set shiftwidth=4 ts=8: */ + +/********************************************************** +* This software is part of the graphviz package * +* http://www.graphviz.org/ * +* * +* Copyright (c) 1994-2007 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 "glutils.h" /* at given depth value, tranforms 2d Window location to 3d gl coords*/ -int GetFixedOGLPos(int x, int y,float kts,GLfloat* X,GLfloat* Y, GLfloat* Z) +int GetFixedOGLPos(int x, int y, float kts, GLfloat * X, GLfloat * Y, + GLfloat * Z) { - GLdouble wwinX; - GLdouble wwinY; - GLdouble wwinZ; + GLdouble wwinX; + GLdouble wwinY; + GLdouble wwinZ; - GLint viewport[4]; - GLdouble modelview[16]; - GLdouble projection[16]; - GLfloat winX, winY; - GLdouble posX, posY, posZ; + GLint viewport[4]; + GLdouble modelview[16]; + GLdouble projection[16]; + GLfloat winX, winY; + GLdouble posX, posY, posZ; - glBegin(GL_POINTS); - glVertex3f(10.00,10.00,0.00); - glEnd(); + glBegin(GL_POINTS); + glVertex3f(10.00, 10.00, 0.00); + glEnd(); - glGetDoublev( GL_MODELVIEW_MATRIX, modelview ); - glGetDoublev( GL_PROJECTION_MATRIX, projection ); - glGetIntegerv( GL_VIEWPORT, viewport ); + glGetDoublev(GL_MODELVIEW_MATRIX, modelview); + glGetDoublev(GL_PROJECTION_MATRIX, projection); + glGetIntegerv(GL_VIEWPORT, viewport); - gluProject(10.0,10.0,0.00,modelview,projection,viewport,&wwinX,&wwinY,&wwinZ ); + gluProject(10.0, 10.0, 0.00, modelview, projection, viewport, &wwinX, + &wwinY, &wwinZ); - winX = (float)x; - winY = (float)viewport[3] - (float)y; - gluUnProject( winX, winY, wwinZ, modelview, projection, viewport, &posX, &posY, &posZ); - *X=(GLfloat)posX; - *Y=(GLfloat)posY; - *Z=(GLfloat)posZ; + winX = (float) x; + winY = (float) viewport[3] - (float) y; + gluUnProject(winX, winY, wwinZ, modelview, projection, viewport, &posX, + &posY, &posZ); + *X = (GLfloat) posX; + *Y = (GLfloat) posY; + *Z = (GLfloat) posZ; - return 1; + return 1; } /*transforms 2d windows location to 3d gl coords but depth is calculated unlike the previous function*/ -int GetOGLPosRef(int x, int y,float* X,float* Y,float* Z) +int GetOGLPosRef(int x, int y, float *X, float *Y, float *Z) { - GLdouble wwinX; - GLdouble wwinY; - GLdouble wwinZ; - GLdouble posX, posY, posZ; - - - GLint viewport[4]; - GLdouble modelview[16]; - GLdouble projection[16]; - GLfloat winX, winY; - float kts=1; - //glTranslatef (0.0,0.0,0.0); - glGetDoublev( GL_MODELVIEW_MATRIX, modelview ); - glGetDoublev( GL_PROJECTION_MATRIX, projection ); - glGetIntegerv( GL_VIEWPORT, viewport ); - - //draw a point to a not important location to get window coordinates - glBegin(GL_POINTS); - glVertex3f(10.00,10.00,0.00); - glEnd(); - gluProject(10.0,10.0,0.00,modelview,projection,viewport,&wwinX,&wwinY,&wwinZ ); - winX = (float)x; - winY = (float)viewport[3] - (float)y; - gluUnProject( winX, winY, wwinZ, modelview, projection, viewport, &posX, &posY, &posZ); - - *X=(float)posX; - *Y=(float)posY; - *Z=(float)posZ; - return 1; + GLdouble wwinX; + GLdouble wwinY; + GLdouble wwinZ; + GLdouble posX, posY, posZ; + + + GLint viewport[4]; + GLdouble modelview[16]; + GLdouble projection[16]; + GLfloat winX, winY; + float kts = 1; + //glTranslatef (0.0,0.0,0.0); + glGetDoublev(GL_MODELVIEW_MATRIX, modelview); + glGetDoublev(GL_PROJECTION_MATRIX, projection); + glGetIntegerv(GL_VIEWPORT, viewport); + + //draw a point to a not important location to get window coordinates + glBegin(GL_POINTS); + glVertex3f(10.00, 10.00, 0.00); + glEnd(); + gluProject(10.0, 10.0, 0.00, modelview, projection, viewport, &wwinX, + &wwinY, &wwinZ); + winX = (float) x; + winY = (float) viewport[3] - (float) y; + gluUnProject(winX, winY, wwinZ, modelview, projection, viewport, &posX, + &posY, &posZ); + + *X = (float) posX; + *Y = (float) posY; + *Z = (float) posZ; + return 1; } @@ -76,39 +96,42 @@ int GetOGLPosRef(int x, int y,float* X,float* Y,float* Z) float GetOGLDistance(int l) { - int x,y; - GLdouble wwinX; - GLdouble wwinY; - GLdouble wwinZ; - GLdouble posX, posY, posZ; - GLdouble posXX, posYY, posZZ; - - - GLint viewport[4]; - GLdouble modelview[16]; - GLdouble projection[16]; - GLfloat winX, winY; - float kts=1; - //glTranslatef (0.0,0.0,0.0); - glGetDoublev( GL_MODELVIEW_MATRIX, modelview ); - glGetDoublev( GL_PROJECTION_MATRIX, projection ); - glGetIntegerv( GL_VIEWPORT, viewport ); - - //draw a point to a not important location to get window coordinates - glBegin(GL_POINTS); - glVertex3f(10.00,10.00,0.00); - glEnd(); - gluProject(10.0,10.0,0.00,modelview,projection,viewport,&wwinX,&wwinY,&wwinZ ); - x=50; - y=50; - winX = (float)x; - winY = (float)viewport[3] - (float)y; - gluUnProject( winX, winY, wwinZ, modelview, projection, viewport, &posX, &posY, &posZ); - x=x+l; - y=50; - winX = (float)x; - winY = (float)viewport[3] - (float)y; - gluUnProject( winX, winY, wwinZ, modelview, projection, viewport, &posXX, &posYY, &posZZ); - return ((float)(posXX-posX)); + int x, y; + GLdouble wwinX; + GLdouble wwinY; + GLdouble wwinZ; + GLdouble posX, posY, posZ; + GLdouble posXX, posYY, posZZ; + + + GLint viewport[4]; + GLdouble modelview[16]; + GLdouble projection[16]; + GLfloat winX, winY; + float kts = 1; + //glTranslatef (0.0,0.0,0.0); + glGetDoublev(GL_MODELVIEW_MATRIX, modelview); + glGetDoublev(GL_PROJECTION_MATRIX, projection); + glGetIntegerv(GL_VIEWPORT, viewport); + + //draw a point to a not important location to get window coordinates + glBegin(GL_POINTS); + glVertex3f(10.00, 10.00, 0.00); + glEnd(); + gluProject(10.0, 10.0, 0.00, modelview, projection, viewport, &wwinX, + &wwinY, &wwinZ); + x = 50; + y = 50; + winX = (float) x; + winY = (float) viewport[3] - (float) y; + gluUnProject(winX, winY, wwinZ, modelview, projection, viewport, &posX, + &posY, &posZ); + x = x + l; + y = 50; + winX = (float) x; + winY = (float) viewport[3] - (float) y; + gluUnProject(winX, winY, wwinZ, modelview, projection, viewport, + &posXX, &posYY, &posZZ); + return ((float) (posXX - posX)); } diff --git a/lib/glcomp/glutils.h b/lib/glcomp/glutils.h index 8643b60bd..fdad997c0 100644 --- a/lib/glcomp/glutils.h +++ b/lib/glcomp/glutils.h @@ -1,15 +1,30 @@ +/* vim:set shiftwidth=4 ts=8: */ + +/********************************************************** +* This software is part of the graphviz package * +* http://www.graphviz.org/ * +* * +* Copyright (c) 1994-2007 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 GLUTILS_H #define GLUTILS_H #ifdef _WIN32 #include "windows.h" #endif #include -#include +#include -int GetFixedOGLPos(int x, int y,float kts,GLfloat* X,GLfloat* Y, GLfloat* Z); -int GetOGLPosRef(int x, int y,float* X,float* Y,float* Z); +int GetFixedOGLPos(int x, int y, float kts, GLfloat * X, GLfloat * Y, + GLfloat * Z); +int GetOGLPosRef(int x, int y, float *X, float *Y, float *Z); float GetOGLDistance(int l); #endif - diff --git a/lib/topfish/Makefile.am b/lib/topfish/Makefile.am index f20d82ae1..55cf2a8f6 100644 --- a/lib/topfish/Makefile.am +++ b/lib/topfish/Makefile.am @@ -3,10 +3,7 @@ # AM_CPPFLAGS = \ -I$(top_srcdir) \ - -I$(top_srcdir)/lib/cgraph \ - -I$(top_srcdir)/lib/cdt \ - -I$(top_srcdir)/lib/common \ - $(GTK_CFLAGS) $(GTKGL_CFLAGS) $(GTKGLEXT_CFLAGS) $(GLADE_CFLAGS) $(FREETYPE2_CFLAGS) + -I$(top_srcdir)/lib/common if WITH_SMYRNA noinst_HEADERS = matrix_ops.h triangle.h defs.h hierarchy.h