btnToolZoomFit_clicked(NULL, NULL);
}
}
+ else
+ return;
glexpose_grid(view);
draw_fisheye_magnifier(view);
}
static void appmouse_up(ViewInfo* v,int x,int y)
{
- v->mouse.down=0;
- v->mouse.finalPos.x=x;
- v->mouse.finalPos.y=y;
- view->mouse.dragX = 0;
- view->mouse.dragY = 0;
- GetFixedOGLPos((float) x,y,v->GLDepth, &v->mouse.GLfinalPos.x,&v->mouse.GLfinalPos.y,&v->mouse.GLfinalPos.z);
- if(singleclick(v))
- {
- if (v->mouse.t==glMouseLeftButton)
- appmouse_left_click(v,x,y);
- if (v->mouse.t==glMouseRightButton)
- appmouse_right_click(v,x,y);
- }
+ int a;
+ v->mouse.down=0;
+ v->mouse.finalPos.x=x;
+ v->mouse.finalPos.y=y;
+ view->mouse.dragX = 0;
+ view->mouse.dragY = 0;
+ a=get_mode(v);
+ GetFixedOGLPos((float) x,y,v->GLDepth, &v->mouse.GLfinalPos.x,&v->mouse.GLfinalPos.y,&v->mouse.GLfinalPos.z);
+ if(singleclick(v))
+ {
+ if (v->mouse.t==glMouseLeftButton)
+ appmouse_left_click(v,x,y);
+ if (v->mouse.t==glMouseRightButton)
+ appmouse_right_click(v,x,y);
+ }
+ if ((a== MM_FISHEYE_MAGNIFIER) || (a == MM_MAGNIFIER)) //fisheye mag mouse release, stop distortion
+ originate_distorded_coordinates(v->Topview);
+
+
}
static void appmouse_drag(ViewInfo* v,int x,int y)
{
static float x2,y2;
+ int a=get_mode(v);
v->mouse.pos.x=x;
v->mouse.pos.y=y;
GetFixedOGLPos((float) x,y,v->GLDepth, &v->mouse.GLpos.x,&v->mouse.GLpos.y,&v->mouse.GLpos.z);
x2=v->mouse.GLpos.x;
y2=v->mouse.GLpos.y;
-// v->mouse.dragX=x2-prevX;
-// v->mouse.dragY=y2-prevY;
prevX=x2;
prevY=y2;
-// printf ("(%f,%f)->(%f,%f) : %f %f \n",v->mouse.pos.x,v->mouse.GLinitPos.y,v->mouse.GLfinalPos.x,v->mouse.GLfinalPos.y,v->mouse.dragX,v->mouse.dragY);
+ if (a==MM_ROTATE)
+
+ {
+ view->arcball->MousePt.s.X = (GLfloat) x;
+ view->arcball->MousePt.s.Y = (GLfloat) y;
+ if (!view->arcball->isDragging) {
+ arcmouseClick(view);
+ view->arcball->isDragging = 1;
+ } else
+ arcmouseDrag(view);
+ return;
+ }
+ if (a==MM_PAN)
+ glmotion_pan(v);
+ if (a==MM_MOVE)
+ move_TVnodes();
+
+ if(a==MM_RECTANGULAR_SELECT)
+ {
+
+ }
+
}
appmouse_down(v,x,y);
-}
-int get_mode(ViewInfo* v)
-{
-/*#define MM_PAN 0
-#define MM_ZOOM 1
-#define MM_ROTATE 2
-#define MM_SINGLE_SELECT 3
-#define MM_RECTANGULAR_SELECT 4
-#define MM_RECTANGULAR_X_SELECT 5
-#define MM_MOVE 10
-#define MM_MAGNIFIER 20
-#define MM_FISHEYE_MAGNIFIER 21*/
-
-
- if ((view->mouse.t==glMouseLeftButton)&&(view->keymap.down) && (view->keymap.keyVal == B_LSHIFT/*left shift*/) && (view->active_camera==-1))
- return MM_FISHEYE_MAGNIFIER;
- if ((view->mouse.t==glMouseLeftButton)&&(view->keymap.down) && (view->keymap.keyVal == B_LSHIFT/*left shift*/) && (view->active_camera>-1))
- return MM_ROTATE;
- if ((view->mouse.t==glMouseLeftButton)&&(view->keymap.down) && (view->keymap.keyVal == B_LCTRL/*left CTRL*/))
- return MM_MOVE;
- if ((view->mouse.t==glMouseLeftButton)&&(view->mouse.down) )
- return MM_PAN;
-
-
-
-
}
void appmouse_left_click_up(ViewInfo* v,int x,int y)
{
appmouse_up(v,x,y);
/* if (v->mouse.mouse_mode == MM_MOVE)
move_TVnodes();*/
- if ((a== MM_FISHEYE_MAGNIFIER) || (a == MM_MAGNIFIER)) //fisheye mag mouse release, stop distortion
- originate_distorded_coordinates(v->Topview);
-
-
}
void appmouse_left_drag(ViewInfo* v,int x,int y)
{
- int a=get_mode(v);
appmouse_drag(v,x,y);
- if (a==MM_ROTATE)
-
- {
- view->arcball->MousePt.s.X = (GLfloat) x;
- view->arcball->MousePt.s.Y = (GLfloat) y;
- if (!view->arcball->isDragging) {
- arcmouseClick(view);
- view->arcball->isDragging = 1;
- } else
- arcmouseDrag(view);
- return;
- }
- if (a==MM_PAN)
- glmotion_pan(v);
- if (a==MM_MOVE)
- move_TVnodes();
}
extern void appmouse_right_click_down(ViewInfo* v,int x,int y);
extern void appmouse_right_click_up(ViewInfo* v,int x,int y);
extern void appmouse_right_drag(ViewInfo* v,int x,int y);
-extern int get_mode(ViewInfo* v);
-
#endif
glCompColor c;
s->common.callbacks.click = CBglCompMouseRightClick;
- p = glCompPanelNew((glCompObj *) s, 25, 25, 53, 47);
+ p = glCompPanelNew((glCompObj *) s, 25, 25, 51, 47);
p->common.align = glAlignLeft;
p->common.data = 0;
y = y + off;
+ /*switch to fisheye */
+ b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
+ glCompButtonAddPngGlyph(b, smyrnaPath("fisheye.png"));
+ b->common.callbacks.click = menu_switch_to_fisheye;
+ toFisheye = b;
+
+
+ /*switch to normal mode */
+ b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
+ glCompButtonAddPngGlyph(b, smyrnaPath("no_fisheye.png"));
+ b->common.callbacks.click = menu_switch_to_fisheye;
+ b->common.visible = 0;
+ toNormal = b;
+
+ y=y+off;
+ b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
+ glCompButtonAddPngGlyph(b, smyrnaPath("3D.png"));
+ b->common.callbacks.click = switch2D3D;
+ to3DBtn = b;
+
+
+ b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
+ glCompButtonAddPngGlyph(b, smyrnaPath("2D.png"));
+ b->common.callbacks.click = switch2D3D;
+ glCompButtonHide(b);
+ to2DBtn = b;
- y = y + off;
- p = glCompPanelNew((glCompObj *) p, 1, 25, 80, 255);
+ p = glCompPanelNew((glCompObj *) p, 1, 325, 80, 180);
p->common.align = glAlignTop;
p->common.data = 0;
p->common.borderWidth = 1;
glCompButtonAddPngGlyph(b, smyrnaPath("zoomin.png"));
b->groupid = 0;
b->common.callbacks.click = menu_click_zoom_plus;
-
copy_glcomp_color(&c, &b->common.color);
y = y + off;
b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
glCompButtonAddPngGlyph(b, smyrnaPath("zoomout.png"));
b->common.callbacks.click = menu_click_zoom_minus;
-
- y = y + off;
- copy_glcomp_color(&c, &b->common.color);
-
- b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
- glCompButtonAddPngGlyph(b, smyrnaPath("fit.png"));
copy_glcomp_color(&c, &b->common.color);
y = y + off;
- y = y + off;
-
-
- b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
- glCompButtonAddPngGlyph(b, smyrnaPath("3D.png"));
- b->common.callbacks.click = switch2D3D;
- copy_glcomp_color(&c, &b->common.color);
- to3DBtn = b;
-
- b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
- glCompButtonAddPngGlyph(b, smyrnaPath("2D.png"));
- b->common.callbacks.click = switch2D3D;
- glCompButtonHide(b);
- copy_glcomp_color(&c, &b->common.color);
- to2DBtn = b;
p->common.data = 0;
p->common.color.A = 0;
- /*switch to fisheye */
- b = glCompButtonNew((glCompObj *) p, 2, 1, 42, 42, "");
- glCompButtonAddPngGlyph(b, smyrnaPath("fisheye.png"));
- b->common.callbacks.click = menu_switch_to_fisheye;
- toFisheye = b;
-
-
- /*switch to normal mode */
- b = glCompButtonNew((glCompObj *) p, 2, 1, 42, 42, "");
- glCompButtonAddPngGlyph(b, smyrnaPath("no_fisheye.png"));
- b->common.callbacks.click = menu_switch_to_fisheye;
- b->common.visible = 0;
- toNormal = b;
// gladewidget = glade_xml_get_widget(xml, "vbox2");
gladewidget = glade_xml_get_widget(xml, "hbox11");
+ gtk_widget_hide(glade_xml_get_widget(xml, "vbox13"));
+ gtk_widget_hide(glade_xml_get_widget(xml, "hbox7"));
+
+
create_window(glconfig, gladewidget);
change_cursor(GDK_TOP_LEFT_ARROW);
RelativePath=".\hier.h"
>
</File>
+ <File
+ RelativePath=".\hotkeymap.h"
+ >
+ </File>
<File
RelativePath=".\materials.h"
>
RelativePath=".\hier.c"
>
</File>
+ <File
+ RelativePath=".\hotkeymap.c"
+ >
+ </File>
<File
RelativePath=".\main.c"
>
#define MM_MAGNIFIER 20
#define MM_FISHEYE_MAGNIFIER 21
-#define B_LSHIFT 65505
-#define B_RSHIFT 65506
-#define B_LCTRL 65507
-#define B_RCTRL 65508
#define GLOBAL_Z_OFFSET 0.001
t->picked_edge_count = 0;
t->picked_edges = '\0';
- /*hide stupid console window */
- gtk_widget_hide(glade_xml_get_widget(xml, "vbox13"));
- gtk_widget_hide(glade_xml_get_widget(xml, "hbox7"));
/*create attribute list*/
t->attributes=load_attr_list(view->g[view->activeGraph]);
t->filtered_attr_list=NULL;
zdepth = (float) Z_BACK_PLANE;
if ((view->defaultnodeshape == 0)) {
- glVertex3f(v->distorted_x - ddx,
- v->distorted_y - ddy, v->distorted_z - ddz);
+ glVertex3f(v->distorted_x,
+ v->distorted_y, v->distorted_z);
} else if (view->defaultnodeshape == 1) {
if (v->size > 0)
- drawCircle(v->distorted_x - ddx, v->distorted_y - ddy,
+ drawCircle(v->distorted_x , v->distorted_y ,
v->size * view->Topview->init_node_size,
- v->distorted_z - ddz);
+ v->distorted_z );
else
- drawCircle(v->distorted_x - ddx, v->distorted_y - ddy,
+ drawCircle(v->distorted_x , v->distorted_y,
view->Topview->init_node_size,
- v->distorted_z - ddz);
+ v->distorted_z);
}
} else {
/* int a=1; */
drawtopviewedges(g);
drawtopviewedgelabels(g);
enddrawcycle(g);
- draw_tv_xdot(view->Topview);
+ draw_tv_xdot(view->Topview);
draw_node_hint_boxes();
if ((view->Selection.Active > 0) && (!view->SignalBlock)) {
view->Selection.Active = 0;
static void draw_tv_xdot(topview* t)
{
int j;
- float basez=0;
+ float basez=0;
draw_xdot(t->xDot,basez);
basez= basez+0.01;
for (j=0; j < t->Nodecount; j++)