From db7f18e3a695fc294cf1cffd97b16bd43cb5eb9b Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Mon, 28 Nov 2005 15:41:54 +0000 Subject: [PATCH] new shortcuts for alternative x, y, z views (still needs to be completed by dave) --- Fltk/Callbacks.cpp | 29 ++++++++++++++++++++++++++++- Fltk/GUI.cpp | 14 +++++++++++++- doc/texinfo/shortcuts.texi | 6 ++++++ 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 83e4f4d542..7f58a38b3d 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.377 2005-11-26 16:01:10 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.378 2005-11-28 15:41:54 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -406,6 +406,30 @@ void status_xyz1p_cb(CALLBACK_ARGS) CTX.setQuaternionFromEulerAngles(); Draw(); } + else if(!strcmp(str, "nx")){ // X-axis pointing into the screen + // FIXME: dave + CTX.r[0] = 0.; + CTX.r[1] = 0.; + CTX.r[2] = 0.; + CTX.setQuaternionFromEulerAngles(); + Draw(); + } + else if(!strcmp(str, "ny")){ // Y-axis pointing into the screen + // FIXME: dave + CTX.r[0] = 0.; + CTX.r[1] = 0.; + CTX.r[2] = 0.; + CTX.setQuaternionFromEulerAngles(); + Draw(); + } + else if(!strcmp(str, "nz")){ // Z-axis pointing into the screen + // FIXME: dave + CTX.r[0] = 0.; + CTX.r[1] = 0.; + CTX.r[2] = 0.; + CTX.setQuaternionFromEulerAngles(); + Draw(); + } else if(!strcmp(str, "1:1")){ // reset translation and scaling CTX.t[0] = CTX.t[1] = CTX.t[2] = 0.; CTX.s[0] = CTX.s[1] = CTX.s[2] = 1.; @@ -1600,6 +1624,9 @@ void help_short_cb(CALLBACK_ARGS) Msg(DIRECT, " Alt+Shift+p Hide/show mesh points"); Msg(DIRECT, " Alt+Shift+s Hide/show mesh surfaces"); Msg(DIRECT, " Alt+Shift+v Hide/show mesh volumes"); + Msg(DIRECT, " Alt+Shift+x Set -X view"); + Msg(DIRECT, " Alt+Shift+y Set -Y view"); + Msg(DIRECT, " Alt+Shift+z Set -Z view"); Msg(DIRECT, " "); WID->create_message_window(); } diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index f50cfd28c2..9ce93fb86d 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.469 2005-11-26 16:01:11 geuzaine Exp $ +// $Id: GUI.cpp,v 1.470 2005-11-28 15:41:54 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -670,6 +670,18 @@ int GUI::global_shortcuts(int event) status_xyz1p_cb(0, (void *)"z"); return 1; } + else if(Fl::test_shortcut(FL_ALT + FL_SHIFT + 'x')) { + status_xyz1p_cb(0, (void *)"nx"); + return 1; + } + else if(Fl::test_shortcut(FL_ALT + FL_SHIFT + 'y')) { + status_xyz1p_cb(0, (void *)"ny"); + return 1; + } + else if(Fl::test_shortcut(FL_ALT + FL_SHIFT + 'z')) { + status_xyz1p_cb(0, (void *)"nz"); + return 1; + } else if(Fl::test_shortcut(FL_ALT + 'a')) { opt_general_axes(0, GMSH_SET | GMSH_GUI, opt_general_axes(0, GMSH_GET, 0) + 1); diff --git a/doc/texinfo/shortcuts.texi b/doc/texinfo/shortcuts.texi index 4db8302ee1..f758550a07 100644 --- a/doc/texinfo/shortcuts.texi +++ b/doc/texinfo/shortcuts.texi @@ -139,5 +139,11 @@ Hide/show mesh points Hide/show mesh surfaces @item Alt+Shift+v Hide/show mesh volumes +@item Alt+Shift+x +Set -X view +@item Alt+Shift+y +Set -Y view +@item Alt+Shift+z +Set -Z view @end table -- GitLab