if (event->button == 1) //left click release
- appmouse_left_click_up(view,(int) event->x,(int) event->x);
+ appmouse_left_click_up(view,(int) event->x,(int) event->y);
if (event->button == 3) //right click
- appmouse_right_click_up(view,(int) event->x,(int) event->x);
+ appmouse_right_click_up(view,(int) event->x,(int) event->y);
expose_event(view->drawing_area, NULL, NULL);
dx = 0.0;
dy = 0.0;
#include "arcball.h"
#include "topview.h"
#include "glmotion.h"
+#include "beacon.h"
+
static float prevX=0;
static float prevY=0;
}
static void appmouse_right_click(ViewInfo* v,int x,int y)
{
-
+
+ pick_node_from_coords(view->mouse.GLfinalPos.x,view->mouse.GLfinalPos.y,view->mouse.GLfinalPos.z);
}
v->mouse.down=1;
v->mouse.initPos.x=x;
v->mouse.initPos.y=y;
+ v->mouse.pos.x=x;
+ v->mouse.pos.y=y;
+
GetFixedOGLPos((float) x,y, v->GLDepth,&v->mouse.GLinitPos.x,&v->mouse.GLinitPos.y,&v->mouse.GLinitPos.z);
+ GetFixedOGLPos((float) x,y,v->GLDepth, &v->mouse.GLpos.x,&v->mouse.GLpos.y,&v->mouse.GLpos.z);
+
prevX=0;
prevY=0;
realloc(view->Topview->picked_edges,
sizeof(topview_edge *) *
view->Topview->picked_edge_count);
+ deselect_edge(e);
return 1;
}
return 0;
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);
return 1;
}
realloc(view->Topview->picked_nodes,
sizeof(topview_node *) *
view->Topview->picked_node_count);
+ deselect_node(n);
return 1;
}
return 0;
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);
return 1;
}
}
glColor4f(0, 1, 0, 0.5);
glLineWidth(2);
- glBegin(GL_LINES);
+/* 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];
}
- glEnd();
+ glEnd();*/
glLineWidth(1);
for (ind = 0; ind < view->Topview->picked_edge_count; ind++) {
float x1, x2, y1, y2, z1, z2;
return_value = 0;
- /*if both head and tail nodes are selected use selection color for edges */
- if ((e->Node1->data.Selected) || (e->Node2->data.Selected)) {
+ /*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;