]> granicus.if.org Git - graphviz/commitdiff
smyrna polygon selection improvement
authorarif <devnull@localhost>
Wed, 3 Mar 2010 19:23:10 +0000 (19:23 +0000)
committerarif <devnull@localhost>
Wed, 3 Mar 2010 19:23:10 +0000 (19:23 +0000)
cmd/smyrna/draw.c
cmd/smyrna/gltemplate.c
cmd/smyrna/gui/appmouse.c
cmd/smyrna/gui/appmouse.h
cmd/smyrna/hotkeymap.c
cmd/smyrna/hotkeymap.h
cmd/smyrna/smyrna.vcproj.RESEARCH.arif.user
lib/glcomp/glcompdefs.h

index 615271d89313ede6dea3ad1506eb0d09931f6dbe..61b806b2659bf710392e4f5a29423e5d74429aca 100755 (executable)
@@ -977,8 +977,16 @@ void draw_selpoly(glCompPoly* selPoly)
        glVertex3f(selPoly->pts[i].x,selPoly->pts[i].y,selPoly->pts[i].z);
     }
     glEnd();
+    if(selPoly->cnt >0)
+    {
+        glBegin(GL_LINE_STRIP);
+       glVertex3f(selPoly->pts[selPoly->cnt-1].x,selPoly->pts[selPoly->cnt-1].y,selPoly->pts[selPoly->cnt-1].z);
+       glVertex3f(view->mouse.GLpos.x,view->mouse.GLpos.y,0);
+       glEnd();
+    }
     glEnable(GL_DEPTH_TEST);
 
+
 }
 
 #ifdef UNUSED
index 688855ee37703905016c594c9c59180b0f5a3d3c..33ecc7943bdd54bc5371aca9f57a35657e903c05 100755 (executable)
@@ -325,20 +325,17 @@ static gboolean button_release_event(GtkWidget * widget,
 }
 static gboolean key_press_event(GtkWidget * widget, GdkEventKey * event, gpointer data)
 {
-    view->keymap.down=1;
-    view->keymap.keyVal=event->keyval;
-        return FALSE;
+    appmouse_key_press(view,event->keyval);
+    return FALSE;
+
 
 
 
 }
 static gboolean key_release_event(GtkWidget * widget, GdkEventKey * event, gpointer data)
 {
- //   printf ("key is released:%d\n",event->keyval);
-    view->keymap.down=0;
-    view->keymap.keyVal=0;
-        return FALSE;
-
+    appmouse_key_release(view,event->keyval);
+    return FALSE;
 
 }
 
@@ -382,6 +379,8 @@ static gboolean motion_notify_event(GtkWidget * widget,
     dy = y - begin_y;
     view->mouse.dragX = dx;
     view->mouse.dragY = dy;
+    appmouse_move(view,(int)event->x,(int)event->y);
+
     if((view->mouse.t==glMouseLeftButton) && (view->mouse.down)  )
     {
        appmouse_left_drag(view,(int)event->x,(int)event->y);
@@ -398,6 +397,8 @@ static gboolean motion_notify_event(GtkWidget * widget,
        appmouse_middle_drag(view,(int)event->x,(int)event->y);
        redraw = TRUE;
     }
+    if(view->Topview->selPoly.cnt > 0)
+       redraw=TRUE;
 
 
 
index 516bccb485b776e7f3416a20157f3c1e6d9235df..6d12a14b1a8ed3addd07cf29ca2289b231d147be 100644 (file)
@@ -28,6 +28,7 @@
 
     static float prevX=0;
     static float prevY=0;
+    static int lastAction;
 static void apply_actions(ViewInfo* v,int x,int y)
 {
     int a;
@@ -88,6 +89,7 @@ static void apply_actions(ViewInfo* v,int x,int y)
 
        }
     }
+    lastAction=a;
 
 
 
@@ -220,4 +222,25 @@ void appmouse_middle_drag(ViewInfo* v,int x,int y)
     appmouse_drag(v,x,y);
 
 }
+void appmouse_move(ViewInfo* v,int x,int y)
+{
+    to3D( x,y, &v->mouse.GLpos.x,&v->mouse.GLpos.y,&v->mouse.GLpos.z);
+}
+void appmouse_key_release(ViewInfo* v,int key)
+{
+    int action=get_key_action(v,key);
+    if(lastAction==MM_POLYGON_SELECT)
+    {
+       clear_selpoly(&view->Topview->selPoly); 
+       glexpose();
+    }
+    v->keymap.down=0;
+    v->keymap.keyVal=0;
+}
+void appmouse_key_press(ViewInfo* v,int key)
+{
+    v->keymap.down=1;
+    v->keymap.keyVal=key;
+}
+
 
index 446a33521116d6238c939be961bad6614c131a6d..99f1402473f9436ed22d7cd3a6d3261ba147591f 100644 (file)
@@ -29,6 +29,10 @@ extern void appmouse_right_drag(ViewInfo* v,int x,int y);
 extern void appmouse_middle_click_down(ViewInfo* v,int x,int y);
 extern void appmouse_middle_click_up(ViewInfo* v,int x,int y);
 extern void appmouse_middle_drag(ViewInfo* v,int x,int y);
+extern void appmouse_move(ViewInfo* v,int x,int y);
+extern void appmouse_key_release(ViewInfo* v,int key);
+extern void appmouse_key_press(ViewInfo* v,int key);
+
 
 
 #endif
index 674c7701baa85d3c37cd3084a086864e7de2c9d1..dd3b8a68ffca0513ef8e7841f24f98addc71fa7d 100644 (file)
@@ -213,6 +213,18 @@ void load_mouse_actions (char* modefile,ViewInfo* v)
 */
 }
 
+int get_key_action(ViewInfo* v,int key)
+{
+    int ind=0;
+    for (;ind < v->mouse_action_count ; ind ++)
+    {
+
+       if (v->mouse_actions[ind].hotkey==key)
+           return v->mouse_actions[ind].action;
+    }
+    return -1;
+}
+
 
 int get_mode(ViewInfo* v)
 {
index 9bc07885bb140f53eff3faa70c7539b315157a72..b0e51190363f4724220cc74b530343f374771fdc 100644 (file)
@@ -43,6 +43,7 @@
 extern void load_mouse_actions (char* modefile,ViewInfo* v);
 
 extern int get_mode(ViewInfo* v);
+extern int get_key_action(ViewInfo* v,int key);
 
 
 
index 8a66275dc1cd8077ffab22e27e33391c3581fceb..49b77cfb39fce12b29242b6ace14285b85c5fe82 100644 (file)
@@ -39,7 +39,7 @@
                        <DebugSettings
                                Command="$(TargetPath)"
                                WorkingDirectory="C:\graphviz-ms\bin"
-                               CommandArguments=""
+                               CommandArguments="c:/4elt.dot"
                                Attach="false"
                                DebuggerType="3"
                                Remote="1"
index 3a331ba0f70ae9b555cdf332996194a75627fee5..16c145452da1c6cb5e42068200c64c00f6c97eb1 100644 (file)
@@ -180,6 +180,7 @@ extern "C" {
     } glCompPointI;
     typedef struct {
        int cnt;
+       int hotKey;
        glCompPoint* pts;
     }glCompPoly;