]> granicus.if.org Git - graphviz/commitdiff
Remove broken magnifier code
authorerg <devnull@localhost>
Mon, 13 Sep 2010 22:24:20 +0000 (22:24 +0000)
committererg <devnull@localhost>
Mon, 13 Sep 2010 22:24:20 +0000 (22:24 +0000)
cmd/smyrna/draw.c
cmd/smyrna/draw.h
cmd/smyrna/glexpose.c
cmd/smyrna/topfisheyeview.c
cmd/smyrna/topfisheyeview.h

index 3c0bf54c425c5d7a4d2b32c198b4689304765f8e..ad9c56a8769e503027faca95bdddf0bd21b6c561 100755 (executable)
@@ -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)
 {
index d98ca3516e35a1f8180f53bb1b2d45392a83be37..25ec84b846c5d78ef477f58d9697df4be2b64ce2 100755 (executable)
@@ -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);
index 8f1f1c0b5fa0cc867fe5479dd22ff02768d81403..4afd90d6928fd5b4443e876b20c41248bb38fef8 100644 (file)
@@ -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();
index fd77c568ef850d0deb65786f62b561aebd8598a9..dafb821c011584657661304a5945568ad5e1eca6 100644 (file)
@@ -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)
 {
index b0f23366987c7fe37089f9ee64bd378d48719f2e..888a6814b72bcb1a80fd63a5e1dae6e8baa68efd 100644 (file)
 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);