]> granicus.if.org Git - graphviz/commitdiff
smyrna polygon selection
authorarif <devnull@localhost>
Tue, 2 Mar 2010 19:45:31 +0000 (19:45 +0000)
committerarif <devnull@localhost>
Tue, 2 Mar 2010 19:45:31 +0000 (19:45 +0000)
30 files changed:
cmd/smyrna/draw.c
cmd/smyrna/drawxdot.c
cmd/smyrna/glexpose.c
cmd/smyrna/gltemplate.c
cmd/smyrna/gui/appmouse.c
cmd/smyrna/gui/glcompui.c
cmd/smyrna/gui/gui.c
cmd/smyrna/gui/menucallbacks.c
cmd/smyrna/gui/toolboxcallbacks.c
cmd/smyrna/hotkeymap.c
cmd/smyrna/polytess.c
cmd/smyrna/selection.c
cmd/smyrna/selectionfuncs.c
cmd/smyrna/selectionfuncs.h
cmd/smyrna/smyrna.vcproj
cmd/smyrna/smyrna.vcproj.RESEARCH.arif.user
cmd/smyrna/smyrna_utils.c
cmd/smyrna/smyrna_utils.h
cmd/smyrna/smyrnadefs.h
cmd/smyrna/topfisheyeview.c
cmd/smyrna/topviewfuncs.c
cmd/smyrna/tvnodes.c
cmd/smyrna/viewport.c
lib/cdt/cdt.vcproj
lib/cgraph/cgraph.vcproj
lib/glcomp/glcompdefs.h
lib/glcomp/glcompfont.c
lib/glcomp/glutils.c
lib/gvc.def
share/gui/mouse_actions.txt

index 32c1b9d707a4bd5b2fb0424d43aa499e601f2668..615271d89313ede6dea3ad1506eb0d09931f6dbe 100755 (executable)
@@ -24,7 +24,7 @@ XDOT DRAWING FUNCTIONS, maybe need to move them somewhere else
 #include "colorprocs.h"
 #include "glutils.h"
 #include "math.h"
-#include "selection.h"
+
 #include "xdot.h"
 #include "viewport.h"
 #include "topfisheyeview.h"
@@ -422,8 +422,27 @@ void SetFont(sdot_op * o, int param)
        font_op=o;
 }
 
+/*for now we only support png files in 2d space, no image rotation*/
 void InsertImage(sdot_op * o, int param)
 {
+
+
+    float w,h,x,y;
+    if(!o->obj)
+       return;
+    w=atof(agget(o->obj,"width"))*72;
+    h=atof(agget(o->obj,"height"))*72;
+
+    if(!o->iData.data)
+       o->iData.data = load_png(o->op.u.image.name, &o->iData.w, &o->iData.h);    
+    x=o->op.u.image.pos.x;
+    y=o->op.u.image.pos.y;
+    x=x+(o->iData.w-w)/2.0;
+    y=y+(o->iData.h-h)/2.0;
+ //   glRasterPos3f(x,y,5);
+    glRasterPos3f(20,20,0);
+    if(o->iData.data)
+       glDrawPixels(o->iData.w,o->iData.h,GL_RGBA,GL_UNSIGNED_BYTE,o->iData.data);
 }
 void EmbedText(sdot_op* o, int param)
 {
@@ -945,6 +964,23 @@ void draw_sphere(float x, float y, float z, float r)
     glTranslatef(-x, -y, -z);
 }
 
+void draw_selpoly(glCompPoly* selPoly)
+{
+    int i=0;
+/*    glColor4f(view->gridColor.R, view->gridColor.G, view->gridColor.B,
+                 view->gridColor.A);*/
+    glDisable(GL_DEPTH_TEST);
+    glColor4f(1,0,0,1);
+    glBegin(GL_LINE_STRIP);
+    for (i;i <  selPoly->cnt ; i++)
+    {
+       glVertex3f(selPoly->pts[i].x,selPoly->pts[i].y,selPoly->pts[i].z);
+    }
+    glEnd();
+    glEnable(GL_DEPTH_TEST);
+
+}
+
 #ifdef UNUSED
 void draw_xdot_set(xdot_set * s)
 {
index 4eac8c0e76112ca17079cddc0e0906e4fcafba06..f283984270071464c2badde4ff3e26856926c310 100644 (file)
@@ -25,7 +25,7 @@ XDOT DRAWING FUNCTIONS, maybe need to move them somewhere else
 #include "colorprocs.h"
 #include "glutils.h"
 #include "math.h"
-#include "selection.h"
+
 #include "xdot.h"
 #include "viewport.h"
 #include "topfisheyeview.h"
@@ -253,48 +253,6 @@ static void drawXdotwithattrs(void *e, int param)
 
 
 
-void drawGraph(Agraph_t * g)
-{
-    Agnode_t *v;
-    Agedge_t *e;
-    Agraph_t *s;
-    int param = 0;
-    for (s = agfstsubg(g); s; s = agnxtsubg(s)) {
-/*             OD_SelFlag(s) = 0;
-               if (OD_Selected(s) == 1)
-                       param = 1;
-               else*/
-       param = 0;
-       drawXdotwithattrs(s, param);
-    }
-
-    for (v = agfstnode(g); v; v = agnxtnode(g, v)) {
-/*             if (OD_Selected(v) == 1)
-                       param = 1;
-               else*/
-       param = 0;
-//              OD_SelFlag(v) = 0;
-       drawXdotwithattr(v, "_draw_", param);   //draw primitives
-       drawXdotwithattr(v, "_ldraw_", param);  //label drawing
-       for (e = agfstout(g, v); e; e = agnxtout(g, e)) {
-/*                     OD_SelFlag(e) = 0;
-                       if (OD_Selected(e) == 1)
-                               param = 1;
-                       else*/
-           param = 0;
-           drawXdotwithattrs(e, param);
-       }
-    }
-    if ((view->Selection.Active > 0) && (!view->SignalBlock)) {
-       view->Selection.Active = 0;
-       drawGraph(g);
-       view->SignalBlock = 1;
-       glexpose();
-       view->SignalBlock = 0;
-    }
-
-}
-
 
 /*
        this function is used to cache fonts in view->fontset
index f0f657a6ba5977e2d81da57606b72c9d94b7279c..e35fa208207d4ef21d7c126430cec0e972b1d53d 100644 (file)
@@ -181,6 +181,7 @@ int glexpose_main(ViewInfo * view)
 //      drawRotatingTools();
 //      draw_cube();
     drawRotatingAxis();
+    draw_selpoly(&view->Topview->selPoly);
 //              draw_stuff();
 //      test_color_pallete();
 //      drawtestpoly();
index b24f81009f2ebcaa73c9b4ffc9f3b5ca25feb2a8..688855ee37703905016c594c9c59180b0f5a3d3c 100755 (executable)
@@ -24,7 +24,7 @@
 #include "glutils.h"
 #include "glexpose.h"
 #include "glmotion.h"
-#include "selection.h"
+
 #include "glcompset.h"
 #include "viewportcamera.h"
 #include "gui/menucallbacks.h"
index 3f5a736d2bfb5e8965c3106025bd12a82dfe1a17..516bccb485b776e7f3416a20157f3c1e6d9235df 100644 (file)
@@ -21,7 +21,7 @@
 #include "glmotion.h"
 #include "beacon.h"
 #include "hotkeymap.h"
-#include "selection.h"
+
 #include "selectionfuncs.h"
 #include "topviewfuncs.h"
 
@@ -50,7 +50,10 @@ static void apply_actions(ViewInfo* v,int x,int y)
        glmotion_pan(v);
     }
     if (a==MM_MOVE)
-        move_TVnodes();
+    {
+//        move_TVnodes();
+       ;
+    }
 
     if(a==MM_RECTANGULAR_SELECT)
     {
@@ -59,6 +62,12 @@ static void apply_actions(ViewInfo* v,int x,int y)
            pick_objects_rect(view->g[view->activeGraph]) ;
     }
 
+    if(a==MM_POLYGON_SELECT)
+    {
+       add_selpoly(view->g[view->activeGraph],&view->Topview->selPoly,view->mouse.GLfinalPos);
+    }
+
+
     if (a==MM_SINGLE_SELECT)
     {
        pick_object_xyz(view->g[view->activeGraph],view->Topview,view->mouse.GLfinalPos.x,view->mouse.GLfinalPos.y,view->mouse.GLfinalPos.z);
@@ -113,8 +122,8 @@ static void appmouse_down(ViewInfo* v,int x,int y)
     prevX=0;
     prevY=0;
 
-    view->Selection.X = view->mouse.GLpos.x;
-    view->Selection.Y = view->mouse.GLpos.y;
+/*    view->Selection.X = view->mouse.GLpos.x;
+    view->Selection.Y = view->mouse.GLpos.y;*/
 }
 static void appmouse_up(ViewInfo* v,int x,int y)
 {
index c78db4a7c7f6f7f3cd23a66073c19c2670001627..5e795621bd84ddfaf496851fe9e7b76e48afa61f 100644 (file)
@@ -25,7 +25,7 @@
 #include "topfisheyeview.h"
 #include "toolboxcallbacks.h"
 #include "viewportcamera.h"
-#include "selection.h"
+
 #include "frmobjectui.h"
 
 
index 27d1ca18a1cab1cca157326402417cfacad07dcd..95f6f1870d1e855a8250042bd817205bcf81d1e5 100755 (executable)
@@ -100,40 +100,6 @@ void object_properties_graph_init(void)    //customize window for Graph , this show
 }
 
 
-void graph_properties_init(int newgraph)       //initialize little open graph dialog
-{
-    //newgraph 0 : open graph mode
-    //newgraph 1 : new graph mode
-
-
-    gint result = 0;
-    xml = glade_xml_new(smyrnaGlade, NULL, NULL);
-    gladewidget = glade_xml_get_widget(xml, "entryGraphFileName");
-
-    //signals
-    //OK
-    gladewidget = glade_xml_get_widget(xml, "btnOK");
-
-
-    g_signal_connect((gpointer) gladewidget, "clicked",
-                    G_CALLBACK(dlgOpenGraph_OK_Clicked), &newgraph);
-
-
-
-    if (newgraph) {
-       gladewidget = glade_xml_get_widget(xml, "entryGraphName");
-       gtk_entry_set_text((GtkEntry *) gladewidget, "Untitled");
-       gladewidget = glade_xml_get_widget(xml, "entryGraphFileName");
-       gtk_entry_set_text((GtkEntry *) gladewidget, "Untitled.dot");
-    } else {
-       gladewidget = glade_xml_get_widget(xml, "entryGraphName");
-       gtk_entry_set_text((GtkEntry *) gladewidget, "");
-       gladewidget = glade_xml_get_widget(xml, "entryGraphFileName");
-       gtk_entry_set_text((GtkEntry *) gladewidget, "");
-    }
-    gladewidget = glade_xml_get_widget(xml, "dlgOpenGraph");
-    result = gtk_dialog_run(GTK_DIALOG(gladewidget));
-}
 
 GtkComboBox *get_SelectGraph(void)
 {
index d6366090b463088e578b23373b6f8fddb83fd17f..efac6a64e377d2a8deaa254b20767815f0cd3999 100755 (executable)
@@ -18,7 +18,7 @@
 #include "viewport.h"
 #include "topview.h"
 #include "tvnodes.h"
-#include "selection.h"
+
 #include "gvprpipe.h"
 #include "topviewsettings.h"
 #include "gltemplate.h"
@@ -310,52 +310,6 @@ void mSfdpSlot(GtkWidget * widget, gpointer user_data)
 
 
 
-//select
-void mSelectAllSlot(GtkWidget * widget, gpointer user_data)
-{
-    select_all(view->g[view->activeGraph]);
-}
-
-
-void mUnselectAllSlot(GtkWidget * widget, gpointer user_data)
-{
-    deselect_all(view->g[view->activeGraph]);
-}
-
-void mSelectAllNodesSlot(GtkWidget * widget, gpointer user_data)
-{
-    select_all_nodes(view->g[view->activeGraph]);
-}
-
-void mSelectAllEdgesSlot(GtkWidget * widget, gpointer user_data)
-{
-    select_all_edges(view->g[view->activeGraph]);
-}
-
-void mSelectAllClustersSlot(GtkWidget * widget, gpointer user_data)
-{
-    //select_all_graphs(view->g[view->activeGraph]);
-}
-
-
-void mUnselectAllNodesSlot(GtkWidget * widget, gpointer user_data)
-{
-    deselect_all_nodes(view->g[view->activeGraph]);
-}
-
-void mUnselectAllEdgesSlot(GtkWidget * widget, gpointer user_data)
-{
-    deselect_all_edges(view->g[view->activeGraph]);
-}
-
-
-void mUnselectAllClustersSlot(GtkWidget * widget, gpointer user_data)
-{
-//    deselect_all_graphs(view->g[view->activeGraph]);
-}
-
-
-//help
 void mAbout(GtkWidget * widget, gpointer user_data)
 {
 }
index deeded5a759b0c84e366b03f051f970a2f166530..76c8a1291a32f420f3e8a4e26119b2fe006251d3 100755 (executable)
 
 #include "toolboxcallbacks.h"
 #include "viewport.h"
-#include "selection.h"
+
 #include "gltemplate.h"
 #include "glutils.h"
 #include "glmotion.h"
 
 
 
-void btnToolSingleSelect_clicked(GtkWidget * widget, gpointer user_data)
-{
-    deselect_all(view->g[view->activeGraph]);
-    //gtk_toggle_tool_button_set_active   ((GtkToggleToolButton*)widget,1);
-}
-
-void btnToolRectSelect_clicked(GtkWidget * widget, gpointer user_data)
-{
-
-    deselect_all(view->g[view->activeGraph]);
-}
-
-void btnToolRectXSelect_clicked(GtkWidget * widget, gpointer user_data)
-{
-    deselect_all(view->g[view->activeGraph]);
-    view->Selection.Anti = 0;
-}
-
-void btnToolAntiRectSelect_clicked(GtkWidget * widget, gpointer user_data)
-{
-    view->Selection.Anti = 1;
-
-}
-
-void btnToolAntiRectXSelect_clicked(GtkWidget * widget, gpointer user_data)
-{
-    view->Selection.Anti = 1;
-
-}
-
-
-void btnToolPan_clicked(GtkWidget * widget, gpointer user_data)
-{
-
-
 
-}
-
-void btnToolZoom_clicked(GtkWidget * widget, gpointer user_data)
-{
-}
-
-void btnToolZoomIn_clicked(GtkWidget * widget, gpointer user_data)
-{
-    glmotion_zoom_inc(1);
-}
 
 void btnToolZoomOut_clicked(GtkWidget * widget, gpointer user_data)
 {
index 9605e3ca0712c3aff7bfbd580202b496fe2b8b1e..674c7701baa85d3c37cd3084a086864e7de2c9d1 100644 (file)
@@ -15,6 +15,10 @@ int static get_mouse_mode(const char* s)
        return MM_RECTANGULAR_SELECT;
     if (strcmp(s,"MM_RECTANGULAR_X_SELECT")==0)
        return MM_RECTANGULAR_X_SELECT;
+
+    if (strcmp(s,"MM_POLYGON_SELECT")==0)
+       return MM_POLYGON_SELECT;
+
     if (strcmp(s,"MM_MOVE")==0)
        return MM_MOVE;
     if (strcmp(s,"MM_MOVE")==0)
index a966a52fb4238ebdad42d1ef4ab810349a0547e5..d8144dcb15e65dbb1d8892e72f3d8eb9bfaf3f45 100644 (file)
@@ -1,21 +1,6 @@
-/* $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 "polytess.h"
 #include "xdot.h"
-
+tessPoly TP;
 #if 0
 GLdouble star[5][3] = { 0.6f,  -0.1f, 0.0f,
                         1.35f, 1.4f, 0.0f,
@@ -91,7 +76,10 @@ GLdouble complex[25][3] = { 0.0f, 0.0f, 0.0f,
 
 
 #endif
-void combineCallback(GLdouble coords[3], GLdouble *vertex_data[4],GLfloat weight[4], GLdouble **dataOut)
+#ifndef WIN32
+#define CALLBACK 
+#endif
+void CALLBACK combineCallback(GLdouble coords[3], GLdouble *vertex_data[4],GLfloat weight[4], GLdouble **dataOut)
 {
     GLdouble *vertex;
     int i;
@@ -111,7 +99,7 @@ void combineCallback(GLdouble coords[3], GLdouble *vertex_data[4],GLfloat weight
     *dataOut = vertex;
 }
 
-void vertexCallback(GLvoid *vertex)
+void CALLBACK vertexCallback(GLvoid *vertex)
 {
     GLdouble *ptr;
     ptr = (GLdouble *) vertex;
@@ -126,10 +114,10 @@ static GLUtesselator* Init()
     // Create a new tessellation object 
     GLUtesselator* tobj = gluNewTess(); 
     // Set callback functions
-    gluTessCallback(tobj, GLU_TESS_VERTEX, (void*)&vertexCallback);
+    gluTessCallback(tobj, GLU_TESS_VERTEX, &vertexCallback);
     gluTessCallback(tobj, GLU_TESS_BEGIN, &glBegin);
     gluTessCallback(tobj, GLU_TESS_END, &glEnd);
-    gluTessCallback(tobj, GLU_TESS_COMBINE,(void*)&combineCallback);
+    gluTessCallback(tobj, GLU_TESS_COMBINE,&combineCallback);
     return tobj;
 }
 
@@ -147,16 +135,16 @@ static int Render_Contour2(GLUtesselator *tobj,sdot_op* p)
 {
     GLdouble** d;
     int x=0;
-    /* int y=0; */
+    int y=0;
 
     d=(GLdouble**) malloc(sizeof(GLdouble)* p->op.u.polygon.cnt);
     for (x=0;x < p->op.u.polygon.cnt; x++)
     {
-       /* GLdouble temp; */
+       GLdouble temp;
        d[x]=(GLdouble*)(malloc(sizeof(GLdouble)*3));
        d[x][0]=p->op.u.polygon.pts[x].x;
        d[x][1]=p->op.u.polygon.pts[x].y;
-       d[x][2]=p->op.u.polygon.pts[x].z;
+       d[x][2]=p->op.u.polygon.pts[x].z+view->Topview->global_z;
     }
     for (x = 0; x < p->op.u.polygon.cnt; x++) //loop through the vertices
     {
@@ -175,7 +163,6 @@ static int Render_Contour2(GLUtesselator *tobj,sdot_op* p)
     return(1);
 
 }
-#if 0
 static int Render_Contour(GLUtesselator *tobj, GLdouble obj_data[][3],int cnt)
 {
 
@@ -184,13 +171,13 @@ static int Render_Contour(GLUtesselator *tobj, GLdouble obj_data[][3],int cnt)
 //    GLdouble d[1][3];
     static GLdouble**d;
     int x=0;
-    /* int y=0; */
+    int y=0;
     if (!d)
     {
        d=(GLdouble**) malloc(sizeof(GLdouble)* cnt);
        for (x=0;x < cnt; x++)
        {
-           /* GLdouble temp; */
+           GLdouble temp;
            d[x]=(GLdouble*)(malloc(sizeof(GLdouble)*3));
            d[x][0]=obj_data[x][0];
            d[x][1]=obj_data[x][1];
@@ -224,7 +211,11 @@ static int Render_Contour(GLUtesselator *tobj, GLdouble obj_data[][3],int cnt)
     return(1);
 
 }
-#endif
+
+
+
+
+
 
 static int Begin_Polygon(GLUtesselator *tobj)
 {
@@ -258,7 +249,6 @@ static int freeTes(GLUtesselator *tobj)
 }
 int drawTessPolygon(sdot_op* p)
 {
-    static tessPoly TP;
     if (!TP.tobj)
     {
        TP.tobj=Init();
index 6e6a640ff39c767279edf5ec0e97477b9d04a278..e8354ebcbcb4db34f3ba6558d455b8abc169e782 100755 (executable)
@@ -777,3 +777,16 @@ float distance_to_line(float ax, float ay, float bx, float by, float cx,
             / (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;
+    }
+
index a70ee24d64a2404f58f87cbc8dfbf1f19bd76c78..75e751083ab84dacdf1dfc430f0f17e92d866030 100644 (file)
@@ -34,7 +34,7 @@ static void select_node(Agraph_t* g,Agnode_t*  obj,int reverse)
        {
             agxset(obj,sel_attr,"0");
            ((nodeRec*)(aggetrec(obj,"nodeRec",0)))->selected=0;
-           ((edgeRec*)(aggetrec(obj,"nodeRec",0)))->printLabel=0;
+           ((nodeRec*)(aggetrec(obj,"nodeRec",0)))->printLabel=0;
 
 
        }
@@ -176,8 +176,6 @@ void pick_object_xyz(Agraph_t* g,topview* t,GLfloat x,GLfloat y,GLfloat z)
        cacheSelectedEdges(g,t);
        ((edgeRec*)(aggetrec(a,"edgeRec",0)))->printLabel=1;
     }
-
-
 }
 void pick_objects_rect(Agraph_t* g) 
 {
@@ -213,3 +211,82 @@ void pick_objects_rect(Agraph_t* g)
 }
 
 
+
+void deselect_all(Agraph_t* g)
+{
+    static Agnode_t *v;
+    static Agedge_t *e;
+    static Agsym_t* nsel_attr=(Agsym_t*)0;
+    static Agsym_t* esel_attr=(Agsym_t*)0;
+    if(!nsel_attr)
+       nsel_attr=agattr(g, AGNODE,"selected","0");
+    if(!esel_attr)
+       esel_attr=agattr(g, AGEDGE,"selected","0");
+    for (v = agfstnode(g); v; v = agnxtnode(g, v)) 
+    {
+       agxset(v,nsel_attr,"0");
+       ((nodeRec*)(aggetrec(v,"nodeRec",0)))->selected=0;
+       ((edgeRec*)(aggetrec(v,"nodeRec",0)))->printLabel=0;
+
+       for (e = agfstout(g, v); e; e = agnxtout(g, e)) 
+       {
+           agxset(e,esel_attr,"0");
+           ((edgeRec*)(aggetrec(e,"edgeRec",0)))->selected=0;
+           ((edgeRec*)(aggetrec(e,"edgeRec",0)))->printLabel=0;
+       }
+    }
+    cacheSelectedNodes(g,view->Topview);
+    cacheSelectedEdges(g,view->Topview);
+
+}
+void clear_selpoly(glCompPoly* sp)
+{
+    sp->pts=realloc(sp->pts,0);
+    sp->cnt=0;
+}
+static int close_poly(glCompPoly* selPoly,glCompPoint pt)
+{
+    int i=0;
+    float EPS=GetOGLDistance(3);
+    if (selPoly->cnt < 2)
+       return 0;
+    if(
+       ( (selPoly->pts[0].x-pt.x) < EPS) &&
+       ( (selPoly->pts[0].y-pt.y) < EPS))
+       return 1;
+    return 0;
+}
+
+
+static void select_polygon (Agraph_t* g,glCompPoly* selPoly)
+{
+    static Agnode_t *v;
+    static glCompPoint posN;
+     
+     for (v = agfstnode(g); v; v = agnxtnode(g, v)) 
+    {
+       posN=((nodeRec*)(aggetrec(v,"nodeRec",0)))->A;
+       if(point_in_polygon(selPoly,posN))
+           select_node(g,v,0);
+    }
+    cacheSelectedNodes(g,view->Topview);
+}
+
+
+void add_selpoly(Agraph_t* g,glCompPoly* selPoly,glCompPoint pt)
+{
+    if(!close_poly(selPoly,pt))
+    {
+       selPoly->cnt ++;
+       selPoly->pts=realloc(selPoly->pts,sizeof(glCompPoint)*selPoly->cnt);
+       selPoly->pts[selPoly->cnt-1].x=pt.x;
+       selPoly->pts[selPoly->cnt-1].y=pt.y;
+       selPoly->pts[selPoly->cnt-1].z=0;
+    }
+    else
+    {
+       select_polygon (g,selPoly);
+       clear_selpoly(selPoly); 
+    }
+}
+
index 3a5cbc7e3d02f409076c9070c6be01a644df4fcc..4a70b245861e03e378e209d8ec6a4642811067db 100644 (file)
 #ifdef __cplusplus
 extern "C" {
 #endif
-extern void pick_objects_rect(Agraph_t* g) ;
 
+extern void pick_objects_rect(Agraph_t* g) ;
+extern void deselect_all(Agraph_t* g);
+extern void add_selpoly(Agraph_t* g,glCompPoly* selPoly,glCompPoint pt);
 #ifdef __cplusplus
 }                              /* end extern "C" */
 #endif
index 137a294b16cf0f809f220247c619f90642f37f1c..d4390ef082d36b737048df3b4f843b9dc38b832e 100644 (file)
                                RelativePath=".\arcball.c"
                                >
                        </File>
-                       <File
-                               RelativePath=".\gui\beacon.c"
-                               >
-                       </File>
                        <File
                                RelativePath=".\btree.c"
                                >
                        </File>
-                       <File
-                               RelativePath=".\gui\callbacks.c"
-                               >
-                       </File>
                        <File
                                RelativePath=".\gui\datalistcallbacks.c"
                                >
                                RelativePath=".\polytess.c"
                                >
                        </File>
-                       <File
-                               RelativePath=".\selection.c"
-                               >
-                       </File>
                        <File
                                RelativePath=".\selectionfuncs.c"
                                >
index a5df9467e55ae7d9e8ad8aa34d43109166d9cbf9..8a66275dc1cd8077ffab22e27e33391c3581fceb 100644 (file)
@@ -11,7 +11,7 @@
                        <DebugSettings
                                Command="$(TargetPath)"
                                WorkingDirectory="C:\graphviz-ms\bin"
-                               CommandArguments=""
+                               CommandArguments="c:\4elt.dot"
                                Attach="false"
                                DebuggerType="3"
                                Remote="1"
index ca0555e1b9935fc2d5105f9d46296cafa08659ad..2dd0963f6dfac11ee165519f1cbef3cc00b445dc 100644 (file)
@@ -196,3 +196,64 @@ getcolorfromschema(colorschemaset * sc, float l, float maxl,glCompColor * c)
     }
 }
 #endif
+
+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;
+    }
+
+
+int point_in_polygon(glCompPoly* selPoly,glCompPoint p)
+{
+    int npol=selPoly->cnt;
+
+    int i, j, c = 0;
+      for (i = 0, j = npol-1; i < npol; j = i++) 
+      {
+        if ((((selPoly->pts[i].y <= p.y) && (p.y < selPoly->pts[j].y)) ||
+             ((selPoly->pts[j].y <= p.y) && (p.y < selPoly->pts[i].y))) &&
+            (p.x < (selPoly->pts[j].x - selPoly->pts[i].x) * (p.y - selPoly->pts[i].y) / (selPoly->pts[j].y - selPoly->pts[i].y) + selPoly->pts[i].x))
+          c = !c;
+      }
+      return c;
+    }
+
+
index e5e3e23e8501869d04deda9f853884f78a27ef1c..1f2ce53458f26d2a700e2caad374a7ab3e595136 100644 (file)
@@ -28,5 +28,6 @@ extern char* getAttrStr(Agraph_t* g,void* obj,char* attr_name,char* def);
 extern void setColor(glCompColor* c,GLfloat R,GLfloat G,GLfloat B,GLfloat A);
 extern void getcolorfromschema(colorschemaset * sc, float l, float maxl,glCompColor * c);
 extern glCompPoint getPointFromStr(char* str);
-
+extern float distance_to_line(float ax, float ay, float bx, float by, float cx,float cy);
+extern int point_in_polygon(glCompPoly* selPoly,glCompPoint p);
 #endif
index e54c8769c20323826a0c408f136b420f059a9ef4..32547d32b4ee05be3e93006b03b51557be745a3a 100644 (file)
@@ -72,6 +72,7 @@ typedef struct _ArcBall_t ArcBall_t;
 #define MM_MAGNIFIER                   20
 #define MM_FISHEYE_MAGNIFIER   21
 #define MM_FISHEYE_PICK                22  /*fisheye select foci point*/
+#define MM_POLYGON_SELECT   30
 
 
 
@@ -146,6 +147,12 @@ typedef struct
            MOUSE_ROTATE_Z } mouse_rotate_axis;
 
 
+    typedef struct
+    {
+       unsigned char *data;
+       int w;
+       int h;
+    }image_data;
     typedef struct 
        {
                xdot_op op;
@@ -154,7 +161,7 @@ typedef struct
                int size;
                int layer;
                int listId;/*opengl list id*/
-
+               image_data iData;
     } sdot_op; 
        
        
@@ -450,6 +457,8 @@ typedef struct
 
        topviewcache cache;
        int xdotId;
+       glCompPoly selPoly;
+
 
 
     } topview;
@@ -494,7 +503,7 @@ typedef struct
 
     } attribute;
 
-    typedef struct _selection {
+/*    typedef struct _selection {
        int Active;             //0 there is no selection need to be applied
        char Type;              //0     single selection , 1 rectangle , 2 rectangleX 
        int PickingType;        //0 normal, union,2 subtract 3 intersection
@@ -507,7 +516,7 @@ typedef struct
        //before the node/edge loop this value is nulled
        topview_edge *single_selected_edge;     //pointer to selected/picked edge
 
-    } selection;
+    } selection;*/
     typedef struct _magnifier {
        float x, y;
        float kts;              //zoom X
@@ -612,7 +621,7 @@ typedef struct
        glCompMouse mouse;
 
        /*selection object,refer to smyrnadefs.h for more info */
-       selection Selection;
+//     selection Selection;
 
        /*rectangular magnifier object */
        magnifier mg;
index 2beeca95ac9ef0892da9d06665469b03f16dcc33..7720aaf17cff421c1a1c888cbc31cf17cb58dc0d 100644 (file)
@@ -22,7 +22,7 @@
 #include "viewport.h"
 #include "viewportcamera.h"
 #include "draw.h"
-#include "selection.h"
+
 #include "assert.h"
 #include "hier.h"
 #include "topfisheyeview.h"
index 210a0fb2b42c7d060898f3e9cca3bbe545cb8326..3fccd7d530fd9eb2429b119ad9b663453bf34776 100644 (file)
@@ -140,16 +140,11 @@ int object_color(void* obj,glCompColor* c)
     objType=AGTYPE(obj);
 
     if(objType==AGEDGE)
-       Alpha=getAttrFloat(g,obj,"defaultedgealpha",1);
+       Alpha=getAttrFloat(g,agraphof(obj),"defaultedgealpha",1);
     if(objType==AGNODE)
-       Alpha=getAttrFloat(g,obj,"defaultnodealpha",1);
+       Alpha=getAttrFloat(g,agraphof(obj),"defaultnodealpha",1);
     if(!getAttrBool(g,obj,"visible",1))
        return 0;
-    if(getAttrBool(g,obj,"selected",0))
-    {
-       setColor(c,view->selectedEdgeColor.R, view->selectedEdgeColor.G,view->selectedEdgeColor.B, view->selectedEdgeColor.A);
-       return return_value;
-    }
     /*get edge's color attribute */
     bf=getAttrStr(g,obj,"color",NULL);
     if((bf)&&(strlen(bf)>0))
@@ -173,6 +168,7 @@ int object_color(void* obj,glCompColor* c)
            c->B=cl.u.RGBA[2];
            c->A=cl.u.RGBA[3];
        }
+       c->A=c->A*Alpha;
 
     }
     return return_value;
@@ -237,7 +233,7 @@ void renderSelectedNodes(Agraph_t * g)
        if(!((nodeRec*)(aggetrec(v,"nodeRec",0)))->selected);
            continue;
        x=parseXdotwithattrs(v);
-       draw_xdot(x,0);
+       draw_xdot(x,-1);
        if(x)
            freeXDot (x);
     }
@@ -247,7 +243,7 @@ void renderSelectedNodes(Agraph_t * g)
     {
        if(!((nodeRec*)(aggetrec(v,"nodeRec",0)))->selected)
            continue;
-       glColor4f(1,0,0,1);         
+       glColor4f(view->selectedEdgeColor.R, view->selectedNodeColor.G,view->selectedNodeColor.B, view->selectedNodeColor.A);
        pos=((nodeRec*)(aggetrec(v,"nodeRec",0)))->A;
        nodeSize=((nodeRec*)(aggetrec(v,"nodeRec",0)))->size;
 
@@ -275,11 +271,10 @@ void renderNodes(Agraph_t * g)
     static int defaultNodeShape=0;
     static GLfloat nodeSize=0;
     static glCompColor c;
-    static xdot * x;
+    xdot * x;
 
 
-    if(!defaultNodeShape)
-       defaultNodeShape=getAttrBool(g,g,"defaultnodeshape",0);
+    defaultNodeShape=getAttrBool(g,g,"defaultnodeshape",0);
     if(!pos_attr)
        pos_attr=agattr(g, AGNODE,"pos",0);
     if(!size_attr)
@@ -287,15 +282,13 @@ void renderNodes(Agraph_t * g)
     if(!selected_attr)
        selected_attr=agattr(g, AGNODE,"selected",0);
 
-    if(defaultNodeShape==0)
-       glBegin(GL_POINTS);
 
     for (v = agfstnode(g); v; v = agnxtnode(g, v)) 
     {
            if(!object_color(v,&c))
                continue;
            x=parseXdotwithattrs(v);
-           draw_xdot(x,0);
+           draw_xdot(x,-0.1);
 
 
            if(x)
@@ -304,6 +297,15 @@ void renderNodes(Agraph_t * g)
 
 
 
+    if(defaultNodeShape==0)
+       glBegin(GL_POINTS);
+
+
+
+
+
+
+
 
     for (v = agfstnode(g); v; v = agnxtnode(g, v)) 
     {
@@ -319,7 +321,6 @@ void renderNodes(Agraph_t * g)
        if(l_int(v, selected_attr,0))
        {
            ((nodeRec*)(aggetrec(v,"nodeRec",0)))->selected=1;
-           continue;
        }
        glColor4f(c.R,c.G,c.B,c.A);         
        pos=getPointFromStr(agxget(v, pos_attr));
@@ -422,10 +423,6 @@ void renderEdges(Agraph_t * g)
            }
            else
                ((edgeRec*)(aggetrec(e,"edgeRec",0)))->visible=1;
-
-           if(((edgeRec*)(aggetrec(e,"edgeRec",0)))->selected)
-               continue;
-
            x=parseXdotwithattrs(e);
            draw_xdot(x,0);
 
@@ -549,14 +546,22 @@ void renderEdgeLabels(Agraph_t * g)
 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;
+    int cnt=0;
+    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);
+    if(xDot)
+    {
+       for (cnt=0;cnt < xDot->cnt ; cnt++)
+       {
+           ((sdot_op*)(xDot->ops))[cnt].obj=e;
+        }
+    }
+    return xDot;
 
 }
 
@@ -641,8 +646,8 @@ void updateSmGraph(Agraph_t * g,topview* t)
     t->picked_edge_count = 0;
     t->picked_edges = '\0';
     t->global_z=0;
-
-
+    t->selPoly.cnt=0;
+    t->selPoly.pts=NULL;
 
     if(!t)
        return ;
index ffbe4ebe2162944b37a7b2d1f3adf17da7b81722..844815cd7be4c027dbeb01c4fcd17bf35f2dc460 100755 (executable)
@@ -18,7 +18,7 @@
 #include "tvnodes.h"
 #include "btree.h"
 #include "viewport.h"
-#include "selection.h"
+
 #include "memory.h"
 
 tv_nodes TV_Nodes;
@@ -463,7 +463,7 @@ int create_save_subgraph_from_filter(char *filename)
 
 int update_TV_data_from_gui(void)
 {
-    int i;
+/*    int i;
     int index = 0;
     char *data_attr1;
     char *data_attr2;
@@ -498,7 +498,7 @@ int update_TV_data_from_gui(void)
                  (char *) gtk_entry_get_text(TV_Nodes.TV_Node[i].Data2));
 
        }
-    }
+    }*/
     return 1;
 
 
@@ -575,7 +575,7 @@ static int cache_validate_node(tv_node * tvn)
 int tv_select_all(void)
 {
 
-    tv_node tvn;
+/*    tv_node tvn;
     int i;
     for (i = 0; i < view->Topview->Nodecount; i++) {
        tvn.index = i;
@@ -584,13 +584,13 @@ int tv_select_all(void)
        }
     }
     apply_filter_from_gui();
-    return 1;
+    return 1;*/
 
 }
 
 int tv_unselect_all()
 {
-
+/*
     tv_node tvn;
     int i;
     for (i = 0; i < view->Topview->Nodecount; i++) {
@@ -600,7 +600,7 @@ int tv_unselect_all()
        }
     }
     apply_filter_from_gui();
-    return 1;
+    return 1;*/
 
 }
 
index 322a3e60ef90063cc09340b01512d34af1c00169..0dd798d4a3dc1e67ea003481f4dc138cffd14ec1 100755 (executable)
@@ -462,12 +462,6 @@ void init_viewport(ViewInfo * view)
     view->mouse.down = 0;
     view->activeGraph = -1;
     view->SignalBlock = 0;
-    view->Selection.Active = 0;
-    view->Selection.SelectionColor.R = 0.5;
-    view->Selection.SelectionColor.G = (float) 0.2;
-    view->Selection.SelectionColor.B = 1;
-    view->Selection.SelectionColor.A = 1;
-    view->Selection.Anti = 0;
     view->Topview = GNEW(topview);
     view->Topview->fisheyeParams.fs = 0;
     view->Topview->xDot=NULL;
@@ -612,7 +606,7 @@ static Agraph_t *loadGraph(char *filename)
        g_print("There is no position info in %s\n", filename);
        return 0;
     }
-    free(view->Topview->Graphdata.GraphFileName);
+//    free(view->Topview->Graphdata.GraphFileName);
     view->Topview->Graphdata.GraphFileName = strdup(filename);
     return g;
 }
index c988c7eb44cb0c2dfa8e0054db2a301b8f6cfcdc..f3c1aadfa640810ccd11d4aeb673ac5101d2cf3a 100644 (file)
@@ -40,7 +40,7 @@
                                Name="VCCLCompilerTool"
                                Optimization="0"
                                AdditionalIncludeDirectories="&quot;C:\gtk\lib\glib-2.0\include&quot;;&quot;C:\gtk\include\glib-2.0&quot;;&quot;C:\gtk\include\pango-1.0\&quot;;C:\gtk\include\cairo;C:\gtk\include\freetype2;C:\gtk\include;&quot;$(SolutionDir)/libltdl&quot;;&quot;$(SolutionDir)/lib/neatogen&quot;;&quot;$(SolutionDir)/lib/agutil&quot;;&quot;$(SolutionDir)/windows/lib/cdt&quot;;&quot;$(SolutionDir)/&quot;;&quot;$(SolutionDir)/lib/graph&quot;;&quot;$(SolutionDir)/lib/vpsc&quot;;&quot;$(SolutionDir)/lib/vmalloc&quot;;&quot;$(SolutionDir)/lib/twopigen&quot;;&quot;$(SolutionDir)/lib/sparse&quot;;&quot;$(SolutionDir)/lib/sfio&quot;;&quot;$(SolutionDir)/lib/sfpdpgen&quot;;&quot;$(SolutionDir)/lib/rbtree&quot;;&quot;$(SolutionDir)/lib/pathplan&quot;;&quot;$(SolutionDir)/lib/patchwork&quot;;&quot;$(SolutionDir)/lib/pack&quot;;&quot;$(SolutionDir)/lib/ortho&quot;;&quot;$(SolutionDir)/lib/inkpot&quot;;&quot;$(SolutionDir)/lib/ingraphs&quot;;&quot;$(SolutionDir)/lib/gd&quot;;&quot;$(SolutionDir)/lib/filter&quot;;&quot;$(SolutionDir)/lib/fdpgen&quot;;&quot;$(SolutionDir)/lib/expr&quot;;&quot;$(SolutionDir)/lib/dotgen&quot;;&quot;$(SolutionDir)/lib/circogen&quot;;&quot;$(SolutionDir)/lib/ast&quot;;&quot;$(SolutionDir)/lib/agraph&quot;;&quot;$(SolutionDir)/lib/common&quot;;&quot;$(SolutionDir)/lib/gvc&quot;;&quot;$(SolutionDir)/lib/cdt&quot;;&quot;$(SolutionDir)/lib/cgraph&quot;"
-                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CDT_EXPORTS;WIN32_DLL"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CDT_EXPORTS;WIN32_DLL;_BLD_cdt ;__EXPORT__"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
                        <Tool
                                Name="VCCLCompilerTool"
                                AdditionalIncludeDirectories="&quot;C:\gtk\lib\glib-2.0\include&quot;;&quot;C:\gtk\include\glib-2.0&quot;;&quot;C:\gtk\include\pango-1.0\&quot;;C:\gtk\include\cairo;C:\gtk\include\freetype2;C:\gtk\include;&quot;$(SolutionDir)/libltdl&quot;;&quot;$(SolutionDir)/lib/neatogen&quot;;&quot;$(SolutionDir)/lib/agutil&quot;;&quot;$(SolutionDir)/windows/lib/cdt&quot;;&quot;$(SolutionDir)/&quot;;&quot;$(SolutionDir)/lib/graph&quot;;&quot;$(SolutionDir)/lib/vpsc&quot;;&quot;$(SolutionDir)/lib/vmalloc&quot;;&quot;$(SolutionDir)/lib/twopigen&quot;;&quot;$(SolutionDir)/lib/sparse&quot;;&quot;$(SolutionDir)/lib/sfio&quot;;&quot;$(SolutionDir)/lib/sfpdpgen&quot;;&quot;$(SolutionDir)/lib/rbtree&quot;;&quot;$(SolutionDir)/lib/pathplan&quot;;&quot;$(SolutionDir)/lib/patchwork&quot;;&quot;$(SolutionDir)/lib/pack&quot;;&quot;$(SolutionDir)/lib/ortho&quot;;&quot;$(SolutionDir)/lib/inkpot&quot;;&quot;$(SolutionDir)/lib/ingraphs&quot;;&quot;$(SolutionDir)/lib/gd&quot;;&quot;$(SolutionDir)/lib/filter&quot;;&quot;$(SolutionDir)/lib/fdpgen&quot;;&quot;$(SolutionDir)/lib/expr&quot;;&quot;$(SolutionDir)/lib/dotgen&quot;;&quot;$(SolutionDir)/lib/circogen&quot;;&quot;$(SolutionDir)/lib/ast&quot;;&quot;$(SolutionDir)/lib/agraph&quot;;&quot;$(SolutionDir)/lib/common&quot;;&quot;$(SolutionDir)/lib/gvc&quot;;&quot;$(SolutionDir)/lib/cdt&quot;;&quot;$(SolutionDir)/lib/cgraph&quot;"
-                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CDT_EXPORTS;WIN32_DLL"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CDT_EXPORTS;WIN32_DLL;_BLD_cdt;__EXPORT__"
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
                                WarningLevel="0"
index 529b9b877e7281580f419c74d7abb08234e8619b..e6444a85b6d75a92b73ddc0ed94e574749517036 100644 (file)
@@ -40,7 +40,7 @@
                                Name="VCCLCompilerTool"
                                Optimization="0"
                                AdditionalIncludeDirectories="&quot;C:\gtk\lib\glib-2.0\include&quot;;&quot;C:\gtk\include\glib-2.0&quot;;&quot;C:\gtk\include\pango-1.0\&quot;;C:\gtk\include\cairo;C:\gtk\include\freetype2;C:\gtk\include;&quot;$(SolutionDir)/libltdl&quot;;&quot;$(SolutionDir)/lib/neatogen&quot;;&quot;$(SolutionDir)/lib/agutil&quot;;&quot;$(SolutionDir)/windows/lib/cdt&quot;;&quot;$(SolutionDir)/&quot;;&quot;$(SolutionDir)/lib/graph&quot;;&quot;$(SolutionDir)/lib/vpsc&quot;;&quot;$(SolutionDir)/lib/vmalloc&quot;;&quot;$(SolutionDir)/lib/twopigen&quot;;&quot;$(SolutionDir)/lib/sparse&quot;;&quot;$(SolutionDir)/lib/sfio&quot;;&quot;$(SolutionDir)/lib/sfpdpgen&quot;;&quot;$(SolutionDir)/lib/rbtree&quot;;&quot;$(SolutionDir)/lib/pathplan&quot;;&quot;$(SolutionDir)/lib/patchwork&quot;;&quot;$(SolutionDir)/lib/pack&quot;;&quot;$(SolutionDir)/lib/ortho&quot;;&quot;$(SolutionDir)/lib/inkpot&quot;;&quot;$(SolutionDir)/lib/ingraphs&quot;;&quot;$(SolutionDir)/lib/gd&quot;;&quot;$(SolutionDir)/lib/filter&quot;;&quot;$(SolutionDir)/lib/fdpgen&quot;;&quot;$(SolutionDir)/lib/expr&quot;;&quot;$(SolutionDir)/lib/dotgen&quot;;&quot;$(SolutionDir)/lib/circogen&quot;;&quot;$(SolutionDir)/lib/ast&quot;;&quot;$(SolutionDir)/lib/agraph&quot;;&quot;$(SolutionDir)/lib/common&quot;;&quot;$(SolutionDir)/lib/gvc&quot;;&quot;$(SolutionDir)/lib/cdt&quot;;&quot;$(SolutionDir)/lib/cgraph&quot;"
-                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CGRAPH_EXPORTS;WIN32_DLL;HAVE_CONFIG_H;YY_NO_UNISTD_H"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CGRAPH_EXPORTS;WIN32_DLL;HAVE_CONFIG_H;YY_NO_UNISTD_H;_DLL_BLD;_dll_import"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
index a4efdd2aff65ee56743787a822e8023ea9b9f5be..3a331ba0f70ae9b555cdf332996194a75627fee5 100644 (file)
@@ -178,7 +178,10 @@ extern "C" {
     typedef struct _glCompPointI {
        int x, y;
     } glCompPointI;
-
+    typedef struct {
+       int cnt;
+       glCompPoint* pts;
+    }glCompPoly;
 
     typedef struct {
        GLfloat R;
@@ -186,6 +189,7 @@ extern "C" {
        GLfloat B;
        GLfloat A;              //Alpha
        int tag;
+       int test;
     } glCompColor;
 
 
index ef3c5f46fe5c54813308490eb7c63a81ca7f955c..46d4fbb3d1f169d00ca06feaaed84380c2d44d07 100644 (file)
@@ -197,7 +197,7 @@ void delete_font(glCompFont * f)
 
 glCompFont *new_font(glCompSet * s, char *text, glCompColor * c,glCompFontType type, char *fontdesc, int fs,int is2D)
 {
-    glCompFont *font = NEW(glCompFont);
+    glCompFont *font = (glCompFont*) malloc(sizeof(glCompFont));
     font->reference = 0;
     font->color.R = c->R;
     font->color.G = c->G;
index ff1abd31fa30108bafffda2cb4693b78fcb88897..10b185a829b80e9a9829932f4eedbca731484ee2 100644 (file)
@@ -728,44 +728,3 @@ int is_point_in_rectangle(float X, float Y, float RX, float RY, float RW,float R
 
 
 
-#ifdef DEBUG
-void main(void)
-{
-    glCompPoint LineStart, LineEnd, Point;
-    float Distance;
-
-
-    LineStart.x = 50.0f;
-    LineStart.y = 80.0f;
-    LineStart.z = 300.0f;
-    LineEnd.x = 50.0f;
-    LineEnd.y = -800.0f;
-    LineEnd.z = 1000.0f;
-    Point.x = 20.0f;
-    Point.y = 1000.0f;
-    Point.z = 400.0f;
-
-    if (DistancePointLine(&Point, &LineStart, &LineEnd, &Distance))
-       printf("closest point falls within line segment, distance = %f\n",
-              Distance);
-    else
-       printf("closest point does not fall within line segment\n");
-
-
-    LineStart.x = 0.0f;
-    LineStart.y = 0.0f;
-    LineStart.z = 50.0f;
-    LineEnd.x = 0.0f;
-    LineEnd.y = 0.0f;
-    LineEnd.z = -50.0f;
-    Point.x = 10.0f;
-    Point.y = 50.0f;
-    Point.z = 10.0f;
-
-    if (DistancePointLine(&Point, &LineStart, &LineEnd, &Distance))
-       printf("closest point falls within line segment, distance = %f\n",
-              Distance);
-    else
-       printf("closest point does not fall within line segment\n");
-}
-#endif
index 627aeee8dc80a6f4092483d11cca7e5b189890eb..3b5cf9d44f7247df826ae0c82a966741a909f986 100644 (file)
@@ -335,4 +335,5 @@ xdotBB
 gvFinalize
 gv_postprocess
 gvRenderContext
-gvflush
\ No newline at end of file
+gvflush
+gvrender_ptf
\ No newline at end of file
index 2f185107827017deb3fab95d614d78c1612b122d..f1d62efb0afc839cce42b85b037c87468f140f11 100644 (file)
@@ -3,6 +3,7 @@
 #MM_ROTATE
 #MM_SINGLE_SELECT
 #MM_RECTANGULAR_SELECT
+#MM_POLYGON_SELECT
 #MM_MOVE
 #MM_FISHEYE_MAGNIFIER
 #keys:These are pre defined keys in the code , more keys can be added by using their GTK key event correspondants, 0 means no key
@@ -31,4 +32,5 @@ MM_SINGLE_SELECT,0,NO_FISHEYE,RIGHT,0
 MM_RECTANGULAR_SELECT,0,ALL,RIGHT,1 
 MM_MOVE,B_LCTRL,2D,LEFT,1 
 MM_FISHEYE_MAGNIFIER,B_LSHIFT,2D,LEFT,1 
-MM_FISHEYE_PICK,0,FISHEYE,RIGHT,0 
\ No newline at end of file
+MM_FISHEYE_PICK,0,FISHEYE,RIGHT,0 
+MM_POLYGON_SELECT,B_LCTRL,NO_FISHEYE,RIGHT,0