]> granicus.if.org Git - graphviz/commitdiff
Clean up smyrna files:
authorerg <devnull@localhost>
Wed, 19 Mar 2008 21:43:58 +0000 (21:43 +0000)
committererg <devnull@localhost>
Wed, 19 Mar 2008 21:43:58 +0000 (21:43 +0000)
  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

lib/glcomp/glutils.c
lib/glcomp/glutils.h
lib/topfish/Makefile.am

index d4b13fae20c5a580705b11d0721a1f8a42bae103..aafe6273e485129d5b59fd1eb2592f3bffcb9869 100644 (file)
@@ -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));
 
 }
index 8643b60bd922291f64c7952b787e28af915419f1..fdad997c004f90784549ecc7cea66d536995d7f8 100644 (file)
@@ -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 <GL/gl.h>
-#include <GL/glu.h>                                                    
+#include <GL/glu.h>
 
 
-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
-
index f20d82ae1cff7fba32bc9aea4b642de52f75987f..55cf2a8f65e52754bdc9b9f6c7a6207fd05a4630 100644 (file)
@@ -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