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

*** empty log message ***

parent 5e544e02
No related branches found
No related tags found
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 "GmshUI.h"
......@@ -761,6 +761,8 @@ void mesh_1d_cb(CALLBACK_ARGS){
else
#endif
mai3d(&M, 1);
Init();
Draw();
}
void mesh_2d_cb(CALLBACK_ARGS){
#ifdef _USETHREADS
......@@ -772,6 +774,8 @@ void mesh_2d_cb(CALLBACK_ARGS){
else
#endif
mai3d(&M, 2);
Init();
Draw();
}
void mesh_3d_cb(CALLBACK_ARGS){
#ifdef _USETHREADS
......@@ -783,6 +787,8 @@ void mesh_3d_cb(CALLBACK_ARGS){
else
#endif
mai3d(&M, 3);
Init();
Draw();
}
void mesh_define_length_cb (CALLBACK_ARGS){
Vertex *v;
......@@ -802,20 +808,20 @@ void mesh_define_length_cb (CALLBACK_ARGS){
if (ib == -1){ /* 'e' */
if(n >= 1) {
add_charlength(n,p,CTX.filename);
n=0;
ZeroHighlight(&M);
DrawUpdate();
break;
}
n=0;
ZeroHighlight(&M);
Replot();
}
if(ib == 0){ /* 'q' */
n=0 ;
ZeroHighlight(&M);
Replot();
DrawUpdate();
break;
}
}
if(!CTX.threads) Msg(STATUS,"Ready");
Msg(STATUS,"Ready");
}
void mesh_define_recombine_cb (CALLBACK_ARGS){
printf("mesh define reco\n");
......
......@@ -179,7 +179,7 @@ public:
void activate_custom(int val);
void add_handler();
int global_shortcuts(int event);
int quit_selection, end_selection;
int try_selection, quit_selection, end_selection;
// geometry contexts queries
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>
......@@ -92,7 +92,6 @@ int main(int argc, char *argv[]){
// The GUI is ready
CTX.interactive = 0 ;
CTX.expose = 1 ;
// Say welcome!
......@@ -130,6 +129,7 @@ int main(int argc, char *argv[]){
// Draw the actual scene
Init();
Draw();
CTX.expose = 1 ;
// loop
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 "GmshUI.h"
......@@ -43,10 +43,11 @@ void DrawUI(void){
WID->check();
}
// one should not call Opengl_Window::draw() from the handle(), but
// Opengl_Window::draw() from the handle(), but
// rather the following:
void DrawUpdate(){
if(!CTX.expose) return ;
WID->make_current();
Orthogonalize(0,0);
glClearColor(UNPACK_RED(CTX.color.bg)/255.,
......@@ -114,6 +115,7 @@ int SelectEntity(int type, Vertex **v, Curve **c, Surface **s){
*v = NULL; *c = NULL; *s = NULL;
WID->try_selection = 0;
WID->quit_selection = 0;
WID->end_selection = 0;
......@@ -127,7 +129,8 @@ int SelectEntity(int type, Vertex **v, Curve **c, Surface **s){
WID->end_selection = 0;
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);
Filter_SelectionBuffer(hits,ii,jj,v,c,s,&M);
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 "GmshUI.h"
......@@ -173,7 +173,10 @@ int Opengl_Window::handle(int event) {
ZoomClick=0;
clear_overlay();
if(xb!=xe && yb!=ye) myZoom(xb,xe,yb,ye,xc1,xc2,yc1,yc2);
}
}
else{
WID->try_selection = 1 ;
}
break;
case 2:
if(Modifier && !ZoomClick){
......@@ -313,15 +316,16 @@ int Opengl_Window::handle(int event) {
case FL_MOVE:
movx = Fl::event_x()-x;
movy = Fl::event_y()-y;
WID->make_current();
Process_SelectionBuffer(Fl::event_x(), Fl::event_y(), &hits, ii, jj);
ov = v; oc = c; os = s; v = NULL; c = NULL; s = NULL;
Filter_SelectionBuffer(hits,ii,jj,&v,&c,&s,&M);
BeginHighlight();
HighlightEntity(v,c,s,0);
EndHighlight(0);
if(ov != v || oc != c || os != s) {
BeginHighlight();
HighlightEntity(v,c,s,0);
EndHighlight(0);
}
#if 0
// 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.
Finish editing this message first!
Please register or to comment