diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 500072cebf19edc3e91ad1b98a28eedf0a1fca40..6048758029d324ddfc3257f2531fe3c9d6042825 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.97 2001-12-03 08:41:43 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.98 2001-12-04 12:06:49 geuzaine Exp $ #include <sys/types.h> #include <signal.h> @@ -6,6 +6,7 @@ #include "Gmsh.h" #include "GmshUI.h" #include "Geo.h" +#include "CAD.h" #include "Verif.h" #include "Mesh.h" #include "Draw.h" @@ -537,9 +538,9 @@ void select_vis_browser(int mode){ Entity *e; for(i=1 ; i<=WID->vis_browser->size(); i++){ e = (Entity*)WID->vis_browser->data(i); - if((mode == VIS_GEO|VIS_MESH && e->Visible() == mode) || - (mode == VIS_GEO && e->Visible() & VIS_GEO) || - (mode == VIS_MESH && e->Visible() & VIS_MESH)) + if((mode == VIS_GEOM|VIS_MESH && e->Visible() == mode) || + (mode == VIS_GEOM && e->Visible() & VIS_GEOM) || + (mode == VIS_MESH && e->Visible() & VIS_MESH)) WID->vis_browser->select(i); } } @@ -557,8 +558,8 @@ void opt_visibility_cb(CALLBACK_ARGS) { default: type = PHYSICAL; break; } switch(WID->vis_browser_mode->value()){ - case 0 : mode = VIS_GEO|VIS_MESH; break; - case 1 : mode = VIS_GEO; break; + case 0 : mode = VIS_GEOM|VIS_MESH; break; + case 1 : mode = VIS_GEOM; break; default: mode = VIS_MESH; break; } @@ -582,8 +583,8 @@ void opt_visibility_ok_cb(CALLBACK_ARGS) { default: ClearVisibilityList(ELEMENTARY); break; } switch(WID->vis_browser_mode->value()){ - case 0 : mode = VIS_GEO|VIS_MESH; break; - case 1 : mode = VIS_GEO; break; + case 0 : mode = VIS_GEOM|VIS_MESH; break; + case 1 : mode = VIS_GEOM; break; default: mode = VIS_MESH; break; } @@ -602,7 +603,7 @@ void opt_visibility_ok_cb(CALLBACK_ARGS) { else e->Visible(0); break; default : - if(e->Visible() & VIS_GEO) e->Visible(VIS_GEO); + if(e->Visible() & VIS_GEOM) e->Visible(VIS_GEOM); else e->Visible(0); break; } @@ -642,18 +643,24 @@ void opt_visibility_sort_cb(CALLBACK_ARGS){ } } -static int vnod, velm; +static int vnod, velm, vcur, vsur, vvol; static void vis_nod(void *a, void *b){ (*(Vertex**)a)->Visible = vnod; } static void vis_sim(void *a, void *b){ (*(Simplex**)a)->Visible = velm; } static void vis_hex(void *a, void *b){ (*(Hexahedron**)a)->Visible = velm; } static void vis_pri(void *a, void *b){ (*(Prism**)a)->Visible = velm; } static void vis_pyr(void *a, void *b){ (*(Pyramid**)a)->Visible = velm; } +static void vis_cur(void *a, void *b){ (*(Curve**)a)->Visible = vcur; } +static void vis_sur(void *a, void *b){ (*(Surface**)a)->Visible = vsur; } +static void vis_vol(void *a, void *b){ (*(Volume**)a)->Visible = vvol; } void opt_visibility_number_cb(CALLBACK_ARGS){ - static int allnod=1, allelm=1; - int i, type = WID->vis_input_mode->value(), found, num; + static int allnod=1, allelm=1, allpnt=1, allcur=1, allsur=1, allvol=1; + int i, found, num, mode; + int type = WID->vis_input_mode->value(); List_T *tmp; Vertex vv,*v,**pv; + Curve *c; + Surface *s; Volume *V; Simplex SS, *S, **pS; Hexahedron HH, *H, **pH; @@ -661,13 +668,20 @@ void opt_visibility_number_cb(CALLBACK_ARGS){ Pyramid QQ, *Q, **pQ; char *str = (char*)((Fl_Input*)w)->value(); + switch(WID->vis_browser_mode->value()){ + case 0 : mode = VIS_GEOM|VIS_MESH; break; + case 1 : mode = VIS_GEOM; break; + default: mode = VIS_MESH; break; + } + if (!strcmp(str,"all") || !strcmp(str,"*")){ - if(type==0){ + switch(type){ + case 0: //node allnod = !allnod; vnod = allnod ? VIS_MESH : 0; Tree_Action(THEM->Vertices, vis_nod); - } - else{ + break; + case 1: //element allelm = !allelm; velm = allelm ? VIS_MESH : 0; Tree_Action(THEM->Simplexes, vis_sim); @@ -679,19 +693,40 @@ void opt_visibility_number_cb(CALLBACK_ARGS){ Tree_Action(V->Pyramids, vis_pyr); } List_Delete(tmp); + case 2: //point + allpnt = !allpnt; + vnod = allpnt ? VIS_MESH|VIS_GEOM : 0; + Tree_Action(THEM->Points, vis_nod); + break; + case 3: //curve + allcur = !allcur; + vcur = allcur ? VIS_MESH|VIS_GEOM : 0; + Tree_Action(THEM->Curves, vis_cur); + break; + case 4: //surface + allsur = !allsur; + vsur = allsur ? VIS_MESH|VIS_GEOM : 0; + Tree_Action(THEM->Surfaces, vis_sur); + break; + case 5: //volume + allvol= !allvol; + vvol = allvol ? VIS_MESH|VIS_GEOM : 0; + Tree_Action(THEM->Volumes, vis_vol); + break; } } else{ num = atoi(str); - if(type==0){ + switch(type){ + case 0: //node vv.Num = num; v = &vv; if((pv = (Vertex**)Tree_PQuery(THEM->Vertices, &v))) (*pv)->Visible = (*pv)->Visible ? 0 : VIS_MESH; else Msg(WARNING, "Unknown node %d (use '*' to hide/show all nodes)", num); - } - else{ + break; + case 1: //element SS.Num = num; S = &SS; HH.Num = num; H = &HH; PP.Num = num; P = &PP; @@ -718,8 +753,27 @@ void opt_visibility_number_cb(CALLBACK_ARGS){ if(!found) Msg(WARNING, "Unknown element %d (use '*' to hide/show all elements)", num); } + break; + case 2: //point + if((v=FindPoint(num,THEM))) v->Visible = v->Visible ? 0 : VIS_GEOM|VIS_MESH ; + else Msg(WARNING, "Unknown point %d (use '*' to hide/show all points)", num); + break; + case 3: //curve + if((c=FindCurve(num,THEM))) c->Visible = c->Visible ? 0 : VIS_GEOM|VIS_MESH ; + else Msg(WARNING, "Unknown curve %d (use '*' to hide/show all curves)", num); + break; + case 4: //surface + if((s=FindSurface(num,THEM))) s->Visible = s->Visible ? 0 : VIS_GEOM|VIS_MESH ; + else Msg(WARNING, "Unknown surface %d (use '*' to hide/show all surfaces)", num); + break; + case 5: //volume + if((V=FindVolume(num,THEM))) V->Visible = V->Visible ? 0 : VIS_GEOM|VIS_MESH ; + else Msg(WARNING, "Unknown volume %d (use '*' to hide/show all volumes)", num); + break; } } + + opt_visibility_cb(NULL,NULL); Draw(); } diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 6c3cfca73b5b9bf1f9408c722e5740746d8bc9ac..cac7bdfef1f2db8833f675baac528e0c095c5ebb 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.139 2001-12-03 08:41:43 geuzaine Exp $ +// $Id: GUI.cpp,v 1.140 2001-12-04 12:06:49 geuzaine Exp $ // To make the interface as visually consistent as possible, please: // - use the IW, BB, BH, BW and WB values @@ -1971,6 +1971,10 @@ void GUI::create_visibility_window(){ static Fl_Menu_Item input_mode_table[] = { {"Node", 0, 0}, {"Element", 0, 0}, + {"Point", 0, 0}, + {"Curve", 0, 0}, + {"Surface", 0, 0}, + {"Volume", 0, 0}, {0} }; diff --git a/Graphics/Geom.cpp b/Graphics/Geom.cpp index 56d1c8e10ebede9a683f41ee8ef105f276c2e04f..a0b94a847e888934a5b8d459b302c94396152d2a 100644 --- a/Graphics/Geom.cpp +++ b/Graphics/Geom.cpp @@ -1,4 +1,4 @@ -// $Id: Geom.cpp,v 1.32 2001-12-03 08:41:43 geuzaine Exp $ +// $Id: Geom.cpp,v 1.33 2001-12-04 12:06:49 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -28,7 +28,7 @@ void Draw_GeoPoint (void *a, void *b){ v = *(Vertex**)a; - if(!(v->Visible & VIS_GEO)) return; + if(!(v->Visible & VIS_GEOM)) return; if(CTX.render_mode == GMSH_SELECT){ glLoadName(0); @@ -85,7 +85,7 @@ void Draw_Curve (void *a, void *b){ c = *(Curve**)a; - if(c->Num<0 || !(c->Visible & VIS_GEO) || c->Dirty) return; + if(c->Num<0 || !(c->Visible & VIS_GEOM) || c->Dirty) return; if(CTX.render_mode == GMSH_SELECT){ glLoadName(1); @@ -494,7 +494,7 @@ void Draw_Surface (void *a, void *b){ s = *(Surface**)a; - if(!s || !s->Support || !(s->Visible & VIS_GEO) || s->Dirty) return; + if(!s || !s->Support || !(s->Visible & VIS_GEOM) || s->Dirty) return; if(CTX.render_mode == GMSH_SELECT){ glLoadName(2); diff --git a/Mesh/Create.cpp b/Mesh/Create.cpp index 82235be0fa6f6cb6749a4f5cf183460c1496ca01..323936de736fb7f9441ce256aa99b4f1413bcd21 100644 --- a/Mesh/Create.cpp +++ b/Mesh/Create.cpp @@ -1,4 +1,4 @@ -// $Id: Create.cpp,v 1.31 2001-12-03 08:41:44 geuzaine Exp $ +// $Id: Create.cpp,v 1.32 2001-12-04 12:06:49 geuzaine Exp $ #include "Gmsh.h" #include "Numeric.h" @@ -159,7 +159,7 @@ void Add_PhysicalGroup (int Num, int typ, List_T * intlist, Mesh * M){ p->Num = Num; THEM->MaxPhysicalNum = IMAX(THEM->MaxPhysicalNum,Num); p->Typ = typ; - p->Visible = VIS_GEO|VIS_MESH; + p->Visible = VIS_GEOM|VIS_MESH; for (i = 0; i < List_Nbr (intlist); i++){ List_Read (intlist, i, &j); List_Add (p->Entities, &j); @@ -408,7 +408,7 @@ Curve *Create_Curve (int Num, int Typ, int Order, List_T * Liste, pC = (Curve *) Malloc (sizeof (Curve)); pC->Dirty = 0; - pC->Visible = VIS_GEO|VIS_MESH; + pC->Visible = VIS_GEOM|VIS_MESH; pC->cp = NULL; pC->Vertices = NULL; pC->Extrude = NULL; @@ -519,7 +519,7 @@ Surface * Create_Surface (int Num, int Typ){ pS = (Surface *) Malloc (sizeof (Surface)); pS->Dirty = 0; - pS->Visible = VIS_GEO|VIS_MESH; + pS->Visible = VIS_GEOM|VIS_MESH; pS->Num = Num; THEM->MaxSurfaceNum = IMAX(THEM->MaxSurfaceNum,Num); pS->Typ = Typ; @@ -566,7 +566,7 @@ Volume * Create_Volume (int Num, int Typ){ pV = (Volume *) Malloc (sizeof (Volume)); pV->Dirty = 0; - pV->Visible = VIS_GEO|VIS_MESH; + pV->Visible = VIS_GEOM|VIS_MESH; pV->Num = Num; THEM->MaxVolumeNum = IMAX(THEM->MaxVolumeNum,Num); pV->Typ = Typ; diff --git a/Mesh/Mesh.h b/Mesh/Mesh.h index bfd43ce946f3677087e2b069cf5965c8124c1fb5..2b9ee1fc76e8c75be83bb5cc68661cae3d435d49 100644 --- a/Mesh/Mesh.h +++ b/Mesh/Mesh.h @@ -26,7 +26,7 @@ #define CONV_VALUE 0.8 -#define VIS_GEO (1<<0) +#define VIS_GEOM (1<<0) #define VIS_MESH (1<<1) #define NOTTOLINK 1 diff --git a/Mesh/Vertex.cpp b/Mesh/Vertex.cpp index d07c7dd92180f04a12dac12a087735a8f4c659e6..3baf9166c1f800414a8fd1f35eb94063c6c9fd78 100644 --- a/Mesh/Vertex.cpp +++ b/Mesh/Vertex.cpp @@ -1,4 +1,4 @@ -// $Id: Vertex.cpp,v 1.15 2001-12-04 09:30:42 geuzaine Exp $ +// $Id: Vertex.cpp,v 1.16 2001-12-04 12:06:50 geuzaine Exp $ #include "Gmsh.h" #include "Numeric.h" @@ -11,7 +11,7 @@ extern Mesh *THEM ; Vertex::Vertex (){ Frozen = 0; - Visible = VIS_GEO|VIS_MESH; + Visible = VIS_GEOM|VIS_MESH; Pos.X = 0.0; Pos.Y = 0.0; Pos.Z = 0.0; @@ -24,7 +24,7 @@ Vertex::Vertex (){ Vertex::Vertex (double X, double Y, double Z, double l, double W){ Frozen = 0; - Visible = VIS_GEO|VIS_MESH; + Visible = VIS_GEOM|VIS_MESH; Pos.X = X; Pos.Y = Y; Pos.Z = Z;