]> granicus.if.org Git - graphviz/commitdiff
Remove outdated files
authorerg <devnull@localhost>
Fri, 5 Mar 2010 18:08:31 +0000 (18:08 +0000)
committererg <devnull@localhost>
Fri, 5 Mar 2010 18:08:31 +0000 (18:08 +0000)
cmd/smyrna/gui/beacon.c [deleted file]
cmd/smyrna/gui/beacon.h [deleted file]
cmd/smyrna/gui/glmenu.c [deleted file]
cmd/smyrna/gui/glmenu.h [deleted file]
cmd/smyrna/selection.c [deleted file]
cmd/smyrna/selection.h [deleted file]
cmd/smyrna/topview.c [deleted file]
cmd/smyrna/topview.h [deleted file]

diff --git a/cmd/smyrna/gui/beacon.c b/cmd/smyrna/gui/beacon.c
deleted file mode 100644 (file)
index 688c74f..0000000
+++ /dev/null
@@ -1,416 +0,0 @@
-/* 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 "beacon.h"
-#include "viewport.h"
-#include "selection.h"
-#include "gltemplate.h"
-#include "glutils.h"
-#include "toolboxcallbacks.h"
-#include "sfstr.h"
-
-static void print_object(void* obj);
-
-static int remove_edge_from_pick_list(topview_edge * e)
-{
-    int ind = 0;
-    int found = 0;
-    for (; ind < view->Topview->picked_edge_count; ind++) {
-       if ((view->Topview->picked_edges[ind] == e) && (!found))
-           found = 1;
-       if ((found) && (ind < (view->Topview->picked_edge_count - 1))) {
-           view->Topview->picked_edges[ind] =
-               view->Topview->picked_edges[ind + 1];
-       }
-    }
-    if (found) {
-       view->Topview->picked_edge_count--;
-       view->Topview->picked_edges =
-           realloc(view->Topview->picked_edges,
-                   sizeof(topview_edge *) *
-                   view->Topview->picked_edge_count);
-       deselect_edge(e);
-       return 1;
-    }
-    return 0;
-}
-
-static int add_edge_to_pick_list(topview_edge * e)
-{
-    view->Topview->picked_edge_count++;
-    view->Topview->picked_edges =
-       realloc(view->Topview->picked_edges,
-               sizeof(topview_edge *) * view->Topview->picked_edge_count);
-    view->Topview->picked_edges[view->Topview->picked_edge_count - 1] = e;
-    select_edge(e);
-    print_object((void*) e->Edge);     
-
-    return 1;
-}
-
-static int is_edge_picked(topview_edge * e)
-{
-    int ind = 0;
-    int found = 0;
-    for (; ind < view->Topview->picked_edge_count; ind++) {
-       if ((view->Topview->picked_edges[ind] == e) && (!found))
-           return 1;
-    }
-    return 0;
-}
-
-
-void pick_node_from_coords(float x, float y, float z)
-{
-    topview_node *n;
-    topview_node *sn;          /*selected node , closest node */
-    topview_edge *e;
-    topview_edge *se;          /*selected edge , closest one */
-    GLfloat closest_dif = 100000000;
-    GLfloat closest_dif2 = 100000000;
-    float a, b, c;
-    double d;
-    int ind;
-    int selnodes=atoi(agget(view->g[view->activeGraph],"nodesselectable"));
-    int seledges=atoi(agget(view->g[view->activeGraph],"edgesselectable"));
-    sn = (topview_node *) 0;
-    se = (topview_edge *) 0;
-
-    
-
-
-
-    for (ind = 0;( (selnodes)&&(ind < view->Topview->Nodecount)); ind++) {
-       n = &view->Topview->Nodes[ind];
-/*     if (!select_node(n))
-           break;*/
-
-
-       a = ABS(n->distorted_x - view->mouse.GLpos.x);
-       b = ABS(n->distorted_y - view->mouse.GLpos.y);
-       c = ABS(n->distorted_z - view->mouse.GLpos.z);
-       a = (float) pow((a * a + b * b + c * c), (float) 0.5);
-       if (a < closest_dif) {
-           sn = n;
-           closest_dif = a;
-       }
-    }
-
-    for (ind = 0; ((seledges)&&(ind < view->Topview->Edgecount)); ind++) {
-       glCompPoint p1, p2, p3;
-       e = &view->Topview->Edges[ind];
-       if (!e->data.Visible)
-           continue;
-
-       p1.x = e->Node1->distorted_x;
-       p1.y = e->Node1->distorted_y;
-       p1.z = e->Node1->distorted_z;
-
-       p2.x = e->Node2->distorted_x;
-       p2.y = e->Node2->distorted_y;
-       p2.z = e->Node2->distorted_z;
-
-       p3.x = view->mouse.GLpos.x;
-       p3.y = view->mouse.GLpos.y;
-       p3.z = view->mouse.GLpos.z;
-       d = point_to_lineseg_dist(p3, p1, p2);
-
-       if (d < closest_dif2) {
-           se = e;
-           closest_dif2 = d;
-       }
-    }
-
-    if ((closest_dif < closest_dif2 * 3) ) 
-    {
-       if (sn) {
-           if (!is_node_picked(sn))
-               add_to_pick_list(sn);
-           else
-               remove_from_pick_list(sn);
-       }
-    } else {
-       if (se) {
-           if (!is_edge_picked(se))
-               add_edge_to_pick_list(se);
-           else
-               remove_edge_from_pick_list(se);
-       }
-    }
-
-}
-
-
-
-
-
-
-
-/*int pick_node(topview_node * n)
-{
-    static int closest_dif = 3;
-       static char buf[512];
-       float a, b;
-       a = ABS(n->distorted_x - view->mouse.GLpos.x);
-    b = ABS(n->distorted_y - view->mouse.GLpos.y);
-    a = (float) pow((a * a + b * b), (float) 0.5);
-    if (a < closest_dif) {
-       if (!is_node_picked(n)) {
-           if (add_to_pick_list(n)) {
-               sprintf(buf,"Clicked node name:%s\n",agnameof(n->Node));
-               write_to_console(buf);
-               return 1;
-           }
-           return 0;
-       } else {
-           if (remove_from_pick_list(n)) {
-               return 1;
-           }
-           return 0;
-       }
-    }
-    return 0;
-
-}*/
-
-int is_node_picked(topview_node * n)
-{
-    int ind = 0;
-    int found = 0;
-    for (; ind < view->Topview->picked_node_count; ind++) {
-       if ((view->Topview->picked_nodes[ind] == n) && (!found))
-           return 1;
-    }
-    return 0;
-}
-
-int remove_from_pick_list(topview_node * n)
-{
-    int ind = 0;
-    int found = 0;
-    for (; ind < view->Topview->picked_node_count; ind++) {
-       if ((view->Topview->picked_nodes[ind] == n) && (!found))
-           found = 1;
-       if ((found) && (ind < (view->Topview->picked_node_count - 1))) {
-           view->Topview->picked_nodes[ind] =
-               view->Topview->picked_nodes[ind + 1];
-       }
-    }
-    if (found) {
-       view->Topview->picked_node_count--;
-       view->Topview->picked_nodes =
-           realloc(view->Topview->picked_nodes,
-                   sizeof(topview_node *) *
-                   view->Topview->picked_node_count);
-       deselect_node(n);
-       return 1;
-    }
-    return 0;
-}
-
-/*
-You can then use sf as you would FILE* for writing, but using sfio functions. For example,
-
-  sfprintf(sf, "<unknown (%d)>", op);
-
-You can write to your heart's content; sfio will take care of memory. 
-When you are ready to use the
-string, call
-
-  char* ptr = sfstruse(sf);
-
-This adds a '\0'-byte at the end and returns a pointer to the beginning of the buffer. This also resets the write pointer, so you can use sf over again. Note, therefore, that this means you don't want to call sfstruse(sf) twice, as the second time will put a '\0' at the beginning of the buffer.
-
-Once you have ptr set, you can use it to insert the character string into the console window.
-
-To clean up, call
-
-  sfclose (sf);
-
-This codes requires the vmalloc, ast, and sfio libraries, but these are already being loaded because gvpr needs them.
-*/
-
-static void print_object(void* obj)
-{
-    static Sfio_t *sf;
-    int ind=0;
-    char* val;
-    char* str;
-    attr_list* l=view->Topview->attributes;
-    if (!sf)
-               sf= sfstropen();
-    if(AGTYPE(obj)==AGNODE)
-       sfprintf(sf,"Node Summary\n");
-    if(AGTYPE(obj)==AGEDGE)
-       sfprintf(sf,"Edge Summary\n");
-    sfprintf(sf,"-------------\n");
-    sfprintf(sf,"name: %s\n",agnameof(obj));
-    for (;ind < l->attr_count;ind ++)
-    {
-       if(l->attributes[ind]->propagate)
-       {
-           val=agget(obj,l->attributes[ind]->name);
-           if (val)
-           {
-               sfprintf(sf,"%s:%s\n",l->attributes[ind]->name,val);
-
-           }
-       }
-    }
-    sfprintf(sf,"-------------\n");
-    str=sfstruse(sf);
-    append_textview((GtkTextView *)glade_xml_get_widget(xml, "mainconsole"), str, strlen(str));
-
-
-}
-
-int add_to_pick_list(topview_node * n)
-{
-    view->Topview->picked_node_count++;
-    view->Topview->picked_nodes =
-       realloc(view->Topview->picked_nodes,
-               sizeof(topview_node *) * view->Topview->picked_node_count);
-    view->Topview->picked_nodes[view->Topview->picked_node_count - 1] = n;
-    select_node(n);
-    print_object((void*) n->Node);     
-    return 1;
-}
-
-
-
-
-
-
-
-int draw_node_hint_boxes(void)
-{
-    int ind;
-    float del = 0.01;
-    float fs = GetOGLDistance(12);
-    char *lbl;
-    topview_node *n;
-    topview_edge *e;
-    double dx, dy, dz;
-    char buf[512];             /* FIX!!! static buffer */
-
-//    view->widgets->fontset->fonts[view->widgets->fontset->activefont]->fontheight=fs;
-
-
-    for (ind = 0; ind < view->Topview->picked_node_count; ind++) {
-       n = view->Topview->picked_nodes[ind];
-       lbl = agget(n->Node, "hint");
-       if ((!lbl) || (strlen(lbl) == 0))
-           lbl = agnameof(n->Node);
-       dx = n->distorted_x;
-       dy = n->distorted_y;
-       dz = n->distorted_z + 0.001;
-
-
-       /*blue font color */
-       glColor4f(0, 0, 1, 1);
-       glprintfglut(GLUT_BITMAP_HELVETICA_12, dx, dy, dz + del, "[");
-       glprintfglut(GLUT_BITMAP_HELVETICA_12, dx,
-                    (dy + fs + fs / (GLfloat) 5.0), dz + del, lbl);
-//              glprintfglut (GLUT_BITMAP_HELVETICA_12, dx,(dy+fs+fs/(GLfloat)5.0),dz,"aaaaaaaa");
-//              ffs=(dy+fs+fs/(GLfloat)5.0)-GetOGLDistance(14)/view->zoom*-1;
-//              glprintfglut (GLUT_BITMAP_HELVETICA_12, dx,ffs,dz,"bbbbbbbbbb");
-
-#if UNUSED
-       char *buf;
-       char *nc;
-       buf = malloc(sizeof(char) * 512);
-       if (!bf)
-           return;
-       if (strlen(bf) > 512)
-           return;
-       strcpy(buf, bf);
-       nc = buf;
-
-       for (nc; *nc != NULL; nc++) {
-           if (*nc == '\n') {
-               int a = glutBitmapWidth(font, buf);
-               *nc = NULL;
-               glRasterPos3f(xpos, ypos, zpos + 0.001);
-               print_bitmap_string(font, buf);
-               nc++;
-               buf = nc;
-               ypos = ypos - 14.00;
-           }
-       }
-       glRasterPos3f(xpos, ypos, zpos + 0.001);
-       print_bitmap_string(font, buf);
-#endif
-
-    }
-    glColor4f(0, 1, 0, 0.5);
-    glLineWidth(2);
-/*    glBegin(GL_LINES);
-    for (ind = 0; ind < view->Topview->picked_edge_count; ind++) {
-       float x1, x2, y1, y2, z1, z2;
-       e = view->Topview->picked_edges[ind];
-       x1 = e->Node1->distorted_x;
-       x2 = e->Node2->distorted_x;
-       y1 = e->Node1->distorted_y;
-       y2 = e->Node2->distorted_y;
-       z1 = e->Node1->distorted_z;
-       z2 = e->Node2->distorted_z;
-
-       dx = (x1 + x2) / 2.0;
-       dy = (y1 + y2) / 2.0;
-       dz = (z1 + z2) / 2.0;
-
-
-       glVertex3f(x1, y1, z1);
-       glVertex3f(x2, y2, z2);
-
-
-    }
-    glEnd();*/
-    glLineWidth(1);
-    for (ind = 0; ind < view->Topview->picked_edge_count; ind++) {
-       float x1, x2, y1, y2, z1, z2;
-       char *s;
-       glColor4f(0, 1, 0, 0.5);
-       e = view->Topview->picked_edges[ind];
-       x1 = e->Node1->distorted_x;
-       x2 = e->Node2->distorted_x;
-       y1 = e->Node1->distorted_y;
-       y2 = e->Node2->distorted_y;
-       z1 = e->Node1->distorted_z;
-       z2 = e->Node2->distorted_z;
-       if ((s = agget(e->Edge, "hint")) && s[0])
-           strcpy(buf, s);
-       else {
-           strcpy(buf, agnameof(e->Node1->Node));
-           strcat(buf, " - ");
-           strcat(buf, agnameof(e->Node2->Node));
-       }
-       dx = (x1 + x2) / 2.0;
-       dy = (y1 + y2) / 2.0;
-       dz = (z1 + z2) / 2.0;
-
-
-
-       glColor4f(0, 0, 1, 1);
-
-       /*blue font color */
-       glprintfglut(GLUT_BITMAP_HELVETICA_12, dx, dy, dz + del, "|");
-       glprintfglut(GLUT_BITMAP_HELVETICA_12, dx,
-                    (dy + fs + fs / (GLfloat) 5.0), dz + del, buf);
-    }
-
-
-    return 1;
-}
diff --git a/cmd/smyrna/gui/beacon.h b/cmd/smyrna/gui/beacon.h
deleted file mode 100644 (file)
index 2f0a18a..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* $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             *
-**********************************************************/
-
-#ifndef BEACON_H
-#define BEACON_H
-#include "smyrnadefs.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    extern int pick_node(topview_node * n);
-    extern int is_node_picked(topview_node * n);
-    extern int remove_from_pick_list(topview_node * n);
-    extern int add_to_pick_list(topview_node * n);
-    extern int draw_node_hint_boxes(void);
-    extern void pick_node_from_coords(float x, float y, float z);
-
-#ifdef __cplusplus
-}                              /* end extern "C" */
-#endif
-#endif
diff --git a/cmd/smyrna/gui/glmenu.c b/cmd/smyrna/gui/glmenu.c
deleted file mode 100644 (file)
index 0b49921..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/* $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 "glmenu.h"
-#include "gltemplate.h"
-/*
-       creates the right click menu for open gl canvas
-       params:gtk widget to assign menu
-       return value:gtkmenu itself
-*/
-GtkWidget *create_popup_menu(GtkWidget * drawing_area)
-{
-    GtkWidget *actions_menu;
-    GtkWidget *editing_menu;
-    GtkWidget *menu;
-    GtkWidget *menu_item;
-    int mm = 0;
-    /*actions sub menu */
-    //PAN   
-
-    mm = MM_PAN;
-    actions_menu = gtk_menu_new();
-    menu_item = gtk_menu_item_new_with_label("Pan");
-    gtk_menu_shell_append(GTK_MENU_SHELL(actions_menu), menu_item);
-    g_signal_connect(G_OBJECT(menu_item), "activate",
-                    G_CALLBACK(switch_Mouse), (gpointer) & mm);
-    gtk_widget_show(menu_item);
-/**********/
-    //ZOOM
-    mm = MM_ZOOM;
-    menu_item = gtk_menu_item_new_with_label("Zoom");
-    gtk_menu_shell_append(GTK_MENU_SHELL(actions_menu), menu_item);
-    g_signal_connect(G_OBJECT(menu_item), "activate",
-                    G_CALLBACK(switch_Mouse), (gpointer) & mm);
-    gtk_widget_show(menu_item);
-/**********/
-    //ROTATE
-    mm = MM_ROTATE;
-    menu_item = gtk_menu_item_new_with_label("rotate");
-    gtk_menu_shell_append(GTK_MENU_SHELL(actions_menu), menu_item);
-    g_signal_connect(G_OBJECT(menu_item), "activate",
-                    G_CALLBACK(switch_Mouse), (gpointer) & mm);
-    gtk_widget_show(menu_item);
-/**********/
-/**********/
-    //Single Select
-    mm = MM_SINGLE_SELECT;
-    menu_item = gtk_menu_item_new_with_label("select");
-    gtk_menu_shell_append(GTK_MENU_SHELL(actions_menu), menu_item);
-    g_signal_connect(G_OBJECT(menu_item), "activate",
-                    G_CALLBACK(switch_Mouse), (gpointer) & mm);
-    gtk_widget_show(menu_item);
-/**********/
-    //Rectangle Select
-    mm = MM_RECTANGULAR_SELECT;
-    menu_item = gtk_menu_item_new_with_label("rect select");
-    gtk_menu_shell_append(GTK_MENU_SHELL(actions_menu), menu_item);
-    g_signal_connect(G_OBJECT(menu_item), "activate",
-                    G_CALLBACK(switch_Mouse), (gpointer) & mm);
-    gtk_widget_show(menu_item);
-/**********/
-/**********/
-    //Rectangle -x Select
-    mm = MM_RECTANGULAR_X_SELECT;
-    menu_item = gtk_menu_item_new_with_label("rect-x select");
-    gtk_menu_shell_append(GTK_MENU_SHELL(actions_menu), menu_item);
-    g_signal_connect(G_OBJECT(menu_item), "activate",
-                    G_CALLBACK(switch_Mouse), (gpointer) & mm);
-    gtk_widget_show(menu_item);
-/**********/
-/**********/
-    //Move
-    mm = MM_MOVE;
-    menu_item = gtk_menu_item_new_with_label("Move");
-    gtk_menu_shell_append(GTK_MENU_SHELL(actions_menu), menu_item);
-    g_signal_connect(G_OBJECT(menu_item), "activate",
-                    G_CALLBACK(switch_Mouse), (gpointer) & mm);
-    gtk_widget_show(menu_item);
-/**********/
-    //activate magnifier
-    mm = MM_MAGNIFIER;         //magnifier ,fisheye etc starts at 20
-    menu_item = gtk_menu_item_new_with_label("Magnifier");
-    gtk_menu_shell_append(GTK_MENU_SHELL(actions_menu), menu_item);
-    g_signal_connect(G_OBJECT(menu_item), "activate",
-                    G_CALLBACK(switch_Mouse), (gpointer) & mm);
-    gtk_widget_show(menu_item);
-/**********/
-    //activate fisheye magnifier
-    mm = MM_FISHEYE_MAGNIFIER;
-    menu_item = gtk_menu_item_new_with_label("Fisheye Magnifier");
-    gtk_menu_shell_append(GTK_MENU_SHELL(actions_menu), menu_item);
-    g_signal_connect(G_OBJECT(menu_item), "activate",
-                    G_CALLBACK(switch_Mouse), (gpointer) & mm);
-    gtk_widget_show(menu_item);
-/**********/
-    editing_menu = gtk_menu_new();
-    /* NODE */
-    menu_item = gtk_menu_item_new_with_label("Node");
-    gtk_menu_shell_append(GTK_MENU_SHELL(editing_menu), menu_item);
-    gtk_widget_show(menu_item);
-
-    /* EDGE */
-    menu_item = gtk_menu_item_new_with_label("Edge");
-    gtk_menu_shell_append(GTK_MENU_SHELL(editing_menu), menu_item);
-    gtk_widget_show(menu_item);
-
-
-    menu = gtk_menu_new();
-
-    /* Actions */
-    menu_item = gtk_menu_item_new_with_label("Mouse");
-    gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), actions_menu);
-    gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
-    gtk_widget_show(menu_item);
-
-    /* NEW */
-    menu_item = gtk_menu_item_new_with_label("New");
-    gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), editing_menu);
-    gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
-    gtk_widget_show(menu_item);
-
-    /* Quit */
-    menu_item = gtk_menu_item_new_with_label("Quit");
-    gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
-    g_signal_connect(G_OBJECT(menu_item), "activate",
-                    G_CALLBACK(gtk_main_quit), NULL);
-    gtk_widget_show(menu_item);
-    return menu;
-}
diff --git a/cmd/smyrna/gui/glmenu.h b/cmd/smyrna/gui/glmenu.h
deleted file mode 100644 (file)
index 34fc4aa..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* 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             *
-**********************************************************/
-
-#ifndef GLMENU_H
-#define GLMENU_H
-
-#include "viewport.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    GtkWidget *create_popup_menu(GtkWidget * drawing_area);
-
-#ifdef __cplusplus
-}                              /* end extern "C" */
-#endif
-#endif
diff --git a/cmd/smyrna/selection.c b/cmd/smyrna/selection.c
deleted file mode 100755 (executable)
index e8354eb..0000000
+++ /dev/null
@@ -1,792 +0,0 @@
-/* $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 "selection.h"
-#include "viewport.h"
-#include "geomprocs.h"
-#include "memory.h"
-
-#ifdef UNUSED
-static int rectintersects(float x, float y, float W, float H)
-{
-    //returns 1 if rect is completely in the clip rect
-    //0 if they intersect
-    //-1 if completely out
-
-    int s[4];
-    s[0] = (((x >= view->Selection.X)
-            && (x <= (view->Selection.X + view->Selection.W)))) ? 1 : 0;
-    s[1] = ((((x + W) >= view->Selection.X)
-            && ((x + W) <=
-                (view->Selection.X + view->Selection.W)))) ? 1 : 0;
-
-    s[2] = (((y >= view->Selection.Y)
-            && (y <= (view->Selection.Y + view->Selection.H)))) ? 1 : 0;
-    s[3] = ((((y + H) >= view->Selection.Y)
-            && ((y + H) <=
-                (view->Selection.Y + view->Selection.H)))) ? 1 : 0;
-
-
-    if (s[0] && s[1] && s[2] && s[3])
-       return 1;
-    if (s[0] || s[1] || s[2] || s[3])
-       return 0;
-    return -1;
-
-}
-static int within_bezier(GLfloat * xp, GLfloat * yp, GLfloat * zp, int isx)
-{
-    double Ax = xp[0];
-    double Ay = yp[0];
-    double Az = zp[0];
-    double Bx = xp[1];
-    double By = yp[1];
-    double Bz = zp[1];
-    double Cx = xp[2];
-    double Cy = yp[2];
-    double Cz = zp[2];
-    double Dx = xp[3];
-    double Dy = yp[3];
-    double Dz = zp[3];
-    double X;
-    double Y;
-    double Z;
-    double Xprev;
-    double Yprev;
-    double Zprev;
-    int i = 0;                 //loop index
-    // Variable
-    double a = 1.0;
-    double b = 1.0 - a;
-    for (i = 0; i <= 20; i++) {
-       // Get a point on the curve
-       X = Ax * a * a * a + Bx * 3 * a * a * b + Cx * 3 * a * b * b +
-           Dx * b * b * b;
-       Y = Ay * a * a * a + By * 3 * a * a * b + Cy * 3 * a * b * b +
-           Dy * b * b * b;
-       Z = Az * a * a * a + Bz * 3 * a * a * b + Cz * 3 * a * b * b +
-           Dz * b * b * b;
-       if (i > 0) {
-           if (lineintersects((float) Xprev, (float) X, (float) Yprev, (float) Y) >= 0)        //intersection
-           {
-               if (isx)
-                   return 1;
-           }
-           if (!(lineintersects((float) Xprev, (float) X, (float) Yprev, (float) Y) == 1))     //withing the rect
-           {
-               if (!isx)
-                   return 0;
-           }
-       }
-       Xprev = X;
-       Yprev = Y;
-       Zprev = Z;
-
-       a -= 0.05;
-       b = 1.0 - a;
-    }
-    if (isx)
-       return 0;
-    else
-       return 1;
-
-}
-#endif
-
-#ifdef UNUSED
-static int spline_in_rect(xdot_op * op)
-{
-    //JUST SEND ALL CONTROL POINTS IN 3D ARRAYS
-    float tempX[4];
-    float tempY[4];
-    float tempZ[4];
-    int temp = 0;
-    int i = 0;
-    for (i = 0; i < op->u.bezier.cnt; i = i + 1) {
-       if (temp == 4) {
-           if (!within_bezier(tempX, tempY, tempZ, 0))
-               return 0;
-           tempX[0] = (float) op->u.bezier.pts[i - 1].x;
-           tempY[0] = (float) op->u.bezier.pts[i - 1].y;
-           tempZ[0] = (float) op->u.bezier.pts[i - 1].z;
-           temp = 1;
-           tempX[temp] = (float) op->u.bezier.pts[i].x;
-           tempY[temp] = (float) op->u.bezier.pts[i].y;
-           tempZ[temp] = (float) op->u.bezier.pts[i].z;
-           temp = temp + 1;
-       } else {
-           tempX[temp] = (float) op->u.bezier.pts[i].x;
-           tempY[temp] = (float) op->u.bezier.pts[i].y;
-           tempZ[temp] = (float) op->u.bezier.pts[i].z;
-           temp = temp + 1;
-       }
-    }
-    if (!within_bezier(tempX, tempY, tempZ, 0))
-       return 0;
-    else
-       return 1;
-}
-static int spline_x_rect(xdot_op * op)
-{
-    //JUST SEND ALL CONTROL POINTS IN 3D ARRAYS
-    float tempX[4];
-    float tempY[4];
-    float tempZ[4];
-    int temp = 0;
-    int i = 0;
-    for (i = 0; i < op->u.bezier.cnt; i = i + 1) {
-       if (temp == 4) {
-           if (within_bezier(tempX, tempY, tempZ, 1))
-               return 1;
-           tempX[0] = (float) op->u.bezier.pts[i - 1].x;
-           tempY[0] = (float) op->u.bezier.pts[i - 1].y;
-           tempZ[0] = (float) op->u.bezier.pts[i - 1].z;
-           temp = 1;
-           tempX[temp] = (float) op->u.bezier.pts[i].x;
-           tempY[temp] = (float) op->u.bezier.pts[i].y;
-           tempZ[temp] = (float) op->u.bezier.pts[i].z;
-           temp = temp + 1;
-       } else {
-           tempX[temp] = (float) op->u.bezier.pts[i].x;
-           tempY[temp] = (float) op->u.bezier.pts[i].y;
-           tempZ[temp] = (float) op->u.bezier.pts[i].z;
-           temp = temp + 1;
-       }
-    }
-    if (within_bezier(tempX, tempY, tempZ, 1))
-       return 1;
-    else
-       return 0;
-}
-static int polygon_in_rect(xdot_op * op)
-{
-    int ind = 0;
-    for (ind = 0; ind < op->u.polygon.cnt - 1; ind++) {
-       if (lineintersects
-           ((float) op->u.polygon.pts[ind].x,
-            (float) op->u.polygon.pts[ind + 1].x,
-            (float) op->u.polygon.pts[ind].y,
-            (float) op->u.polygon.pts[ind + 1].y) != 1)
-           return 0;
-    };
-    return 1;
-}
-static int polygon_x_rect(xdot_op * op)
-{
-    int ind = 0;
-    for (ind = 0; ind < op->u.polygon.cnt - 1; ind++) {
-       if (lineintersects
-           ((float) op->u.polygon.pts[ind].x,
-            (float) op->u.polygon.pts[ind + 1].x,
-            (float) op->u.polygon.pts[ind].y,
-            (float) op->u.polygon.pts[ind + 1].y) >= 0)
-           return 1;
-    };
-    return 0;
-}
-static int polyline_in_rect(xdot_op * op)
-{
-    int ind = 0;
-    for (ind = 0; ind < op->u.polygon.cnt - 1; ind++) {
-       if (lineintersects
-           ((float) op->u.polygon.pts[ind].x,
-            (float) op->u.polygon.pts[ind + 1].x,
-            (float) op->u.polygon.pts[ind].y,
-            (float) op->u.polygon.pts[ind + 1].y) != 1)
-           return 0;
-    };
-    return 1;
-}
-static int polyline_x_rect(xdot_op * op)
-{
-    int ind = 0;
-    for (ind = 0; ind < op->u.polygon.cnt - 1; ind++) {
-       if (lineintersects
-           ((float) op->u.polygon.pts[ind].x,
-            (float) op->u.polygon.pts[ind + 1].x,
-            (float) op->u.polygon.pts[ind].y,
-            (float) op->u.polygon.pts[ind + 1].y) >= 1)
-           return 1;
-    };
-    return 0;
-}
-static int text_in_rect(sdot_op * sop)
-{
-    xdot_op *op = &(sop->op);
-    if (rectintersects
-       ((float) op->u.text.x, (float) op->u.text.y,
-        (float) op->u.text.x + op->u.text.width,
-        (float) op->u.text.y + (float) sop->size) == 1)
-       return 1;
-    return 0;
-
-}
-static int text_x_rect(sdot_op * sop)
-{
-    xdot_op *op = &(sop->op);
-    if (rectintersects
-       ((float) op->u.text.x, (float) op->u.text.y,
-        (float) op->u.text.x + op->u.text.width,
-        (float) op->u.text.y + (float) sop->size) >= 1)
-       return 1;
-    return 0;
-
-}
-static int image_in_rect(xdot_op * op)
-{
-    if (rectintersects
-       ((float) op->u.image.pos.x, (float) op->u.image.pos.y,
-        (float) op->u.image.pos.w, (float) op->u.image.pos.h) == 1)
-       return 1;
-    return 0;
-}
-static int image_x_rect(xdot_op * op)
-{
-    if (rectintersects
-       ((float) op->u.image.pos.x, (float) op->u.image.pos.y,
-        (float) op->u.image.pos.w, (float) op->u.image.pos.h) >= 0)
-       return 1;
-    return 0;
-}
-
-
-static int ellipse_x_rect(xdot_op * op)
-{
-    float x, y, xradius, yradius;
-
-    double Xprev;
-    double Yprev;
-    double Zprev;
-
-    int i = 0;
-    x = (float) op->u.ellipse.x;
-    y = (float) op->u.ellipse.y;
-    xradius = (float) op->u.ellipse.w;
-    yradius = (float) op->u.ellipse.h;
-    for (i = 0; i < 360; i = i + 1) {
-       //convert degrees into radians
-       float degInRad = i * (float) DEG2RAD;
-       if (i > 0) {
-           if (lineintersects((float) Xprev, x + (float) cos(degInRad) * xradius, (float) Yprev, y + (float) sin(degInRad) * yradius) >= 0)    //intersection
-               return 1;
-       }
-
-       Xprev = x + cos(degInRad) * xradius;
-       Yprev = y + sin(degInRad) * yradius;
-       Zprev = 0;
-    }
-    return 0;
-}
-
-static int ellipse_in_rect(xdot_op * op)
-{
-    float x, y, xradius, yradius;
-
-    double Xprev;
-    double Yprev;
-    double Zprev;
-
-    int i = 0;
-    x = (float) op->u.ellipse.x;
-    y = (float) op->u.ellipse.y;
-    xradius = (float) op->u.ellipse.w;
-    yradius = (float) op->u.ellipse.h;
-    for (i = 0; i < 360; i = i + 1) {
-       //convert degrees into radians
-       float degInRad = (float) i * (float) DEG2RAD;
-       if (i > 0) {
-           if (!(lineintersects((float) Xprev, (float) x + (float) cos(degInRad) * xradius, (float) Yprev, y + (float) sin(degInRad) * yradius) == 1)) //withing the rect
-               return 0;
-       }
-
-       Xprev = x + cos(degInRad) * xradius;
-       Yprev = y + sin(degInRad) * yradius;
-       Zprev = 0;
-    }
-    return 1;
-}
-
-static int point_within_ellipse(xdot_op * op)
-{
-
-    float dx, dy, ex, ey, ea, eb, px, py;
-    float a;
-
-    ex = (float) op->u.ellipse.x;
-    ey = (float) op->u.ellipse.y;
-    ea = (float) op->u.ellipse.w;
-    eb = (float) op->u.ellipse.h;
-    px = view->Selection.X + (float) SINGLE_SELECTION_WIDTH / (float) 2;
-    py = view->Selection.Y + (float) SINGLE_SELECTION_WIDTH / (float) 2;
-    dx = px - ex;
-    dy = py - ey;
-    a = (dx * dx) / (ea * ea) + (dy * dy) / (eb * eb);
-    return (a <= 1);
-}
-
-static int point_within_polygon(xdot_op * op)
-//int pnpoly(int npol, float *xp, float *yp, float x, float y)
-{
-    int i, j, c = 0;
-    int npol = op->u.polygon.cnt;
-    float x, y;
-#ifdef UNUSED
-// FIX
-    op->u.polygon.pts[i].y;
-    op->u.polygon.pts[i].x;
-#endif
-    x = view->Selection.X + SINGLE_SELECTION_WIDTH / 2;
-    y = view->Selection.Y + SINGLE_SELECTION_WIDTH / 2;
-
-    for (i = 0, j = npol - 1; i < npol; j = i++) {
-       if ((((op->u.polygon.pts[i].y <= y)
-             && (y < op->u.polygon.pts[j].y))
-            || ((op->u.polygon.pts[j].y <= y)
-                && (y < op->u.polygon.pts[i].y)))
-           && (x <
-               (op->u.polygon.pts[j].x - op->u.polygon.pts[i].x) * (y -
-                                                                    op->u.
-                                                                    polygon.
-                                                                    pts
-                                                                    [i].
-                                                                    y) /
-               (op->u.polygon.pts[j].y - op->u.polygon.pts[i].y) +
-               op->u.polygon.pts[i].x))
-           c = !c;
-    }
-    return c;
-}
-#endif
-
-//select functions
-
-static Agsym_t *getNodeSelectedAttr(Agraph_t * g)
-{
-    static Agraph_t *saveg;
-    static Agsym_t *saveattr;
-
-    if (saveg != g) {
-       saveg = g;
-       if (!(saveattr = agattr(saveg, AGNODE, "selected", 0))) {
-           saveattr = agattr(saveg, AGNODE, "selected", "0");
-       }
-    }
-    return saveattr;
-}
-
-static Agsym_t *getEdgeSelectedAttr(Agraph_t * g)
-{
-    static Agraph_t *saveg;
-    static Agsym_t *saveattr;
-
-    if (saveg != g) {
-       saveg = g;
-       if (!(saveattr = agattr(saveg, AGEDGE, "selected", 0))) {
-           saveattr = agattr(saveg, AGEDGE, "selected", "0");
-       }
-    }
-    return saveattr;
-}
-
-int select_node(topview_node * N)
-{
-    Agsym_t *a = getNodeSelectedAttr(N->Node->root);
-
-    N->data.Selected = 1;
-    return agxset(N->Node, a, "1");
-}
-
-int select_edge(topview_edge * E)
-{
-    Agsym_t *a = getEdgeSelectedAttr(aghead(E->Edge)->root);
-
-    E->data.Selected = 1;
-    return agxset(E->Edge, a, "1");
-}
-
-int deselect_node(topview_node * N)
-{
-    Agsym_t *a = getNodeSelectedAttr(N->Node->root);
-
-    N->data.Selected = 0;
-    return agxset(N->Node, a, "0");
-}
-
-int deselect_edge(topview_edge * E)
-{
-    Agsym_t *a = getEdgeSelectedAttr(aghead(E->Edge)->root);
-
-    E->data.Selected = 0;
-    return agxset(E->Edge, a, "0");
-}
-
-#if UNUSED
-static void update_cgraph_pos(topview_node * N)
-{
-    char buf[512];
-    Agsym_t *pos;
-    Agnode_t *obj = N->Node;
-
-    if ((pos = agattrsym(obj, "pos"))) {
-       sprintf(buf, "%lf,%lf", N->distorted_x, N->distorted_y);
-       agxset(obj, pos, buf);
-    }
-}
-#endif
-
-int select_all_nodes(Agraph_t * g)
-{
-    int ind = 0;
-    //check if in the list
-    for (ind = 0; ind < view->Topview->Nodecount; ind++) {
-       select_node(&view->Topview->Nodes[ind]);
-    }
-    return 1;
-}
-
-int select_all_edges(Agraph_t * g)
-{
-    int ind = 0;
-    //check if in the list
-    for (ind = 0; ind < view->Topview->Edgecount; ind++) {
-       select_edge(&view->Topview->Edges[ind]);
-    }
-    return 1;
-
-}
-
-
-int deselect_all_nodes(Agraph_t * g)
-{
-    int ind = 0;
-    //check if in the list
-    for (ind = 0; ind < view->Topview->Nodecount; ind++) {
-       deselect_node(&view->Topview->Nodes[ind]);
-    }
-    return 1;
-
-}
-
-int deselect_all_edges(Agraph_t * g)
-{
-    int ind = 0;
-    //check if in the list
-    for (ind = 0; ind < view->Topview->Edgecount; ind++) {
-       deselect_edge(&view->Topview->Edges[ind]);
-    }
-    return 1;
-
-}
-
-int select_all(Agraph_t * g)
-{
-    select_all_nodes(g);
-    select_all_edges(g);
-    return 1;
-
-}
-
-int deselect_all(Agraph_t * g)
-{
-    deselect_all_nodes(g);
-    deselect_all_edges(g);
-    return 1;
-
-}
-
-
-int lineintersects(float X1, float X2, float Y1, float Y2)
-{
-    //line segment
-    //X1,Y1 point 1
-    //X2,Y3 point 2
-    //rectangle
-    //RX,RY lower left corner of rectangle
-    //RW width of rectangle
-    //RH height of ractangle
-    //returns 1 if line segment is completely in the rect
-    //0 if they intersect
-    //-1 if completely out
-    float x, y, m, iter;
-    float RX, RY, RW, RH;
-    int intersects, in;
-    RX = view->Selection.X;
-    RY = view->Selection.Y;
-    RH=view->Selection.H;
-    RW=view->Selection.W;
-    if ((is_point_in_rectangle(X1, Y1, RX, RY, RW, RH))
-       && (is_point_in_rectangle(X2, Y2, RX, RY, RW, RH)))
-       return 1;
-    if ((is_point_in_rectangle(X1, Y1, RX, RY, RW, RH))
-       || (is_point_in_rectangle(X2, Y2, RX, RY, RW, RH)))
-       return 0;
-    //to be absolute or not to be one
-    if (X1 > X2) {
-       x = X2;
-       y = Y2;
-       X2 = X1;
-       Y2 = Y1;
-       X1 = x;
-       Y1 = y;
-    }
-    x = X1;
-    //iter
-    iter = RW / (float) SELECTION_SEGMENT_DIVIDER;
-    m = (Y2 - Y1) / (X2 - X1);
-
-    in = 1;
-    intersects = 0;
-    while (x <= X2) {
-       x = x + iter;
-       y = Y1 + m * (x - X1);
-       if (!is_point_in_rectangle(x, y, RX, RY, RW, RH))
-           in = 0;
-       else
-           intersects = 1;
-
-    }
-    if (in == 1)
-       return 1;
-    if (intersects == 1)
-       return 0;
-    return -1;
-}
-
-
-
-static void select_topview_node(topview_node * n)
-{
-    static float x1,y1,x2,y2,x,y;
-    x=n->distorted_x;
-    y=n->distorted_y;
-    if(view->mouse.GLfinalPos.x > view->mouse.GLinitPos.x)
-    {
-        x1=view->mouse.GLinitPos.x;
-       x2=view->mouse.GLfinalPos.x;
-    }
-    else
-    {
-        x2=view->mouse.GLinitPos.x;
-       x1=view->mouse.GLfinalPos.x;
-
-    }
-    if(view->mouse.GLfinalPos.y > view->mouse.GLinitPos.y)
-    {
-        y1=view->mouse.GLinitPos.y;
-       y2=view->mouse.GLfinalPos.y;
-    }
-    else
-    {
-        y2=view->mouse.GLinitPos.y;
-       y1=view->mouse.GLfinalPos.y;
-    }
-    if(is_point_in_rectangle(x,y,x1,y1,x2-x1,y2-y1))
-    {
-        agset(n->Node,"selected","1");
-       n->data.Selected=1;
-    }
-}
-
-static void select_topview_edge(topview_edge* e)
-{
-    static float x1,y1,x2,y2,n1x,n1y,n2x,n2y;
-    n1x=e->Node1->distorted_x;
-    n1y=e->Node1->distorted_y;
-    n2x=e->Node2->distorted_x;
-    n2y=e->Node2->distorted_y;
-    if(view->mouse.GLfinalPos.x > view->mouse.GLinitPos.x)
-    {
-        x1=view->mouse.GLinitPos.x;
-       x2=view->mouse.GLfinalPos.x;
-    }
-    else
-    {
-        x2=view->mouse.GLinitPos.x;
-       x1=view->mouse.GLfinalPos.x;
-
-    }
-    if(view->mouse.GLfinalPos.y > view->mouse.GLinitPos.y)
-    {
-        y1=view->mouse.GLinitPos.y;
-       y2=view->mouse.GLfinalPos.y;
-    }
-    else
-    {
-        y2=view->mouse.GLinitPos.y;
-       y1=view->mouse.GLfinalPos.y;
-    }
-    if((is_point_in_rectangle(n1x,n1y,x1,y1,x2-x1,y2-y1))
-       &&
-       (is_point_in_rectangle(n2x,n2y,x1,y1,x2-x1,y2-y1)) )
-    {
-       agset(e->Edge,"selected","1");
-       e->data.Selected=1;
-    }
-}
-
-static void node_rectangle_select(ViewInfo* v)
-{
-    int ind;
-    topview_node* n;
-   
-    for (ind = 0; ind < v->Topview->Nodecount; ind++) 
-    {
-       n = v->Topview->Nodes + ind;
-       select_topview_node(n);
-    }
-
-}
-static void edge_rectangle_select(ViewInfo* v)
-{
-    int ind;
-    topview_edge* e;
-   
-    for (ind = 0; ind < v->Topview->Edgecount; ind++) 
-    {
-       e = v->Topview->Edges + ind;
-       select_topview_edge(e);
-    }
-
-}
-void rectangle_select(ViewInfo* v)
-{
-    int selnodes=atoi(agget(view->g[view->activeGraph],"nodesselectable"));
-    int seledges=atoi(agget(view->g[view->activeGraph],"edgesselectable"));
-    if(selnodes)
-       node_rectangle_select(v);
-    if(seledges)
-        edge_rectangle_select(v);
-}
-int linesegmentsintersects(float X1, float X2, float Y1, float Y2)
-{
-    //line segment
-    //X1,Y1 point 1
-    //X2,Y3 point 2
-    //rectangle
-    //RX,RY lower left corner of rectangle
-    //RW width of rectangle
-    //RH height of ractangle
-    //returns 1 if line segment is completely in the rect
-    //0 if they intersect
-    //-1 if completely out
-    float x, y, m, iter;
-    float RX, RY, RW, RH;
-    int intersects, in;
-    RX = view->Selection.X;
-    RY = view->Selection.Y;
-    RH=view->Selection.H;
-    RW=view->Selection.W;
-    if ((is_point_in_rectangle(X1, Y1, RX, RY, RW, RH))
-       && (is_point_in_rectangle(X2, Y2, RX, RY, RW, RH)))
-       return 1;
-    if ((is_point_in_rectangle(X1, Y1, RX, RY, RW, RH))
-       || (is_point_in_rectangle(X2, Y2, RX, RY, RW, RH)))
-       return 0;
-    //to be absolute or not to be one
-    if (X1 > X2) {
-       x = X2;
-       y = Y2;
-       X2 = X1;
-       Y2 = Y1;
-       X1 = x;
-       Y1 = y;
-    }
-    x = X1;
-    //iter
-    iter = RW / (float) SELECTION_SEGMENT_DIVIDER;
-    m = (Y2 - Y1) / (X2 - X1);
-
-    in = 1;
-    intersects = 0;
-    while (x <= X2) {
-       x = x + iter;
-       y = Y1 + m * (x - X1);
-       if (!is_point_in_rectangle(x, y, RX, RY, RW, RH))
-           in = 0;
-       else
-           intersects = 1;
-
-    }
-    if (in == 1)
-       return 1;
-    if (intersects == 1)
-       return 0;
-    return -1;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-int point_within_ellips_with_coords(float ex, float ey, float ea, float eb,
-                                   float px, float py)
-{
-
-    float dx, dy;
-    float a;
-    dx = px - ex;
-    dy = py - ey;
-    a = (dx * dx) / (ea * ea) + (dy * dy) / (eb * eb);
-    return (a <= 1);
-}
-int point_within_sphere_with_coords(float x0, float y0, float z0, float r,
-                                   float x, float y, float z)
-{
-    float rr =
-       (x - x0) * (x - x0) + (y - y0) * (y - y0) + (z - z0) * (z - z0);
-    rr = (float) pow(rr, 0.5);
-    if (rr <= r)
-       return 1;
-    return 0;
-}
-float distance_to_line(float ax, float ay, float bx, float by, float cx,
-                      float cy)
-{
-    //this function returns the distance between a line(a-b) segment and a point(c) in 2D plane
-    return (float)
-       sqrt(pow(((by - ay) * (cx - ax) + (bx - ax) * (cy - ay)), 2)
-            / (pow((bx - ax), 2) + pow((by - ay), 2))
-       );
-}
-
-int point_in_polygon(int npol, float *xp, float *yp, float x, float y)
-{
-    int i, j, c = 0;
-      for (i = 0, j = npol-1; i < npol; j = i++) {
-        if ((((yp[i] <= y) && (y < yp[j])) ||
-             ((yp[j] <= y) && (y < yp[i]))) &&
-            (x < (xp[j] - xp[i]) * (y - yp[i]) / (yp[j] - yp[i]) + xp[i]))
-          c = !c;
-      }
-      return c;
-    }
-
diff --git a/cmd/smyrna/selection.h b/cmd/smyrna/selection.h
deleted file mode 100644 (file)
index 74d01ca..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/* $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             *
-**********************************************************/
-
-#ifndef SELECTION_H
-#define SELECTION_H
-
-#include "draw.h"
-#include <GL/gl.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define        SELECTION_SEGMENT_DIVIDER       5.0     //control points count to check if a line segment is withing clipping rect
-#define SINGLE_SELECTION_WIDTH 10      //width of the rect clip for single selections , higher values more catches less sensitivity
-
-    extern int lineintersects(float X1, float X2, float Y1, float Y2);
-    extern int point_within_ellips_with_coords(float ex, float ey,
-                                              float ea, float eb,
-                                              float px, float py);
-
-    extern int SelectBeziers(sdot_op * op);
-    extern int SelectEllipse(sdot_op * op);
-    extern int SelectPolygon(sdot_op * op);
-    extern int SelectPolyline(sdot_op * op);
-
-    extern int SelectText(sdot_op * op);
-    extern int SelectImage(sdot_op * op);
-
-    extern int select_node(topview_node *);
-    extern int select_edge(topview_edge *);
-
-
-    extern int deselect_node(topview_node *);
-    extern int deselect_edge(topview_edge *);
-
-    extern int select_all_nodes(Agraph_t *);
-    extern int select_all_edges(Agraph_t *);
-    extern int select_all(Agraph_t *);
-
-    extern int deselect_all_nodes(Agraph_t *);
-    extern int deselect_all_edges(Agraph_t *);
-    extern int deselect_all(Agraph_t *);
-    int point_within_sphere_with_coords(float x0, float y0, float z0,
-                                       float r, float x, float y,
-                                       float z);
-    float distance_to_line(float ax, float ay, float bx, float by,
-                          float cx, float cy);
-
-    extern void rectangle_select(ViewInfo* v);
-
-#ifdef __cplusplus
-}                              /* end extern "C" */
-#endif
-#endif
diff --git a/cmd/smyrna/topview.c b/cmd/smyrna/topview.c
deleted file mode 100755 (executable)
index e18496f..0000000
+++ /dev/null
@@ -1,1582 +0,0 @@
-/* $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 "glcompui.h"
-#include "gltemplate.h"
-/* #include "topview.h" */
-#include "math.h"
-#include "memory.h"
-#include "btree.h"
-#include "viewport.h"
-#include "viewportcamera.h"
-#include "draw.h"
-#include "selection.h"
-#include "topviewdata.h"
-#include "hier.h"
-#include "arith.h"
-#include "topfisheyeview.h"
-#include "beacon.h"
-#include "pointset.h"
-#include "glpangofont.h"
-#ifdef WIN32
-#include "regex_win32.h"
-#else
-#include "regex.h"
-#endif
-#include "color.h"
-#include "colorprocs.h"
-#include <assert.h>
-#include "frmobjectui.h"
-#include "hotkeymap.h"
-static float dx = 0.0;
-static float dy = 0.0;
-
-   /* Forward declarations */
-static void set_boundaries(topview * t);
-static void set_topview_options(void);
-static int draw_topview_label(topview_node * v, float zdepth);
-static int draw_topview_edge_label(topview_edge * e, float zdepth);
-static int node_visible(topview_node * n);
-static int get_color_from_edge(topview_edge * e);
-static void draw_tv_xdot(topview* t);
-static void draw_xdot(xdot* x,float base_z);
-static int drawtopviewnodes(Agraph_t * g);
-static void drawtopviewedges(Agraph_t * g);
-void tesstest();
-
-
-
-void cleartopview(topview * t)
-{
-    free(t->Nodes);
-       free_attr_list(t->attributes);
-    free(t->Edges);
-
-}
-static void init_element_data(element_data * d)
-{
-
-    d->Layer = 0;
-    d->Visible = 1;
-    d->Selected = 0;
-    d->NumDataCount = 0;
-    d->NumData = (float *) 0;
-    d->StrDataCount = 0;
-    d->StrData = (char **) 0;
-    d->param = 0;
-    d->TVRef = -1;
-}
-
-static void setpositioninfo(float *x, float *y, float *z, char *buf)
-{
-
-    /*zero all values */
-    char* a;
-    static char bf[512];
-    strcpy(bf,buf);
-    *x = 0;
-    *y = 0;
-    *z = 0;
-    a=strtok(bf,",");
-    if(a)
-    *x=atof(a);
-    a=strtok(NULL,",");
-    if(a)
-    *y=atof(a);
-    a=strtok(NULL,",");
-    if(a)
-       *z=atof(a);
-
-
-
-//    sscanf(buf, "%f,%f,%f", x, y, z);
-}
-
-static void setglCompColor(glCompColor * c, char *colorstr)
-{
-    gvcolor_t cl;
-    float A=1;
-    /*if node has color attribute */
-    if ((colorstr != '\0') && (strlen(colorstr) > 0)) {
-       colorxlate(colorstr, &cl, RGBA_DOUBLE);
-       c->tag = 1;             /*tag is used to identofy colros set by the graph , not smyrna */
-    } else {
-       colorxlate(agget(view->g[view->activeGraph], "defaultnodecolor"),
-                  &cl, RGBA_DOUBLE);
-       
-       c->tag = 0;
-       A= view->defaultnodealpha;
-    }
-    c->R = (float) cl.u.RGBA[0];
-    c->G = (float) cl.u.RGBA[1];
-    c->B = (float) cl.u.RGBA[2];
-    c->A = (float) cl.u.RGBA[3]*view->defaultnodealpha;
-}
-
-#undef DIST2
-#undef DIST
-#define DIST2(x,y) (((x)*(x))+((y)*(y)))
-#define DIST(x,y) (sqrt(DIST2(x,y)))
-
-
-/*update position info from cgraph*/
-
-/* mapbool:
- */
-static int mapbool(char *p, int defv)
-{
-    if (p == NULL || (*p == '\0'))
-       return defv;
-    if (!strcasecmp(p, "false"))
-       return 0;
-    if (!strcasecmp(p, "true"))
-       return 1;
-    return atoi(p);
-}
-
-/* boolAttr:
- * if object has attribute returns its value, else returns 0*/
-/*for atttribute values which has no meaning for a 0 or 1 value 0 iz returned,
-function is error safe
-*/
-static int boolAttr(void *obj, Agsym_t * attr, int defv)
-{
-    if (attr == NULL)
-       return defv;
-    else
-       return mapbool(agxget(obj, attr), defv);
-}
-
-static int visible(void *obj, Agsym_t * vattr, Agsym_t * sattr)
-{
-    if (vattr)
-       return boolAttr(obj, vattr, 1);
-    else if (sattr) {
-       if (strcmp(agxget(obj, sattr), "invis"))
-           return 1;
-       else
-           return 0;
-    } else
-       return 1;
-}
-
-static int needs_refresh(ViewInfo* v)
-{
-    return ((view->refresh.color) || (view->refresh.nodesize) || (view->refresh.pos) || (view->refresh.selection) || (view->refresh.visibility));
-}
-
-
-
-
-void settvcolorinfo(Agraph_t * g, topview * t)
-{
-    float maxedgelen, len, minedgelen, totallen;
-    float xmin, xmax, ymin, ymax;
-    int ind;
-    glCompColor color;
-    char *color_string;
-    char* tempStr;
-    topview_node *np;
-    topview_edge *ep;
-    Agsym_t *sel = agattr(g, AGNODE, "selected", 0);
-    Agsym_t *vis = agattr(g, AGNODE, "visible", 0);
-    Agsym_t *sty = agattr(g, AGNODE, "style", 0);
-    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; */
-    assert(poss);
-    maxedgelen = 0;
-    xmax = ymax = -MAXFLOAT;
-    xmin = ymin = minedgelen = MAXFLOAT;
-    totallen = 0;
-    if (!needs_refresh(view))
-       return;
-
-    /*loop nodes */
-    for (ind = 0; ind < t->Nodecount; ind++) 
-    {
-       np = t->Nodes + ind;
-       if(view->refresh.color)
-       {
-           setglCompColor(&color, agget(np->Node, "color"));
-           np->Color = color;
-       }
-
-       /*while in the loop why dont we set some smyrna settings from graph? selected , highlighted , visible */
-       if(view->refresh.selection)
-           np->data.Selected = boolAttr(np->Node, sel, 0);
-       if(view->refresh.visibility)
-               np->data.Visible = visible(np->Node, vis, sty);
-       if(view->refresh.nodesize)
-       {
-           if ((tempStr=agget(t->Nodes[ind].Node, "size")) && *tempStr) { /*set node size */
-               t->Nodes[ind].size = atof(tempStr);
-           }
-           else
-               t->Nodes[ind].size = 0;
-
-       }
-       if (t->Nodes[ind].degree > t->maxnodedegree)
-           t->maxnodedegree = t->Nodes[ind].degree;
-
-
-       if(view->refresh.pos)
-       {
-               setpositioninfo(&np->x, &np->y, &np->z, agxget(np->Node, poss));
-               /*distorted coordiates, same with original ones at the beginning */
-               np->distorted_x = np->x;
-               np->distorted_y = np->y;
-               np->distorted_z = np->z;
-               xmax = MAX(xmax, np->x);
-               xmin = MIN(xmin, np->x);
-               ymax = MAX(ymax, np->y);
-               ymin = MIN(ymin, np->y);
-       }
-    }
-
-    /*loop edges */
-    sel = agattr(g, AGEDGE, "selected", 0);
-    vis = agattr(g, AGEDGE, "visible", 0);
-    sty = agattr(g, AGEDGE, "style", 0);
-    setMultiedges(g, "edgeid");
-    edgeid = agattr(g, AGEDGE, "edgeid", 0);
-    /*set multi edges */
-    for (ind = 0; ind < t->Edgecount; ind++) 
-    {
-       ep = t->Edges + ind;
-       if(view->refresh.pos)
-       {
-           ep->x1 = ep->Node1->x;
-           ep->y1 = ep->Node1->y;
-           ep->z1 = ep->Node1->z;
-           ep->x2 = ep->Node2->x;
-           ep->y2 = ep->Node2->y;
-           ep->z2 = ep->Node2->z;
-           len = (float) DIST(ep->x2 - ep->x1, ep->y2 - ep->y1);
-           totallen = totallen + len;
-           if (len > maxedgelen)
-                   maxedgelen = len;
-           if (len < minedgelen)
-               minedgelen = len;
-           ep->length = len;
-       }
-
-       if(view->refresh.color)
-       {
-               if (ecolor && (color_string = agxget(ep->Edge, ecolor))
-                   && (*color_string != '\0')&& (strlen(color_string)>0))
-                       setglCompColor(&color, color_string);
-               else {                  /*use color theme */
-                   getcolorfromschema(view->colschms, ep->length, t->maxedgelen,&color);
-                   color.tag = 0;}
-               ep->Color = color;
-
-       }
-       ep->data.edgeid = boolAttr(ep->Edge, edgeid, 0);
-       if(view->refresh.selection)
-           ep->data.Selected = boolAttr(ep->Edge, sel, 0);
-       if(view->refresh.visibility)
-           ep->data.Visible = visible(ep->Edge, vis, sty);
-
-    }
-       if(view->refresh.pos)
-       {
-           t->maxedgelen = maxedgelen;
-           t->minedgelen = minedgelen;
-           t->avgedgelength = totallen / (float) t->Edgecount;
-       }
-
-
-}
-
-
-static xdot* parseXdotwithattrs(void *e)
-{
-       
-       xdot* xDot=NULL;
-       xDot=parseXDotFOn (agget(e,"_draw_" ), OpFns,sizeof(sdot_op), xDot);
-       xDot=parseXDotFOn (agget(e,"_ldraw_" ), OpFns,sizeof(sdot_op), xDot);
-       xDot=parseXDotFOn (agget(e,"_hdraw_" ), OpFns,sizeof(sdot_op), xDot);
-       xDot=parseXDotFOn (agget(e,"_tdraw_" ), OpFns,sizeof(sdot_op), xDot);
-       xDot=parseXDotFOn (agget(e,"_hldraw_" ), OpFns,sizeof(sdot_op), xDot);
-       xDot=parseXDotFOn (agget(e,"_tldraw_" ), OpFns,sizeof(sdot_op), xDot);
-       return xDot;
-
-}
-
-void settvxdot(Agraph_t * g, topview * t)
-{
-    /*
-    look for xdot attributes and parse them if there is any 
-    */
-    topview_node *np;
-    topview_edge *ep;
-    int ind;
-       t->xDot=parseXdotwithattrs(view->g[view->activeGraph]);
-       for (ind = 0; ind < t->Nodecount; ind++) 
-       {
-               np = &t->Nodes[ind];
-               np->xDot=parseXdotwithattrs(np->Node);
-    }
-    for (ind = 0; ind < t->Edgecount; ind++) 
-       {
-               ep = &t->Edges[ind];
-               ep->xDot=parseXdotwithattrs(ep->Edge);
-    }
-}
-void init_node_size(Agraph_t * g, topview * t)
-{
-    float vsize;
-    int percent;
-    percent = atoi(agget(g, "nodesize"));
-    if (percent == 0)
-       percent = 0.000001;
-    vsize =
-       0.05 * sqrt((view->bdxRight - view->bdxLeft) *
-                   (view->bdyTop - view->bdyBottom));
-    t->init_node_size =        vsize * 2  * percent / 100.0 /
-       sqrt(t->Nodecount);
-/*    if (t->init_node_size < 1)
-       t->init_node_size=1;*/
-//    t->init_zoom = view->zoom;
-    t->init_zoom = -20;
-
-}
-
-void _init_node_size(Agraph_t * g, topview * t)
-{
-    float vsize;
-    int percent;
-    percent = atoi(agget(g, "nodesize"));
-    if (percent == 0)
-       percent = 0.000001;
-    vsize =
-       0.05 * sqrt((view->bdxRight - view->bdxLeft) *
-                   (view->bdyTop - view->bdyBottom));
-    t->init_node_size =
-       vsize * 2 / GetOGLDistance(2) * percent / 100.0 /
-       sqrt(t->Nodecount);
-    if (t->init_node_size < 1)
-       t->init_node_size=1;
-    t->init_zoom = view->zoom;
-}
-
-
-static void reset_refresh(ViewInfo* v)
-{
-    v->refresh.color=0;
-    v->refresh.nodesize=0;
-    v->refresh.pos=0;
-    v->refresh.selection=0;
-    v->refresh.visibility=0;
-
-}
-
-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;
-}
-
-
-#if 0
-static void create_DL()
-{
-    Agraph_t* g=view->g[view->activeGraph];
-    glNewList(1,GL_COMPILE); 
-      drawtopviewnodes(g);
-        drawtopviewlabels(g);
-       drawtopviewedges(g);
-       drawtopviewedgelabels(g);
-/*     renderNodes(g);
-       renderEdges(g);*/
-    glEndList();
-
-}
-#endif
-
-void update_topview(Agraph_t * g, topview * t, int init)
-{
-
-    if (init)
-    {
-       preparetopview(g, t);
-       t->xdotId=-1;
-    }
-    settvcolorinfo(g, t);
-    set_boundaries(t);
-    settvxdot(view->g[view->activeGraph], view->Topview);
-    reset_refresh(view);
-    if (init)/*one time call to calculate right colors*/
-    {
-       view->refresh.color=1;
-       view->refresh.pos=1;
-       settvcolorinfo(g, t);
-        reset_refresh(view);
-        set_boundaries(t);
-    }
-       init_node_size(g, t);
-
-
-    /*This is a temp code , need to be removed after Xue's demo */
-#if UNUSED
-    info_file = agget(g, "demo_file");
-    if ((info_file != NULL) && (strlen(info_file) != 0)) {
-       agxbuf xbuf;
-       agxbinit(&xbuf, 512, xbuffer);
-
-       f = fopen(info_file, "r");
-       if (info_file) {
-           while (fgets(buf, BUFSIZ, f))
-               agxbput(&xbuf, buf);
-           agxbput(&xbuf, "");
-           str = agxbuse(&xbuf);
-           append_textview((GtkTextView *)
-                           glade_xml_get_widget(xml, "mainconsole"), str,
-                           strlen(str));
-       }
-    }
-
-
-    /*end of temp code */
-#endif
-
-    if (view->SignalBlock)
-       btnToolZoomFit_clicked(NULL, NULL);
-//    create_DL();
-
-}
-
-
-void preparetopview(Agraph_t * g, topview * t)
-{
-    char *d_attr1;
-    char *d_attr2;
-    Agnode_t *v;
-    Agedge_t *e;
-    Agsym_t *sym;
-    int ind, ind2, data_type_count;
-    float maxedgelen, minedgelen, edgelength;
-
-
-    maxedgelen = 0;
-    minedgelen = MAXFLOAT;
-    edgelength = 0;
-
-    ind = 0;
-    ind2 = 0;
-    data_type_count = 0;
-    d_attr1 = NULL;
-    d_attr1 = agget(g, "nodelabelattribute");
-    if (d_attr1) {
-       if (!strcmp(d_attr1, "\\N"))
-           sym = 0;
-       else if (!(sym = agattr(g, AGNODE, d_attr1, 0)))
-           d_attr1 = 0;
-    }
-    d_attr2 = agget(g, "DataAttribute2");
-
-
-    /*initialize node and edge array */
-    t->Edges = N_GNEW(agnedges(g), topview_edge);
-    t->Nodes = N_GNEW(agnnodes(g), topview_node);
-    t->maxnodedegree = 1;
-
-    for (v = agfstnode(g); v; v = agnxtnode(g, v)) {
-       //bind temp record;
-       agbindrec(v, "temp_node_record", sizeof(temp_node_record), TRUE);       //graph custom data
-       /*initialize group index, -1 means no group */
-       t->Nodes[ind].Node = v;
-       t->Nodes[ind].data.TVRef = ind;
-       ((temp_node_record *) AGDATA(v))->TVref = ind;
-       init_element_data(&t->Nodes[ind].data);
-       t->Nodes[ind].zoom_factor = 1;
-       t->Nodes[ind].degree = agdegree(g, v, 1, 1);
-       t->Nodes[ind].size=0;
-       view->Topview->Nodes[ind].Label = NULL;
-
-       t->Nodes[ind].node_alpha = 1;
-       for (e = agfstout(g, v); e; e = agnxtout(g, e)) {
-           init_element_data(&t->Edges[ind2].data);    /*init edge data */
-           t->Edges[ind2].Edge = e;
-           ind2++;
-       }
-       ind++;
-    }
-
-
-    /*attach edge node references ,  loop one more time,set colors */
-    ind = 0;
-    ind2 = 0;
-    for (v = agfstnode(g); v; v = agnxtnode(g, v)) {
-       for (e = agfstout(g, v); e; e = agnxtout(g, e)) {
-           t->Edges[ind2].Node1 =
-               &t->Nodes[((temp_node_record *) AGDATA(agtail(e)))->TVref];
-           t->Edges[ind2].Node2 =
-               &t->Nodes[((temp_node_record *) AGDATA(aghead(e)))->TVref];
-           ind2++;
-       }
-       ind++;
-    }
-    /*set some stats for topview */
-    t->Nodecount = ind;
-    t->Edgecount = ind2;
-
-    /*create glcomp menu system */
-    view->widgets = glcreate_gl_topview_menu();
-    /*for grouped data , group data viewing buttons extension */
-//      load_host_buttons(t, g, view->widgets);
-    /*set topologilca fisheye to NULL */
-    t->fisheyeParams.h = '\0';
-    if (view->dfltViewType == VT_TOPFISH)
-       t->fisheyeParams.active = 1;
-    else
-       t->fisheyeParams.active = 0;
-
-    /*reset picked nodes */
-    t->picked_node_count = 0;
-    t->picked_nodes = '\0';
-    t->picked_edge_count = 0;
-    t->picked_edges = '\0';
-
-       /*create attribute list*/
-       t->attributes=load_attr_list(view->g[view->activeGraph]);
-       t->filtered_attr_list=NULL;
-}
-
-
-static float set_gl_dot_size(topview * t)
-{
-    float sizevc;
-    if (view->active_camera == -1)
-       sizevc = t->init_node_size / view->zoom * t->init_zoom;
-    else
-       sizevc =
-           t->init_node_size / view->cameras[view->active_camera]->r *
-           t->init_zoom;
-
-    if (sizevc < 1)
-       sizevc = 1;
-    return sizevc;
-
-}
-
-/*
-       draws multi edges , single edges
-       this function assumes     glBegin(GL_LINES) has been called 
-*/
-static void draw_edge(double x1, double y1, double z1, double x2,
-                     double y2, double z2, int deg, topview_edge * e)
-{
-    double alpha, R, ITERANGLE;
-    double X1, Y1, X2, Y2;
-
-    if (deg) {
-       R = e->length / 20.0;
-       if ((deg / 2) * 2 != deg)       /*odd */
-           ITERANGLE = (deg) * 15.00 * -1;
-       else
-           ITERANGLE = (deg) * 15.00;
-       ITERANGLE = DEG2RAD * ITERANGLE;
-
-       alpha = atan((y2 - y1) / (x2 - x1));
-       if (x1 > x2)
-           ITERANGLE = 180 * DEG2RAD - ITERANGLE;
-       X1 = R * cos(alpha - ITERANGLE) + x1;
-       Y1 = R * sin(alpha - ITERANGLE) + y1;
-       X2 = R * cos(alpha - (180 * DEG2RAD - ITERANGLE)) + x2;
-       Y2 = R * sin(alpha - (180 * DEG2RAD - ITERANGLE)) + y2;
-       glVertex3f(x1, y1, z1);
-       glVertex3f(X1, Y1, z1);
-       glVertex3f(X1, Y1, z1);
-       glVertex3f(X2, Y2, z2);
-       glVertex3f(X2, Y2, z2);
-       glVertex3f(x2, y2, z2);
-    } else {
-       glVertex3f(x1, y1, z1);
-       glVertex3f(x2, y2, z2);
-
-    }
-
-}
-
-
-static int begintopviewnodes(Agraph_t * g, float dotsz)
-{
-    switch (view->defaultnodeshape) {
-    case 0:
-       glPointSize((GLfloat) dotsz);
-       glEnable(GL_POINT_SMOOTH);
-       glBegin(GL_POINTS);
-       break;
-    case 1:
-       /* set_gl_dot_size(view->Topview); FIX - command with no effect          */
-       break;
-    default:
-       /* set_gl_dot_size(view->Topview); FIX - command with no effect          */
-       glBegin(GL_POINTS);
-
-    };
-    //reset single selection mechanism
-    view->Selection.single_selected_node = (topview_node *) 0;
-    view->Selection.single_selected_edge = (topview_edge *) 0;
-    view->Selection.node_distance = -1;
-    return 1;
-
-
-}
-static void enddrawcycle(Agraph_t * g)
-{
-    if (view->Selection.single_selected_edge) {
-       if (!(view->mouse.t == rightmousebutton))       //right click pick mode
-       {                       //left click single select mode
-           if (view->Selection.single_selected_edge->data.Selected == 0) {
-               view->Selection.single_selected_edge->data.Selected = 1;
-               select_edge(view->Selection.single_selected_edge);
-           } else {
-               view->Selection.single_selected_edge->data.Selected = 1;
-               deselect_edge(view->Selection.single_selected_edge);
-           }
-       }
-       /* return 1; */
-    }
-    if (view->Selection.single_selected_node) {
-       if (view->mouse.t == rightmousebutton)
-           //right click pick mode
-           ;
-       /*              pick_node(view->Selection.single_selected_node); */
-       else {                  //left click single select mode
-           if (view->Selection.single_selected_node->data.Selected == 0) {
-               view->Selection.single_selected_node->data.Selected = 1;
-               select_node(view->Selection.single_selected_node);
-           } else {
-               view->Selection.single_selected_node->data.Selected = 1;
-               deselect_node(view->Selection.single_selected_node);
-           }
-       }
-    }
-
-}
-
-
-static int endtopviewnodes(Agraph_t * g)
-{
-    switch (view->defaultnodeshape) {
-    case 0:
-       glEnd();
-       glDisable(GL_POINT_SMOOTH);
-       break;
-    case 1:
-       break;
-    default:
-       glEnd();
-       break;
-
-    };
-
-    return 1;
-}
-
-
-
-
-static int drawtopviewnodes(Agraph_t * g)
-{
-    topview_node *v;
-    float ddx, ddy, ddz;
-    int ind = 0;
-    float dotsize = set_gl_dot_size(view->Topview);    //sets the size of the gl points
-    set_topview_options();
-    begintopviewnodes(g, dotsize);
-    view->visiblenodecount = 0;
-    for (ind = 0; ind < view->Topview->Nodecount; ind++) {
-       v = view->Topview->Nodes + ind;
-/*     if (((-v->distorted_x / view->zoom >= view->clipX1)
-            && (-v->distorted_x / view->zoom <= view->clipX2)
-            && (-v->distorted_y / view->zoom >= view->clipY1)
-            && (-v->distorted_y / view->zoom <= view->clipY2))
-           || (view->active_camera >= 0))*/
-           if(1)
-           {
-           float zdepth;
-           view->visiblenodecount = view->visiblenodecount + 1;
-           if (!view->drawnodes || !node_visible(v))
-               continue;
-
-           /*check for each node if it needs to be selected or picked */
-           //UPDATE view->Topview data from cgraph
-           /* if (v->update_required) */
-           /* update_topview_node_from_cgraph(v); */
-           if (v->data.Selected == 1) {
-               glColor4f(view->selectedNodeColor.R,
-                         view->selectedNodeColor.G,
-                         view->selectedNodeColor.B,
-                         view->selectedNodeColor.A);
-           } else {            //get the color from node
-               glColor4f(v->Color.R, v->Color.G, v->Color.B,
-                         v->Color.A);
-               ddx = 0;
-               ddy = 0;
-               ddz = 0;
-           }
-           if (v->distorted_x != v->x)
-               zdepth = (float) Z_FORWARD_PLANE;
-           else
-               zdepth = (float) Z_BACK_PLANE;
-
-           if ((view->defaultnodeshape == 0)) {
-               glVertex3f(v->distorted_x,
-                          v->distorted_y, v->distorted_z);
-           } else if (view->defaultnodeshape == 1) {
-               if (v->size > 0)
-                   drawCircle(v->distorted_x , v->distorted_y ,
-                              v->size * view->Topview->init_node_size,
-                              v->distorted_z );
-               else
-                   drawCircle(v->distorted_x , v->distorted_y,
-                              view->Topview->init_node_size,
-                              v->distorted_z);
-           }
-       } else {
-           /* int a=1; */
-       }
-    }
-    endtopviewnodes(g);
-    return 1;
-
-}
-static int edgevisible(topview_edge* e)
-{
-    static float x1,y1,x2,y2;
-    static glCompPoint a;
-    static glCompPoint b;
-    static glCompPoint c;
-    static glCompPoint d;
-    return 1;
-
-    x1=e->x1/ view->zoom * -1;
-    x2=e->y1/ view->zoom * -1;
-    y1=e->y1/ view->zoom * -1;
-    y2=e->y2/ view->zoom * -1;
-
-    if (
-           ((x1> view->clipX1) && (x1 < view->clipX2) && (y1 > view->clipY1) && (y1 < view->clipY2))
-                   || 
-           ((x2 > view->clipX1)&& (x2< view->clipX2)&& (y2 > view->clipY1)     && (y2 < view->clipY2))
-                   || 
-           (view->active_camera >= 0)
-    
-       )       
-           return 1;
-    if(view->edgerendertype == 0)
-    {
-       a.x=x1;a.y=y1;a.z=0;
-       b.x=x2;b.y=y2;b.z=0;
-       c.x=view->clipX1;c.y=view->clipY1;c.z=0;
-       c.x=view->clipX1;c.y=view->clipY2;c.z=0;
-       if(lines_intersect (&a, &b, &c,&d))
-           return 1;
-       c.x=view->clipX2;c.y=view->clipY1;c.z=0;
-       c.x=view->clipX2;c.y=view->clipY2;c.z=0;
-       if(lines_intersect (&a, &b, &c,&d))
-           return 1;
-       c.x=view->clipX1;c.y=view->clipY1;c.z=0;
-       c.x=view->clipX2;c.y=view->clipY1;c.z=0;
-       if(lines_intersect (&a, &b, &c,&d))
-           return 1;
-       c.x=view->clipX1;c.y=view->clipY2;c.z=0;
-       c.x=view->clipX2;c.y=view->clipY2;c.z=0;
-       if(lines_intersect (&a, &b, &c,&d))
-           return 1;
-       return 0;
-
-    }
-    return 0;
-
-
-
-}
-
-static void drawtopviewedges(Agraph_t * g)
-{
-    topview_edge *e;
-    float ddx, ddy, ddz;
-    float dddx, dddy, dddz;
-    int ind = 0;
-    if (!view->drawedges)
-       return;
-    glBegin(GL_LINES);
-    set_topview_options();
-    for (ind = 0; ind < view->Topview->Edgecount; ind++) 
-    {
-       e = view->Topview->Edges + ind;
-       if(edgevisible(e))
-       {
-           if (!get_color_from_edge(e))
-               continue;
-           //select_topview_edge(e);
-           if (e->Node1->data.Selected == 1) { //tail is selected
-               ddx = dx;
-               ddy = dy;
-               ddz = 0;
-           } else {
-               ddx = 0;
-               ddy = 0;
-               ddz = 0;
-           }
-           if (e->Node2->data.Selected == 1) { //head
-               dddx = dx;
-               dddy = dy;
-               dddz = 0;
-           } else {
-               dddx = 0;
-               dddy = 0;
-               dddz = 0;
-           }
-
-           /*glVertex3f(e->Node1->distorted_x - ddx,
-              e->Node1->distorted_y - ddy,
-              e->Node1->distorted_z - ddz);
-              e->Node2->distorted_x - dddx,
-              e->Node2->distorted_y - dddy,
-              e->Node2->distorted_z - ddz */
-           draw_edge(e->Node1->distorted_x ,
-                     e->Node1->distorted_y ,
-                     e->Node1->distorted_z ,
-                     e->Node2->distorted_x ,
-                     e->Node2->distorted_y ,
-                     e->Node2->distorted_z , e->data.edgeid, e);
-
-
-
-       }
-    }
-    glEnd();
-
-}
-
-
-void drawTopViewGraph(Agraph_t * g)
-{
-/*
-    glEnable (GL_BLEND);
-    glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-    glDisable(GL_DEPTH_TEST);
-*/
-
-//    glDisable(GL_DEPTH_TEST);
-//    glCallList (1);
-    drawtopviewnodes(g);
-    drawtopviewlabels(g);
-    drawtopviewedges(g);
-    drawtopviewedgelabels(g);
-    enddrawcycle(g);
-    draw_tv_xdot(view->Topview);
-  //  draw_node_hint_boxes();
-//    tesstest();
-//    glEnable(GL_DEPTH_TEST);
-
-
-    if ((view->Selection.Active > 0) && (!view->SignalBlock)) {
-       view->Selection.Active = 0;
-       drawTopViewGraph(g);
-       view->SignalBlock = 1;
-       glexpose();
-       view->SignalBlock = 0;
-    }
-
-}
-
-
-
-/*static int pick_node(topview_node * n)
-{
-       if (!is_node_picked(n)) 
-       {
-               if (add_to_pick_list(n)) 
-               {
-                       return 1;
-           }
-           return 0;
-       }
-       else 
-       {
-               if (remove_from_pick_list(n)) 
-               {
-                       return 1;
-               }
-           return 0;
-       }
-    return 0;
-
-}*/
-
-
-
-
-
-#ifdef UNUSED
-static int select_topview_edge(topview_edge * e)
-{
-
-    int r = 0;
-    if (((view->Selection.Type == 0) && (view->Selection.Active))
-       || (view->mouse.button == rightmousebutton))    //single selection or right click (picking)
-    {
-
-       float dist =
-           distance_to_line(e->x1, e->y1, e->x2, e->y2, view->Selection.X,
-                            view->Selection.Y);
-       if ((view->Selection.node_distance == -1)
-           || (dist < view->Selection.node_distance)) {
-           view->Selection.node_distance = dist;
-           view->Selection.single_selected_edge = e;
-       }
-
-       return 0;
-    }
-    if (!view->Selection.Active)
-       return 0;
-    r = (lineintersects(e->x1, e->y1, e->x2, e->y2));
-    if (r >= 0) {
-       switch (view->Selection.Type) {
-       case 0:
-           if (OD_Selected(e->Edge) == 0) {
-               OD_Selected(e->Edge) = 1;
-               select_object(view->g[view->activeGraph], e->Edge);
-           } else {
-               OD_Selected(e->Edge) = 1;
-               deselect_object(view->g[view->activeGraph], e->Edge);
-           }
-           break;
-
-       }
-    }
-    return 1;
-
-}
-#endif
-
-
-
-float calculate_font_size(topview_node * v)
-{
-    float n;
-    n = (float) v->degree + (float) 1.00;
-    return n;
-
-}
-
-static int draw_topview_label(topview_node * v, float zdepth)
-{
-
-    float ddx = 0;
-    float ddy = 0;
-    char *buf;
-    if (((v->distorted_x / view->zoom * -1 > view->clipX1)
-        && (v->distorted_x / view->zoom * -1 < view->clipX2)
-        && (v->distorted_y / view->zoom * -1 > view->clipY1)
-        && (v->distorted_y / view->zoom * -1 < view->clipY2))
-       || (view->active_camera >= 0)) {
-       if (v->data.Selected == 1) {
-           ddx = dx;
-           ddy = dy;
-       }
-       glColor4f(view->nodelabelcolor.R, view->nodelabelcolor.G,
-                 view->nodelabelcolor.B, view->nodelabelcolor.A);
-       buf = agget(agraphof(v->Node), "nodelabelattribute");
-       if (buf)
-           glprintfglut(view->glutfont, (v->distorted_x - ddx),
-                        (v->distorted_y - ddy), v->distorted_z,
-                        agget(v->Node, buf));
-       return 1;
-    } else
-       return 0;
-}
-static int draw_topview_edge_label(topview_edge * e, float zdepth)
-{
-
-    float ddx = 0;
-    float ddy = 0;
-    char *buf;
-    float x1, y1, z1, x2, y2, z2, x, y, z;
-    x1 = e->Node1->distorted_x;
-    y1 = e->Node1->distorted_y;
-    x2 = e->Node2->distorted_x;
-    y2 = e->Node2->distorted_y;
-    z1 = e->Node1->distorted_z;
-    z2 = e->Node2->distorted_z;
-
-
-    if ((x1 / view->zoom * -1 > view->clipX1)
-       && (x1 / view->zoom * -1 < view->clipX2)
-       && (y1 / view->zoom * -1 > view->clipY1)
-       && (y1 / view->zoom * -1 < view->clipY2)) {
-
-       x = (x2 - x1) / 2.00 + x1;
-       y = (y2 - y1) / 2.00 + y1;
-       z = (z2 - z1) / 2.00 + z1;
-       if (e->data.Selected == 1) {
-           ddx = dx;
-           ddy = dy;
-       }
-       glColor4f(view->edgelabelcolor.R, view->edgelabelcolor.G,
-                 view->edgelabelcolor.B, view->edgelabelcolor.A);
-       buf = agget(agraphof(e->Edge), "edgelabelattribute");
-       if (buf)
-           glprintfglut(view->glutfont, x - ddx, y - ddy, z,
-                        agget(e->Edge, buf));
-       return 1;
-    } else
-       return 0;
-}
-
-
-
-
-static void set_topview_options(void)
-{
-
-    int a=get_mode(view);
-    if ((a == 10) && (view->mouse.down == 1))  //selected, if there is move move it, experimental
-    {
-       dx = view->mouse.GLinitPos.x - view->mouse.GLfinalPos.x;
-       dy = view->mouse.GLinitPos.y - view->mouse.GLfinalPos.y;
-    } else {
-       dx = 0;
-       dy = 0;
-    }
-
-}
-
-/*refreshes limits of the graph call it when node locations are changed*/
-static void set_boundaries(topview * t)
-{
-
-    int ind = 0;
-    float left, right, top, bottom;
-    left = t->Nodes[0].distorted_x;
-    right = t->Nodes[0].distorted_x;
-    top = t->Nodes[0].distorted_y;
-    bottom = t->Nodes[0].distorted_y;
-    for (ind = 0; ind < t->Nodecount; ind++) {
-       if (left > t->Nodes[ind].distorted_x)
-           left = t->Nodes[ind].distorted_x;
-       if (right < t->Nodes[ind].distorted_x)
-           right = t->Nodes[ind].distorted_x;
-       if (bottom > t->Nodes[ind].distorted_y)
-           bottom = t->Nodes[ind].distorted_y;
-       if (top < t->Nodes[ind].distorted_y)
-           top = t->Nodes[ind].distorted_y;
-    }
-    view->bdxLeft = left;
-    view->bdyTop = top;
-    view->bdxRight = right;
-    view->bdyBottom = bottom;
-
-    view->bdzTop = 0;
-    view->bdzBottom = 0;
-
-}
-
-static int get_color_from_edge(topview_edge * e)
-{
-    int return_value = 1;
-    float Alpha = 0;
-    GtkHScale *AlphaScale =
-       (GtkHScale *) glade_xml_get_widget(xml, "settingsscale2");
-    Alpha = (float) gtk_range_get_value((GtkRange *) AlphaScale);
-
-    //check visibility;
-/*
-    if ((node_visible(e->Node1))
-       && (node_visible(e->Node2)))
-*/
-    /* FIX - if edge is not visible, why not return immediately? */
-    if (!e->data.Visible)
-       return_value = 0;
-
-
-        /*if both head and tail nodes are selected use selection color for edges */
-    if(e->data.Selected)
-//    if ((e->Node1->data.Selected) || (e->Node2->data.Selected)) 
-    {
-       glColor4f(view->selectedEdgeColor.R, view->selectedEdgeColor.G,
-                 view->selectedEdgeColor.B, view->selectedEdgeColor.A);
-       return return_value;
-    }
-    /*get edge's color attribute */
-    if (e->Color.tag == 0)
-       glColor4f(e->Color.R, e->Color.G, e->Color.B, Alpha * e->Color.A);
-    else
-       glColor4f(e->Color.R, e->Color.G, e->Color.B, e->Color.A);
-    return return_value;
-}
-
-static int node_visible(topview_node * n)
-{
-    return n->data.Visible;
-
-}
-
-int move_TVnodes(void)
-{
-    float delX,delY;
-    topview_node *v;
-    static int flag=0;
-    int ind = 0;
-    if (!flag)
-    {
-//     printf ("dragx:%f dragy:%f\n",view->mouse.dragX,view->mouse.dragY);
-       flag=1;
-       return 0;
-    }
-
-    delX = GetOGLDistance((int) view->mouse.dragX);
-    delY = GetOGLDistance((int) view->mouse.dragY);
-    for (ind = 0; ind < view->Topview->Nodecount; ind++) {
-       v = &view->Topview->Nodes[ind];
-       if (v->data.Selected) {
-           v->distorted_x = v->distorted_x + delX;
-           v->distorted_y = v->distorted_y - delY;
-           v->x = v->x + delX;
-           v->y = v->y - delY;
-       }
-    }
-    return 1;
-}
-
-
-
-void local_zoom(topview * t)
-{
-    int i;
-    double delx, dely, w, h, tempx, tempy;
-    w = view->mg.width;
-    h = view->mg.height;
-    for (i = 1; i < t->Nodecount; i++) {
-       if (is_point_in_rectangle
-           (t->Nodes[i].x, t->Nodes[i].y, view->mg.x - view->mg.GLwidth,
-            view->mg.y - view->mg.GLheight, view->mg.GLwidth * 2,
-            view->mg.GLheight * 2)) {
-           delx = t->Nodes[i].x - view->mg.x;
-           dely = t->Nodes[i].y - view->mg.y;
-           tempx = view->mg.x + delx * view->mg.kts;
-           tempy = view->mg.y + dely * view->mg.kts;
-           if (is_point_in_rectangle
-               ((GLfloat) tempx, (GLfloat) tempy,
-                view->mg.x - view->mg.GLwidth,
-                view->mg.y - view->mg.GLheight,
-                view->mg.GLwidth * (GLfloat) 2,
-                view->mg.GLheight * (GLfloat) 2)) {
-               t->Nodes[i].distorted_x =
-                   view->mg.x + (GLfloat) delx *view->mg.kts;
-               t->Nodes[i].distorted_y =
-                   view->mg.y + (GLfloat) dely *view->mg.kts;
-               t->Nodes[i].zoom_factor = view->mg.kts;
-           } else              //get intersections and move nodes to edges of magnifier box
-           {
-               t->Nodes[i].distorted_x = t->Nodes[i].x;
-               t->Nodes[i].distorted_y = t->Nodes[i].y;
-               t->Nodes[i].zoom_factor = 1;
-           }
-
-       } else {
-           t->Nodes[i].distorted_x = t->Nodes[i].x;
-           t->Nodes[i].distorted_y = t->Nodes[i].y;
-           t->Nodes[i].zoom_factor = 1;
-       }
-    }
-}
-
-
-
-void originate_distorded_coordinates(topview * t)
-{
-    //sets original coordinates values to distorded coords. this happens when lieft mouse click is released in geometrical fisyehey mode
-    int i;
-    for (i = 1; i < t->Nodecount; i++) {
-       t->Nodes[i].distorted_x = t->Nodes[i].x;
-       t->Nodes[i].distorted_y = t->Nodes[i].y;
-       t->Nodes[i].zoom_factor = 1;
-    }
-}
-
-
-#define strcaseeq(a,b)     (*(a)==*(b)&&!strcasecmp(a,b))
-
-gvk_layout s2layout(char *s)
-{
-    if (!s)
-       return GVK_NONE;
-
-    if (strcaseeq(s, "dot"))
-       return GVK_DOT;
-    else if (strcaseeq(s, "neato"))
-       return GVK_NEATO;
-    else if (strcaseeq(s, "twopi"))
-       return GVK_TWOPI;
-    else if (strcaseeq(s, "circo"))
-       return GVK_CIRCO;
-    else if (strcaseeq(s, "fdp"))
-       return GVK_FDP;
-    else if (strcaseeq(s, "sfdp"))
-       return GVK_SFDP;
-    else
-       return GVK_NONE;
-
-}
-
-char *layout2s(gvk_layout gvkl)
-{
-    char *s;
-    switch (gvkl) {
-    case GVK_NONE:
-       s = "";
-       break;
-    case GVK_DOT:
-       s = "dot";
-       break;
-    case GVK_NEATO:
-       s = "neato";
-       break;
-    case GVK_TWOPI:
-       s = "twopi";
-       break;
-    case GVK_CIRCO:
-       s = "circo";
-       break;
-    case GVK_FDP:
-       s = "fdp";
-       break;
-    case GVK_SFDP:
-       s = "sfdp";
-       break;
-    default:
-       s = "";
-       break;
-    }
-    return s;
-}
-
-char *element2s(gve_element el)
-{
-    char *s;
-    switch (el) {
-    case GVE_NONE:
-       s = "";
-       break;
-    case GVE_GRAPH:
-       s = "graph";
-       break;
-    case GVE_CLUSTER:
-       s = "cluster";
-       break;
-    case GVE_NODE:
-       s = "node";
-       break;
-    case GVE_EDGE:
-       s = "edge";
-       break;
-    default:
-       s = "";
-       break;
-    }
-    return s;
-}
-
-static int node_regex(topview_node * n, char *exp)
-{
-
-    regex_t preg;
-    char *data = n->Label;
-    int return_value = 0;
-    if (data) {
-       regcomp(&preg, exp, REG_NOSUB);
-       if (regexec(&preg, data, 0, 0, 0) == 0)
-           return_value = 1;
-       else
-           return_value = 0;
-       regfree(&preg);
-    }
-    return return_value;
-}
-
-void select_with_regex(char *exp)
-{
-    topview_node *v;
-    int ind = 0;
-    for (ind = 0; ind < view->Topview->Nodecount; ind++) {
-       v = &view->Topview->Nodes[ind];
-       if (node_visible(v)) {
-           if (node_regex(v, exp)) {
-               v->data.Selected = 1;
-               select_node(v);
-           }
-       }
-    }
-}
-
-
-static void draw_xdot(xdot* x,float base_z)
-{
-       int i;
-       sdot_op *op;
-       if (!x)
-               return;
-
-       view->Topview->global_z=base_z;
-
-       op=(sdot_op*)x->ops;
-       for (i=0; i < x->cnt; i++,op++)
-       {
-               if(op->op.drawfunc)
-                       op->op.drawfunc(&op->op,0);
-       }
-
-
-}
-
-
-static void draw_tv_xdot(topview* t)
-{
-
-/*    glNewList(1,GL_COMPILE); 
-      drawtopviewnodes(g);
-        drawtopviewlabels(g);
-       drawtopviewedges(g);
-       drawtopviewedgelabels(g);
-       renderNodes(g);
-       renderEdges(g);*/
-
-    int j;
-    float basez=0;
-
-    if(t->xdotId==-1)
-    {
-       t->xdotId=glGenLists(1);
-       glNewList(1,GL_COMPILE); 
-       glNewList(t->xdotId,GL_COMPILE);
-           draw_xdot(t->xDot,basez);
-           basez= basez+0.01;
-           for (j=0; j < t->Nodecount; j++)
-           {
-                   draw_xdot(t->Nodes[j].xDot,basez);
-                   basez = basez+0.001;
-           }
-           for (j=0; j < t->Edgecount; j++)
-           {
-                   draw_xdot(t->Edges[j].xDot,basez);
-
-           }
-       glEndList();
-    }
-    else
-       glCallList(t->xdotId);
-
-/*    if((t->xDot)&&(t->xDot->ops->kind ==xd_font))
-    {
-       draw_xdot(t->xDot,basez);
-       basez= basez+0.01;
-    }
-    for (j=0; j < t->Nodecount; j++)
-    {
-       if(t->Nodes[j].xDot->ops->kind==xd_font)
-       {
-           draw_xdot(t->Nodes[j].xDot,basez);
-           basez = basez+0.001;
-       }
-    }
-    for (j=0; j < t->Edgecount; j++)
-    {
-       if(t->Edges[j].xDot->ops->kind==xd_font)
-           draw_xdot(t->Edges[j].xDot,basez);
-    }*/
-
-}
-
-void setMultiedges(Agraph_t * g, char *attrname)
-{
-    Agsym_t *attr = agattr(g, AGEDGE, attrname, 0);
-    Agnode_t *n;
-    Agedge_t *e;
-    PointMap *map = newPM();
-    int tid, hid, u, v, idx;
-    char buf[128];
-
-    if (!attr)
-       attr = agattr(g, AGEDGE, attrname, "0");
-
-    for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
-       tid = AGID(n);
-       for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
-           hid = AGID(AGHEAD(e));
-           if (tid < hid) {
-               u = tid;
-               v = hid;
-           } else {
-               u = hid;
-               v = tid;
-           }
-           idx = insertPM(map, u, v, 0);
-           sprintf(buf, "%d", idx);
-           agxset(e, attr, buf);
-           updatePM(map, u, v, idx + 1);
-       }
-    }
-    freePM(map);
-}
-
-void tessBeginCB(GLenum which)
-{
-    glBegin(which);
-}
-
-
-
-void tessEndCB()
-{
-    glEnd();
-}
-void errorCallback(GLenum errorCode)
-{
-   const GLubyte *estring;
-
-   estring = gluErrorString(errorCode);
-   fprintf (stderr, "Tessellation Error: %s\n", estring);
-   exit (0);
-}
-
-#if 0
-void tesstest()
-{
-
-    static GLUtesselator *tobj;
-
-
-    GLdouble rect[4][3] = {0.0, 0.0, 0.0,
-                          200.0, 50.0, 0.0,
-                          200.0, 200.0, 0.0,
-                          0, 0, 0.0};
-   GLdouble tri[3][3] = {0.0, 0.0, 0.0,
-                         125.0, 175.0, 0.0,
-                         175.0, 0.0, 0.0};
-   GLdouble star[5][6] = {250.0, 50.0, 0.0, 1.0, 0.0, 1.0,
-                          325.0, 200.0, 0.0, 1.0, 1.0, 0.0,
-                          400.0, 50.0, 0.0, 0.0, 1.0, 1.0,
-                          250.0, 150.0, 0.0, 1.0, 0.0, 0.0,
-                          400.0, 150.0, 0.0, 0.0, 1.0, 0.0};
-
-    if(!tobj)
-       tobj=gluNewTess(); // create a tessellator
-    if(!tobj) return;  // failed to create tessellation object, return 0
-
-//   gluTessCallback(tobj, GLU_TESS_VERTEX,(GLvoid (*) ()) &glVertex3dv);
-
-    gluTessCallback(tobj, GLU_TESS_BEGIN, (void (*)())tessBeginCB);
-    gluTessCallback(tobj, GLU_TESS_END, (void (*)())tessEndCB);
-
-
-   glShadeModel(GL_FLAT);
-   gluTessBeginPolygon(tobj, NULL);
-      gluTessBeginContour(tobj);
-         gluTessVertex(tobj, rect[0], rect[0]);
-         gluTessVertex(tobj, rect[1], rect[1]);
-         gluTessVertex(tobj, rect[2], rect[2]);
-         gluTessVertex(tobj, rect[3], rect[3]);
-      gluTessEndContour(tobj);
-      gluTessBeginContour(tobj);
-         gluTessVertex(tobj, tri[0], tri[0]);
-         gluTessVertex(tobj, tri[1], tri[1]);
-         gluTessVertex(tobj, tri[2], tri[2]);
-      gluTessEndContour(tobj);
-   gluTessEndPolygon(tobj);
-
-   glShadeModel(GL_SMOOTH);
-   gluTessProperty(tobj, GLU_TESS_WINDING_RULE,
-                   GLU_TESS_WINDING_POSITIVE);
-   gluTessBeginPolygon(tobj, NULL);
-      gluTessBeginContour(tobj);
-         gluTessVertex(tobj, star[0], star[0]);
-         gluTessVertex(tobj, star[1], star[1]);
-         gluTessVertex(tobj, star[2], star[2]);
-         gluTessVertex(tobj, star[3], star[3]);
-         gluTessVertex(tobj, star[4], star[4]);
-      gluTessEndContour(tobj);
-   gluTessEndPolygon(tobj);
-}
-#endif
diff --git a/cmd/smyrna/topview.h b/cmd/smyrna/topview.h
deleted file mode 100755 (executable)
index 2ba52ed..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* $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             *
-**********************************************************/
-
-#ifndef TOPVIEW_H
-#define TOPVIEW_H
-
-#include "smyrnadefs.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-    extern void cleartopview(topview * t);
-    extern void preparetopview(Agraph_t * g, topview * t);
-    extern void update_topview(Agraph_t * g, topview * t, int init);
-    extern void drawTopViewGraph(Agraph_t * g);
-    extern int move_TVnodes(void);
-    extern void local_zoom(topview * t);
-    extern void originate_distorded_coordinates(topview * t);
-    extern float calcfontsize(float totaledgelength, int totallabelsize,
-                      int edgecount, int totalnodecount);
-    extern void select_with_regex(char *exp);
-    extern void settvcolorinfo(Agraph_t * g, topview * t);
-    extern void setMultiedges(Agraph_t * g, char *attrname);
-#endif
-#ifdef __cplusplus
-}                              /* end extern "C" */
-#endif
-#endif