From e621ebf4dcbab2ad3a456db18897ad892981d13c Mon Sep 17 00:00:00 2001 From: erg Date: Mon, 13 Sep 2010 22:24:20 +0000 Subject: [PATCH] Remove broken magnifier code --- cmd/smyrna/draw.c | 46 ++++++++++++++++--------------------- cmd/smyrna/draw.h | 4 ++-- cmd/smyrna/glexpose.c | 5 +++- cmd/smyrna/topfisheyeview.c | 11 +++++++++ cmd/smyrna/topfisheyeview.h | 2 ++ 5 files changed, 39 insertions(+), 29 deletions(-) diff --git a/cmd/smyrna/draw.c b/cmd/smyrna/draw.c index 3c0bf54c4..ad9c56a87 100755 --- a/cmd/smyrna/draw.c +++ b/cmd/smyrna/draw.c @@ -501,6 +501,7 @@ void draw_selection_box(ViewInfo * view) } #endif +#if 0 void draw_magnifier(ViewInfo * view) { @@ -573,9 +574,7 @@ static void draw_circle(float originX, float originY, float radius) GLUquadric *fisheyesphere; void draw_fisheye_magnifier(ViewInfo * view) { - if (get_mode(view)==MM_FISHEYE_MAGNIFIER) - - { + if (get_mode(view)==MM_FISHEYE_MAGNIFIER) { float a; GLfloat mg_x, mg_y, mg_z; a = GetOGLDistance((int) view->fmg.constantR); @@ -584,32 +583,27 @@ void draw_fisheye_magnifier(ViewInfo * view) &mg_x, &mg_y, &mg_z); glColor4f((GLfloat) 0.3, (GLfloat) 0.1, (GLfloat) 0.8, (GLfloat) 1); - if (((view->fmg.x != mg_x) || (view->fmg.y != mg_y)) - && (view->active_camera == -1)) { - fisheye_polar(mg_x, mg_y, view->Topview); - draw_circle(mg_x, mg_y, a); - } - if (((view->fmg.x != mg_x) || (view->fmg.y != mg_y)) - && (view->active_camera > -1)) { - fisheye_spherical(mg_x, mg_y, 0.00, view->Topview); - - - if (!fisheyesphere) - fisheyesphere = gluNewQuadric(); - gluQuadricDrawStyle(fisheyesphere, GLU_LINE); - glColor4f((GLfloat) 0.3, (GLfloat) 0.1, (GLfloat) 0.8, - (GLfloat) 0.05); - glTranslatef(mg_x, mg_y, 0); - gluSphere(fisheyesphere, a, 30, 30); - glTranslatef(-mg_x, -mg_y, 0); + if ((view->fmg.x != mg_x) || (view->fmg.y != mg_y)) { + if (view->active_camera == -1) { + /* fisheye_polar(mg_x, mg_y, view->Topview); */ + draw_circle(mg_x, mg_y, a); + } + else { + /* fisheye_spherical(mg_x, mg_y, 0.00, view->Topview); */ + if (!fisheyesphere) + fisheyesphere = gluNewQuadric(); + gluQuadricDrawStyle(fisheyesphere, GLU_LINE); + glColor4f((GLfloat) 0.3, (GLfloat) 0.1, (GLfloat) 0.8, (GLfloat) 0.05); + glTranslatef(mg_x, mg_y, 0); + gluSphere(fisheyesphere, a, 30, 30); + glTranslatef(-mg_x, -mg_y, 0); + } + view->fmg.x = mg_x; + view->fmg.y = mg_y; } - - - view->fmg.x = mg_x; - view->fmg.y = mg_y; - } } +#endif void drawBorders(ViewInfo * view) { diff --git a/cmd/smyrna/draw.h b/cmd/smyrna/draw.h index d98ca3516..25ec84b84 100755 --- a/cmd/smyrna/draw.h +++ b/cmd/smyrna/draw.h @@ -39,10 +39,10 @@ extern int randomize_color(glCompColor * c, int brightness); extern void draw_sphere(float x, float y, float z, float r); extern int draw_node_hintbox(GLfloat x, GLfloat y, GLfloat z, GLfloat fs, char *text); extern glCompColor GetglCompColor(char *color); -#endif -extern void draw_selection_box(ViewInfo * view); extern void draw_magnifier(ViewInfo * view); extern void draw_fisheye_magnifier(ViewInfo * view); +#endif +extern void draw_selection_box(ViewInfo * view); extern void drawCircle(float x, float y, float radius, float zdepth); extern void drawBorders(ViewInfo * view); extern void drawEllipse(float xradius, float yradius, int angle1, int angle2); diff --git a/cmd/smyrna/glexpose.c b/cmd/smyrna/glexpose.c index 8f1f1c0b5..4afd90d69 100644 --- a/cmd/smyrna/glexpose.c +++ b/cmd/smyrna/glexpose.c @@ -61,7 +61,7 @@ void LoadGLTextures() // Load Bitmaps And Convert To Textures } - +#if UNUSED void draw_cube_tex() { @@ -155,6 +155,7 @@ static void draw_cube() glVertex3f(100.0f, -100.0f, -100.0f); // Bottom Right Of The Quad (Right) glEnd(); } +#endif static void drawRotatingAxis(void) { @@ -371,8 +372,10 @@ int glexpose_main(ViewInfo * view) glexpose_grid(view); +#if UNUSED draw_fisheye_magnifier(view); draw_magnifier(view); +#endif drawBorders(view); glexpose_drawgraph(view); drawRotatingAxis(); diff --git a/cmd/smyrna/topfisheyeview.c b/cmd/smyrna/topfisheyeview.c index fd77c568e..dafb821c0 100644 --- a/cmd/smyrna/topfisheyeview.c +++ b/cmd/smyrna/topfisheyeview.c @@ -61,6 +61,7 @@ static void color_interpolation(glCompColor srcColor, glCompColor tarColor, (float) levelcount * srcColor.B) / (float) levelcount; } +#ifdef UNUSED static double dist(double x1, double y1, double x2, double y2) { return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); @@ -71,11 +72,20 @@ static double dist3d(double x1, double y1, double z1, double x2, double y2, return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + (z1 - z2) * (z1 - z2)); } +#endif #ifdef UNUSED static void drawtopologicalfisheyestatic(topview * t); #endif +#ifdef UNUSED + +The code below now longer works. First, t->Nodes == NULL, since +we now rely on the libgraph graph for data. Second, the code that +drew the distorted view was left out of the move from topview.c +to topviewfuncs.c. The magnifiers were cute but not particularly +useful, so we leave the feature out for now. + static double G(double x) { // distortion function for fisheye display @@ -184,6 +194,7 @@ void fisheye_spherical(double x_focus, double y_focus, double z_focus, } } } +#endif static v_data *makeGraph(Agraph_t* gg, int *nedges) { diff --git a/cmd/smyrna/topfisheyeview.h b/cmd/smyrna/topfisheyeview.h index b0f233669..888a6814b 100644 --- a/cmd/smyrna/topfisheyeview.h +++ b/cmd/smyrna/topfisheyeview.h @@ -23,9 +23,11 @@ extern "C" { #endif +#if 0 void fisheye_polar(double x_focus, double y_focus, topview * t); void fisheye_spherical(double x_focus, double y_focus, double z_focus, topview * t); +#endif void drawtopologicalfisheye(topview * t); void changetopfishfocus(topview * t, float *x, float *y, float *z, int num_foci); -- 2.40.0