From e9de4ea968e8241f84867be23977499ffbc41131 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sun, 9 Oct 2005 18:00:54 +0000 Subject: [PATCH] small cleanup + don't enter post stuff in select mode at the moment (we might want to change this if we want to select post-pro views in the future) --- Fltk/Opengl.cpp | 9 +-------- Fltk/Opengl_Window.cpp | 8 ++++---- Graphics/Draw.cpp | 5 +++-- Graphics/Mesh.cpp | 4 +++- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/Fltk/Opengl.cpp b/Fltk/Opengl.cpp index e1a75d7ef7..4aacc0108f 100644 --- a/Fltk/Opengl.cpp +++ b/Fltk/Opengl.cpp @@ -1,4 +1,4 @@ -// $Id: Opengl.cpp,v 1.54 2005-10-09 17:45:37 geuzaine Exp $ +// $Id: Opengl.cpp,v 1.55 2005-10-09 18:00:54 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -195,13 +195,6 @@ void Draw_OnScreenMessages() // Select entity routines -int check_type(int type, Vertex * v, Curve * c, Surface * s) -{ - return ((type == ENT_POINT && v) || - (type == ENT_LINE && c) || - (type == ENT_SURFACE && s)); -} - char SelectEntity(int type, Vertex ** v, Curve ** c, Surface ** s) { int numhits; diff --git a/Fltk/Opengl_Window.cpp b/Fltk/Opengl_Window.cpp index d1adadcc4d..0a20247dae 100644 --- a/Fltk/Opengl_Window.cpp +++ b/Fltk/Opengl_Window.cpp @@ -1,4 +1,4 @@ -// $Id: Opengl_Window.cpp,v 1.49 2005-10-09 15:58:41 geuzaine Exp $ +// $Id: Opengl_Window.cpp,v 1.50 2005-10-09 18:00:54 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -35,8 +35,6 @@ extern GUI *WID; extern Mesh M; extern Context_T CTX; -int check_type(int type, Vertex *v, Curve *c, Surface *s); - void Opengl_Window::draw() { static int locked = 0; @@ -325,7 +323,9 @@ int Opengl_Window::handle(int event) s = NULL; Filter_SelectionBuffer(WID->selection, numhits, hits, &v, &c, &s, &M); if(ov != v || oc != c || os != s) { - if(check_type(WID->selection, v, c, s)) + if((WID->selection == ENT_POINT && v) || + (WID->selection == ENT_LINE && c) || + (WID->selection == ENT_SURFACE && s)) WID->g_window->cursor(FL_CURSOR_CROSS, FL_BLACK, FL_WHITE); else WID->g_window->cursor(FL_CURSOR_DEFAULT, FL_BLACK, FL_WHITE); diff --git a/Graphics/Draw.cpp b/Graphics/Draw.cpp index 73628233e1..0219eefd9c 100644 --- a/Graphics/Draw.cpp +++ b/Graphics/Draw.cpp @@ -1,4 +1,4 @@ -// $Id: Draw.cpp,v 1.78 2005-10-09 15:58:41 geuzaine Exp $ +// $Id: Draw.cpp,v 1.79 2005-10-09 18:00:54 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -328,7 +328,8 @@ void Process_SelectionBuffer(int x, int y, int *n, hit *hits) hits[i].depth = (mindepth+maxdepth)/2; for(int j = 0; j < names; j++) { if(j == 0) - hits[i].type = *ptr; // type of entity (0, 1, 2 for point, line, surf) + hits[i].type = *ptr; // type of entity (0, 1, 2, ... for + // point, line, surf, ...) else if(j == 1) hits[i].ient = *ptr; // num of entity ptr++; diff --git a/Graphics/Mesh.cpp b/Graphics/Mesh.cpp index 205c8ee3b7..4062c70d93 100644 --- a/Graphics/Mesh.cpp +++ b/Graphics/Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: Mesh.cpp,v 1.139 2005-10-09 17:45:37 geuzaine Exp $ +// $Id: Mesh.cpp,v 1.140 2005-10-09 18:00:54 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -307,6 +307,8 @@ void Draw_Mesh(Mesh * M) glDisable((GLenum)(GL_CLIP_PLANE0 + i)); } + if(CTX.render_mode == GMSH_SELECT) return; + // draw any plugin-specific stuff if(CTX.post.plugin_draw_function) -- GitLab