Skip to content
Snippets Groups Projects
Commit f15b66fd authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

*** empty log message ***

parent 5e544e02
Branches
Tags
No related merge requests found
// $Id: Callbacks.cpp,v 1.13 2001-01-11 07:32:35 geuzaine Exp $ // $Id: Callbacks.cpp,v 1.14 2001-01-11 12:25:23 geuzaine Exp $
#include "Gmsh.h" #include "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -761,6 +761,8 @@ void mesh_1d_cb(CALLBACK_ARGS){ ...@@ -761,6 +761,8 @@ void mesh_1d_cb(CALLBACK_ARGS){
else else
#endif #endif
mai3d(&M, 1); mai3d(&M, 1);
Init();
Draw();
} }
void mesh_2d_cb(CALLBACK_ARGS){ void mesh_2d_cb(CALLBACK_ARGS){
#ifdef _USETHREADS #ifdef _USETHREADS
...@@ -772,6 +774,8 @@ void mesh_2d_cb(CALLBACK_ARGS){ ...@@ -772,6 +774,8 @@ void mesh_2d_cb(CALLBACK_ARGS){
else else
#endif #endif
mai3d(&M, 2); mai3d(&M, 2);
Init();
Draw();
} }
void mesh_3d_cb(CALLBACK_ARGS){ void mesh_3d_cb(CALLBACK_ARGS){
#ifdef _USETHREADS #ifdef _USETHREADS
...@@ -783,6 +787,8 @@ void mesh_3d_cb(CALLBACK_ARGS){ ...@@ -783,6 +787,8 @@ void mesh_3d_cb(CALLBACK_ARGS){
else else
#endif #endif
mai3d(&M, 3); mai3d(&M, 3);
Init();
Draw();
} }
void mesh_define_length_cb (CALLBACK_ARGS){ void mesh_define_length_cb (CALLBACK_ARGS){
Vertex *v; Vertex *v;
...@@ -802,20 +808,20 @@ void mesh_define_length_cb (CALLBACK_ARGS){ ...@@ -802,20 +808,20 @@ void mesh_define_length_cb (CALLBACK_ARGS){
if (ib == -1){ /* 'e' */ if (ib == -1){ /* 'e' */
if(n >= 1) { if(n >= 1) {
add_charlength(n,p,CTX.filename); add_charlength(n,p,CTX.filename);
break;
}
n=0; n=0;
ZeroHighlight(&M); ZeroHighlight(&M);
Replot(); DrawUpdate();
break;
}
} }
if(ib == 0){ /* 'q' */ if(ib == 0){ /* 'q' */
n=0 ; n=0 ;
ZeroHighlight(&M); ZeroHighlight(&M);
Replot(); DrawUpdate();
break; break;
} }
} }
if(!CTX.threads) Msg(STATUS,"Ready"); Msg(STATUS,"Ready");
} }
void mesh_define_recombine_cb (CALLBACK_ARGS){ void mesh_define_recombine_cb (CALLBACK_ARGS){
printf("mesh define reco\n"); printf("mesh define reco\n");
......
...@@ -179,7 +179,7 @@ public: ...@@ -179,7 +179,7 @@ public:
void activate_custom(int val); void activate_custom(int val);
void add_handler(); void add_handler();
int global_shortcuts(int event); int global_shortcuts(int event);
int quit_selection, end_selection; int try_selection, quit_selection, end_selection;
// geometry contexts queries // geometry contexts queries
char *get_geometry_parameter(int num); char *get_geometry_parameter(int num);
......
// $Id: Main.cpp,v 1.6 2001-01-10 08:50:29 geuzaine Exp $ // $Id: Main.cpp,v 1.7 2001-01-11 12:25:23 geuzaine Exp $
#include <signal.h> #include <signal.h>
...@@ -92,7 +92,6 @@ int main(int argc, char *argv[]){ ...@@ -92,7 +92,6 @@ int main(int argc, char *argv[]){
// The GUI is ready // The GUI is ready
CTX.interactive = 0 ; CTX.interactive = 0 ;
CTX.expose = 1 ;
// Say welcome! // Say welcome!
...@@ -130,6 +129,7 @@ int main(int argc, char *argv[]){ ...@@ -130,6 +129,7 @@ int main(int argc, char *argv[]){
// Draw the actual scene // Draw the actual scene
Init(); Init();
Draw(); Draw();
CTX.expose = 1 ;
// loop // loop
WID->run(); WID->run();
......
// $Id: Opengl.cpp,v 1.10 2001-01-11 07:32:35 geuzaine Exp $ // $Id: Opengl.cpp,v 1.11 2001-01-11 12:25:23 geuzaine Exp $
#include "Gmsh.h" #include "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -43,10 +43,11 @@ void DrawUI(void){ ...@@ -43,10 +43,11 @@ void DrawUI(void){
WID->check(); WID->check();
} }
// one should not call Opengl_Window::draw() from the handle(), but // Opengl_Window::draw() from the handle(), but
// rather the following: // rather the following:
void DrawUpdate(){ void DrawUpdate(){
if(!CTX.expose) return ;
WID->make_current(); WID->make_current();
Orthogonalize(0,0); Orthogonalize(0,0);
glClearColor(UNPACK_RED(CTX.color.bg)/255., glClearColor(UNPACK_RED(CTX.color.bg)/255.,
...@@ -114,6 +115,7 @@ int SelectEntity(int type, Vertex **v, Curve **c, Surface **s){ ...@@ -114,6 +115,7 @@ int SelectEntity(int type, Vertex **v, Curve **c, Surface **s){
*v = NULL; *c = NULL; *s = NULL; *v = NULL; *c = NULL; *s = NULL;
WID->try_selection = 0;
WID->quit_selection = 0; WID->quit_selection = 0;
WID->end_selection = 0; WID->end_selection = 0;
...@@ -127,7 +129,8 @@ int SelectEntity(int type, Vertex **v, Curve **c, Surface **s){ ...@@ -127,7 +129,8 @@ int SelectEntity(int type, Vertex **v, Curve **c, Surface **s){
WID->end_selection = 0; WID->end_selection = 0;
return -1; return -1;
} }
if(Fl::event_is_click()){ if(WID->try_selection){
WID->try_selection = 0;
Process_SelectionBuffer(Fl::event_x(), Fl::event_y(), &hits, ii, jj); Process_SelectionBuffer(Fl::event_x(), Fl::event_y(), &hits, ii, jj);
Filter_SelectionBuffer(hits,ii,jj,v,c,s,&M); Filter_SelectionBuffer(hits,ii,jj,v,c,s,&M);
if(check_type(type,*v,*c,*s)){ if(check_type(type,*v,*c,*s)){
......
// $Id: Opengl_Window.cpp,v 1.6 2001-01-10 21:35:08 geuzaine Exp $ // $Id: Opengl_Window.cpp,v 1.7 2001-01-11 12:25:23 geuzaine Exp $
#include "Gmsh.h" #include "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -174,6 +174,9 @@ int Opengl_Window::handle(int event) { ...@@ -174,6 +174,9 @@ int Opengl_Window::handle(int event) {
clear_overlay(); clear_overlay();
if(xb!=xe && yb!=ye) myZoom(xb,xe,yb,ye,xc1,xc2,yc1,yc2); if(xb!=xe && yb!=ye) myZoom(xb,xe,yb,ye,xc1,xc2,yc1,yc2);
} }
else{
WID->try_selection = 1 ;
}
break; break;
case 2: case 2:
if(Modifier && !ZoomClick){ if(Modifier && !ZoomClick){
...@@ -313,15 +316,16 @@ int Opengl_Window::handle(int event) { ...@@ -313,15 +316,16 @@ int Opengl_Window::handle(int event) {
case FL_MOVE: case FL_MOVE:
movx = Fl::event_x()-x; movx = Fl::event_x()-x;
movy = Fl::event_y()-y; movy = Fl::event_y()-y;
WID->make_current();
Process_SelectionBuffer(Fl::event_x(), Fl::event_y(), &hits, ii, jj); Process_SelectionBuffer(Fl::event_x(), Fl::event_y(), &hits, ii, jj);
ov = v; oc = c; os = s; v = NULL; c = NULL; s = NULL; ov = v; oc = c; os = s; v = NULL; c = NULL; s = NULL;
Filter_SelectionBuffer(hits,ii,jj,&v,&c,&s,&M); Filter_SelectionBuffer(hits,ii,jj,&v,&c,&s,&M);
if(ov != v || oc != c || os != s) {
BeginHighlight(); BeginHighlight();
HighlightEntity(v,c,s,0); HighlightEntity(v,c,s,0);
EndHighlight(0); EndHighlight(0);
}
#if 0 #if 0
// l'overlay ne marche pas, meme dans les demos de fltk! // l'overlay ne marche pas, meme dans les demos de fltk!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment