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

*** empty log message ***

parent a69bed2a
Branches
Tags
No related merge requests found
// $Id: Callbacks.cpp,v 1.5 2001-01-09 14:24:06 geuzaine Exp $ // $Id: Callbacks.cpp,v 1.6 2001-01-09 15:45:03 geuzaine Exp $
#include "Gmsh.h" #include "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -279,7 +279,7 @@ void file_quit_cb(CALLBACK_ARGS) { ...@@ -279,7 +279,7 @@ void file_quit_cb(CALLBACK_ARGS) {
// Option General Menu // Option General Menu
void opt_general_cb(CALLBACK_ARGS) { void opt_general_cb(CALLBACK_ARGS) {
WID->opt_general(); WID->create_general_options_window();
} }
void opt_general_moving_axes_cb(CALLBACK_ARGS){ void opt_general_moving_axes_cb(CALLBACK_ARGS){
CTX.axes = !CTX.axes ; CTX.axes = !CTX.axes ;
...@@ -305,6 +305,8 @@ void opt_general_orthographic_cb(CALLBACK_ARGS){ ...@@ -305,6 +305,8 @@ void opt_general_orthographic_cb(CALLBACK_ARGS){
} }
void opt_general_color_cb(CALLBACK_ARGS){ void opt_general_color_cb(CALLBACK_ARGS){
Init_Colors((int)((Fl_Value_Input*)w)->value()-1); Init_Colors((int)((Fl_Value_Input*)w)->value()-1);
Init();
Draw();
} }
void opt_general_shininess_cb(CALLBACK_ARGS){ void opt_general_shininess_cb(CALLBACK_ARGS){
CTX.shine = ((Fl_Value_Input*)w)->value(); CTX.shine = ((Fl_Value_Input*)w)->value();
...@@ -316,7 +318,7 @@ void opt_general_light_cb(CALLBACK_ARGS){ ...@@ -316,7 +318,7 @@ void opt_general_light_cb(CALLBACK_ARGS){
// Option Geometry Menu // Option Geometry Menu
void opt_geometry_cb(CALLBACK_ARGS) { void opt_geometry_cb(CALLBACK_ARGS) {
WID->opt_geometry(); WID->create_geometry_options_window();
} }
void opt_geometry_entity_cb(CALLBACK_ARGS) { void opt_geometry_entity_cb(CALLBACK_ARGS) {
switch((int)data){ switch((int)data){
...@@ -357,7 +359,7 @@ void opt_geometry_tangents_cb(CALLBACK_ARGS) { ...@@ -357,7 +359,7 @@ void opt_geometry_tangents_cb(CALLBACK_ARGS) {
// Option Mesh Menu // Option Mesh Menu
void opt_mesh_cb(CALLBACK_ARGS) { void opt_mesh_cb(CALLBACK_ARGS) {
WID->opt_mesh(); WID->create_mesh_options_window();
} }
void opt_mesh_entity_cb(CALLBACK_ARGS) { void opt_mesh_entity_cb(CALLBACK_ARGS) {
switch((int)data){ switch((int)data){
...@@ -379,33 +381,64 @@ void opt_mesh_show_by_entity_num_cb(CALLBACK_ARGS) { ...@@ -379,33 +381,64 @@ void opt_mesh_show_by_entity_num_cb(CALLBACK_ARGS) {
opt_geometry_show_by_entity_num_cb(w,data); opt_geometry_show_by_entity_num_cb(w,data);
} }
void opt_mesh_show_by_quality_cb(CALLBACK_ARGS) { void opt_mesh_show_by_quality_cb(CALLBACK_ARGS) {
const char * c = ((Fl_Input*)w)->value(); CTX.mesh.limit_gamma = ((Fl_Value_Input*)w)->value();
if (!strcmp(c,"all") || !strcmp(c,"*")) }
CTX.mesh.limit_gamma = 0.0 ; void opt_mesh_normals_cb(CALLBACK_ARGS) {
else CTX.mesh.normals = ((Fl_Value_Input*)w)->value();
CTX.mesh.limit_gamma = atof(c); }
void opt_mesh_degree_cb(CALLBACK_ARGS){
if(CTX.mesh.degree==2) CTX.mesh.degree = 1;
else CTX.mesh.degree = 2;
}
void opt_mesh_algo_cb(CALLBACK_ARGS){
if(CTX.mesh.algo==DELAUNAY_OLDALGO) CTX.mesh.algo = DELAUNAY_NEWALGO;
else CTX.mesh.algo = DELAUNAY_OLDALGO;
}
void opt_mesh_smoothing_cb(CALLBACK_ARGS){
CTX.mesh.nb_smoothing = (int)((Fl_Value_Input*)w)->value();
}
void opt_mesh_interactive_cb(CALLBACK_ARGS){
CTX.mesh.interactive = !CTX.mesh.interactive;
}
void opt_mesh_explode_cb(CALLBACK_ARGS){
CTX.mesh.explode = ((Fl_Value_Input*)w)->value();
}
void opt_mesh_aspect_cb(CALLBACK_ARGS){
switch((int)data){
case 0 : CTX.mesh.hidden = 0; CTX.mesh.shade = 0; break;
case 1 : CTX.mesh.hidden = 1; CTX.mesh.shade = 0; break;
case 2 : CTX.mesh.hidden = 1; CTX.mesh.shade = 1; break;
}
} }
// Option Post Menu // Option Post Menu
void opt_post_cb(CALLBACK_ARGS) { void opt_post_cb(CALLBACK_ARGS) {
WID->opt_post(); WID->create_post_options_window();
}
void opt_post_link_cb(CALLBACK_ARGS) {
CTX.post.link = (int)data;
}
void opt_post_anim_delay_cb(CALLBACK_ARGS) {
CTX.post.anim_delay = (long)(1.e5*((Fl_Value_Input*)w)->value());
} }
// Option Statistics Menu // Option Statistics Menu
void opt_statistics_cb(CALLBACK_ARGS) { void opt_statistics_cb(CALLBACK_ARGS) {
WID->opt_statistics(); WID->create_statistics_window();
}
void opt_statistics_update_cb(CALLBACK_ARGS) {
WID->set_statistics();
} }
// Help Menu // Help Menu
void help_short_cb(CALLBACK_ARGS){ void help_short_cb(CALLBACK_ARGS){
WID->help_short(); WID->create_help_window();
} }
void help_about_cb(CALLBACK_ARGS){ void help_about_cb(CALLBACK_ARGS){
WID->help_about(); WID->create_about_window();
} }
// Module Menu // Module Menu
...@@ -766,17 +799,23 @@ void view_duplicate_cb(CALLBACK_ARGS){ ...@@ -766,17 +799,23 @@ void view_duplicate_cb(CALLBACK_ARGS){
} }
void view_lighting_cb(CALLBACK_ARGS){ void view_lighting_cb(CALLBACK_ARGS){
printf("Light view %d \n", (int)data); Post_View *v = (Post_View*)List_Pointer(Post_ViewList,(int)data);
v->Light = !v->Light;
v->Changed = 1;
Init() ;
Draw() ;
} }
void view_elements_cb(CALLBACK_ARGS){ void view_elements_cb(CALLBACK_ARGS){
printf("Show Elements view %d \n", (int)data); Post_View *v = (Post_View*)List_Pointer(Post_ViewList,(int)data);
v->ShowElement = !v->ShowElement;
v->Changed = 1;
Init() ;
Draw() ;
} }
void view_applybgmesh_cb(CALLBACK_ARGS){ void view_applybgmesh_cb(CALLBACK_ARGS){
printf("Apply bgmesh view %d \n", (int)data); Post_View *v = (Post_View*)List_Pointer(Post_ViewList,(int)data);
} BGMWithView(v);
void view_timestep_cb(CALLBACK_ARGS){
printf("Timestep view %d \n", (int)data);
} }
void view_options_cb(CALLBACK_ARGS){ void view_options_cb(CALLBACK_ARGS){
WID->opt_view(); WID->create_view_window();
} }
...@@ -68,14 +68,23 @@ void opt_mesh_num_cb(CALLBACK_ARGS) ; ...@@ -68,14 +68,23 @@ void opt_mesh_num_cb(CALLBACK_ARGS) ;
void opt_mesh_show_by_entity_num_cb(CALLBACK_ARGS) ; void opt_mesh_show_by_entity_num_cb(CALLBACK_ARGS) ;
void opt_mesh_show_by_quality_cb(CALLBACK_ARGS) ; void opt_mesh_show_by_quality_cb(CALLBACK_ARGS) ;
void opt_mesh_normals_cb(CALLBACK_ARGS) ; void opt_mesh_normals_cb(CALLBACK_ARGS) ;
void opt_mesh_degree_cb(CALLBACK_ARGS) ;
void opt_mesh_algo_cb(CALLBACK_ARGS) ;
void opt_mesh_smoothing_cb(CALLBACK_ARGS) ;
void opt_mesh_interactive_cb(CALLBACK_ARGS) ;
void opt_mesh_explode_cb(CALLBACK_ARGS) ;
void opt_mesh_aspect_cb(CALLBACK_ARGS) ;
// Option Post Menu // Option Post Menu
void opt_post_cb(CALLBACK_ARGS) ; void opt_post_cb(CALLBACK_ARGS) ;
void opt_post_link_cb(CALLBACK_ARGS) ;
void opt_post_anim_delay_cb(CALLBACK_ARGS) ;
// Option Statistics Menu // Option Statistics Menu
void opt_statistics_cb(CALLBACK_ARGS) ; void opt_statistics_cb(CALLBACK_ARGS) ;
void opt_statistics_update_cb(CALLBACK_ARGS) ;
// Help Menu // Help Menu
...@@ -173,7 +182,6 @@ void view_duplicate_cb(CALLBACK_ARGS) ; ...@@ -173,7 +182,6 @@ void view_duplicate_cb(CALLBACK_ARGS) ;
void view_lighting_cb(CALLBACK_ARGS) ; void view_lighting_cb(CALLBACK_ARGS) ;
void view_elements_cb(CALLBACK_ARGS) ; void view_elements_cb(CALLBACK_ARGS) ;
void view_applybgmesh_cb(CALLBACK_ARGS) ; void view_applybgmesh_cb(CALLBACK_ARGS) ;
void view_timestep_cb(CALLBACK_ARGS) ;
void view_options_cb(CALLBACK_ARGS) ; void view_options_cb(CALLBACK_ARGS) ;
......
This diff is collapsed.
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <FL/Fl_Menu_Button.H> #include <FL/Fl_Menu_Button.H>
#include <FL/Fl_Check_Button.H> #include <FL/Fl_Check_Button.H>
#include <FL/Fl_Value_Input.H> #include <FL/Fl_Value_Input.H>
#include <FL/Fl_Value_Output.H> #include <FL/Fl_Output.H>
#include <FL/Fl_Multiline_Output.H> #include <FL/Fl_Multiline_Output.H>
#include <FL/Fl_Browser.H> #include <FL/Fl_Browser.H>
#include <FL/Fl_Bitmap.H> #include <FL/Fl_Bitmap.H>
...@@ -124,12 +124,12 @@ class GUI{ ...@@ -124,12 +124,12 @@ class GUI{
Fl_Value_Input *post_value[20] ; Fl_Value_Input *post_value[20] ;
// statistics window // statistics window
Fl_Value_Output *stat_value[40] ; Fl_Output *stat_value[50] ;
// view options window // view options window
Fl_Check_Button *view_butt[20] ; Fl_Check_Button *view_butt[20] ;
Fl_Value_Input *view_value[10] ; Fl_Value_Input *view_value[20] ;
Fl_Input *view_input[10] ; Fl_Input *view_input[20] ;
public: public:
...@@ -145,18 +145,17 @@ public: ...@@ -145,18 +145,17 @@ public:
int get_context(); int get_context();
void set_anim(int mode); void set_anim(int mode);
void set_status(char *msg, int num); void set_status(char *msg, int num);
void set_statistics();
// create option windows
void opt_general(); // create additional windows
void opt_geometry(); void create_general_options_window();
void opt_mesh(); void create_geometry_options_window();
void opt_post(); void create_mesh_options_window();
void opt_statistics(); void create_post_options_window();
void opt_view(); void create_statistics_window();
void create_view_window();
// create help windows void create_help_window();
void help_short(); void create_about_window();
void help_about();
}; };
......
// $Id: Opengl.cpp,v 1.3 2001-01-09 13:28:44 geuzaine Exp $ // $Id: Opengl.cpp,v 1.4 2001-01-09 15:45:03 geuzaine Exp $
#include "Gmsh.h" #include "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -234,7 +234,7 @@ int Opengl_Window::handle(int event) { ...@@ -234,7 +234,7 @@ int Opengl_Window::handle(int event) {
switch (event) { switch (event) {
/* ------------------------------------------------------------- /* -------------------------------------------------------------
K e y s S h o r t c u t s
------------------------------------------------------------- */ ------------------------------------------------------------- */
case FL_SHORTCUT: case FL_SHORTCUT:
...@@ -244,34 +244,6 @@ int Opengl_Window::handle(int event) { ...@@ -244,34 +244,6 @@ int Opengl_Window::handle(int event) {
*/ */
return 0; return 0;
case FL_ENTER :
case FL_LEAVE :
ButtonPressed = 0;
Modifier = 0;
return Fl_Gl_Window::handle(event);
case FL_FOCUS:
return 1;
case FL_UNFOCUS:
return 1;
case FL_KEYBOARD:
switch(Fl::event_key()){
case FL_Control_L : case FL_Control_R :
printf("got a ctrl\n");
Modifier = 1;
return 1;
case FL_Alt_L : case FL_Alt_R :
case FL_Meta_L : case FL_Meta_R :
Modifier = 2;
return 1;
default:
return Fl_Gl_Window::handle(event);
}
break;
/* ------------------------------------------------------------- /* -------------------------------------------------------------
B u t t o n P r e s s B u t t o n P r e s s
------------------------------------------------------------- */ ------------------------------------------------------------- */
...@@ -469,8 +441,7 @@ int Opengl_Window::handle(int event) { ...@@ -469,8 +441,7 @@ int Opengl_Window::handle(int event) {
O t h er O t h er
------------------------------------------------------------- */ ------------------------------------------------------------- */
default: default: // pass other events to the base class...
// pass other events to the base class...
return Fl_Gl_Window::handle(event); return Fl_Gl_Window::handle(event);
} }
......
#include "Gmsh.h"
#include "Geo.h"
#include "CAD.h"
#include "Mesh.h"
#include "DataBase.h"
extern Mesh *THEM;
/* Gestion des entites visibles */
Tree_T *EntitesVisibles=NULL;
int SHOW_ALL_ENTITIES;
typedef struct{
int Entite;
int Visible;
}EntiteVisible;
int compareEntiteVisible(const void *a, const void *b){
EntiteVisible *q,*w;
q = (EntiteVisible*)a;
w = (EntiteVisible*)b;
return(q->Entite-w->Entite);
}
int EntiteEstElleVisible(int iEnt){
EntiteVisible e;
e.Entite = iEnt;
if(Tree_Query(EntitesVisibles,&e))
return e.Visible;
return 1;
}
void ToutesLesEntitesRelatives(int iEnt, Tree_T *Tree, int add_rem){
int i;
EntiteVisible e;
Surface *s;
Volume *v;
Curve *c;
if((c = FindCurve(iEnt,THEM))){
}
else if((s = FindSurface(iEnt,THEM))){
for(i=0;i<List_Nbr(s->s.Generatrices);i++){
List_Read(s->s.Generatrices,i,&c);
e.Entite = abs(c->Num);
e.Visible = add_rem;
Tree_Replace(Tree,&e);
}
}
else if((v = FindVolume(iEnt,THEM))){
for(i=0;i<List_Nbr(v->Surfaces);i++){
List_Read(v->Surfaces,i,&s);
e.Entite = abs(s->Num);
e.Visible = add_rem;
Tree_Replace(Tree,&e);
}
}
e.Entite = abs(iEnt);
e.Visible = add_rem;
Tree_Replace(Tree,&e);
}
void RemplirEntitesVisibles (int add_rem){
int i;
Volume *v;
Surface *s;
Curve *c;
List_T *ListVolumes = Tree2List (THEM->Volumes);
List_T *ListSurfaces = Tree2List (THEM->Surfaces);
List_T *ListCurves = Tree2List (THEM->Curves);
EntitesVisibles = Tree_Create(sizeof(EntiteVisible),compareEntiteVisible);
for(i=0;i<List_Nbr(ListVolumes);i++){
List_Read(ListVolumes,i,&v);
ToutesLesEntitesRelatives(v->Num,EntitesVisibles,add_rem);
}
for(i=0;i<List_Nbr(ListSurfaces);i++){
List_Read(ListSurfaces,i,&s);
ToutesLesEntitesRelatives(s->Num,EntitesVisibles,add_rem);
}
for(i=0;i<List_Nbr(ListCurves);i++){
List_Read(ListCurves,i,&c);
ToutesLesEntitesRelatives(c->Num,EntitesVisibles,add_rem);
}
List_Delete(ListVolumes);
List_Delete(ListSurfaces);
List_Delete(ListCurves);
}
#ifndef _VISIBILITY_H_
#define _VISIBILITY_H_
int EntiteEstElleVisible(int iEnt);
void ToutesLesEntitesRelatives(int iEnt, Tree_T *Tree, int add_rem);
void RemplirEntitesVisibles (int add_rem);
extern Tree_T *EntitesVisibles;
extern int SHOW_ALL_ENTITIES;
#endif
#ifndef _CREATE_FILE_H_
#define _CREATE_FILE_H_
void CreateFile (char *name, int format) ;
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment