From ba8acbebdde4bdd8083c9828b99619d70d4898c8 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Mon, 21 May 2001 20:19:08 +0000 Subject: [PATCH] some color cleaning --- Common/DefaultOptions.h | 64 ++++++++++++++++++++--------------------- Geo/Verif.cpp | 26 +---------------- Graphics/Mesh.cpp | 23 +++++++-------- 3 files changed, 44 insertions(+), 69 deletions(-) diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index c082ac3c2c..479d2ef2a9 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -626,33 +626,33 @@ StringXColor MeshOptions_Color[] = { PACK_COLOR(0, 0, 0, 255), "Mesh line color" }, { F|O, "Triangles" , opt_mesh_color_triangles , - PACK_COLOR(153, 143, 255, 255), - PACK_COLOR(153, 143, 255, 255), + PACK_COLOR(60,116,164, 255), + PACK_COLOR(60,116,164, 255), PACK_COLOR(255, 255, 255, 255), "Mesh triangle color (if ColorCarousel=0)" }, { F|O, "Quadrangles" , opt_mesh_color_quadrangles , - PACK_COLOR(182, 92, 255, 255), - PACK_COLOR(182, 92, 255, 255), + PACK_COLOR(112, 136, 188, 255), + PACK_COLOR(112, 136, 188, 255), PACK_COLOR(255, 255, 255, 255), "Mesh quadrangle color (if ColorCarousel=0)" }, { F|O, "Tetrahedra" , opt_mesh_color_tetrahedra , - PACK_COLOR(0, 255, 0, 255), - PACK_COLOR(0, 255, 0, 255), + PACK_COLOR(164, 160, 212, 255), + PACK_COLOR(164, 160, 212, 255), PACK_COLOR(255, 255, 255, 255), "Mesh tetrahedron color (if ColorCarousel=0)" }, { F|O, "Hexahedra" , opt_mesh_color_hexahedra , - PACK_COLOR(128, 255, 0, 255), - PACK_COLOR(128, 255, 0, 255), + PACK_COLOR(220, 184, 240, 255), + PACK_COLOR(220, 184, 240, 255), PACK_COLOR(255, 255, 255, 255), "Mesh hexahedron color (if ColorCarousel=0)" }, { F|O, "Prisms" , opt_mesh_color_prisms , - PACK_COLOR(0, 255, 128, 255), - PACK_COLOR(0, 255, 128, 255), + PACK_COLOR(108, 88, 128, 255), + PACK_COLOR(108, 88, 128, 255), PACK_COLOR(255, 255, 255, 255), "Mesh prism color (if ColorCarousel=0)" }, { F|O, "Pyramids" , opt_mesh_color_pyramid , - PACK_COLOR(128, 255, 128, 255), - PACK_COLOR(128, 255, 128, 255), + PACK_COLOR(80, 100, 140, 255), + PACK_COLOR(80, 100, 140, 255), PACK_COLOR(255, 255, 255, 255), "Mesh pyramid color (if ColorCarousel=0)" }, { F|O, "Normals" , opt_mesh_color_normals , @@ -666,53 +666,53 @@ StringXColor MeshOptions_Color[] = { PACK_COLOR(0, 0, 0, 255), "Tangent mesh vector color" }, { F|O, "One" , opt_mesh_color_1 , - PACK_COLOR(0 , 82 , 138, 255), - PACK_COLOR(0 , 82 , 138, 255), + PACK_COLOR(0, 0, 255, 255), + PACK_COLOR(0, 0, 255, 255), PACK_COLOR(255, 255, 255, 255), "First color in color carousel" }, { F|O, "Two" , opt_mesh_color_2 , - PACK_COLOR(255, 0 , 0 , 255), - PACK_COLOR(255, 0 , 0 , 255), + PACK_COLOR(0, 142, 255, 255), + PACK_COLOR(0, 142, 255, 255), PACK_COLOR(255, 255, 255, 255), "Second color in color carousel" }, { F|O, "Three" , opt_mesh_color_3 , - PACK_COLOR(31 , 110, 171, 255), - PACK_COLOR(31 , 110, 171, 255), + PACK_COLOR(0, 213, 255, 255), + PACK_COLOR(0, 213, 255, 255), PACK_COLOR(255, 255, 255, 255), "Third color in color carousel" }, { F|O, "Four" , opt_mesh_color_4 , - PACK_COLOR(255, 255, 0 , 255), - PACK_COLOR(255, 255, 0 , 255), + PACK_COLOR(0, 255, 226, 255), + PACK_COLOR(0, 255, 226, 255), PACK_COLOR(255, 255, 255, 255), "Fourth color in color carousel" }, { F|O, "Five" , opt_mesh_color_5 , - PACK_COLOR(255, 0 , 255, 255), - PACK_COLOR(255, 0 , 255, 255), + PACK_COLOR(0, 255, 117, 255), + PACK_COLOR(0, 255, 117, 255), PACK_COLOR(255, 255, 255, 255), "Fifth color in color carousel" }, { F|O, "Six" , opt_mesh_color_6 , - PACK_COLOR(128, 128, 0 , 255), - PACK_COLOR(128, 128, 0 , 255), + PACK_COLOR(117, 255, 0, 255), + PACK_COLOR(117, 255, 0, 255), PACK_COLOR(255, 255, 255, 255), "Sixth color in color carousel" }, { F|O, "Seven" , opt_mesh_color_7 , - PACK_COLOR(128, 0 , 255, 255), - PACK_COLOR(128, 0 , 255, 255), + PACK_COLOR(226, 255, 0, 255), + PACK_COLOR(226, 255, 0, 255), PACK_COLOR(255, 255, 255, 255), "Seventh color in color carousel" }, { F|O, "Eight" , opt_mesh_color_8 , - PACK_COLOR(128, 128, 255, 255), - PACK_COLOR(128, 128, 255, 255), + PACK_COLOR(255, 211, 0, 255), + PACK_COLOR(255, 211, 0, 255), PACK_COLOR(255, 255, 255, 255), "Eighth color in color carousel" }, { F|O, "Nine" , opt_mesh_color_9 , - PACK_COLOR(128, 128, 255, 255), - PACK_COLOR(128, 128, 255, 255), + PACK_COLOR(255, 139, 0, 255), + PACK_COLOR(255, 139, 0, 255), PACK_COLOR(255, 255, 255, 255), "Nitnth color in color carousel" }, { F|O, "Ten" , opt_mesh_color_10 , - PACK_COLOR(0 , 0 , 255, 255), - PACK_COLOR(0 , 0 , 255, 255), + PACK_COLOR(255, 0, 0, 255), + PACK_COLOR(255, 0, 0, 255), PACK_COLOR(255, 255, 255, 255), "tenth color in color carousel" }, { 0, NULL , NULL , 0, 0, 0 , NULL } diff --git a/Geo/Verif.cpp b/Geo/Verif.cpp index fbf06399d4..9cdbdaa253 100644 --- a/Geo/Verif.cpp +++ b/Geo/Verif.cpp @@ -1,4 +1,4 @@ -// $Id: Verif.cpp,v 1.7 2001-01-09 14:24:08 geuzaine Exp $ +// $Id: Verif.cpp,v 1.8 2001-05-21 20:19:07 geuzaine Exp $ #include "Gmsh.h" #include "Geo.h" @@ -258,27 +258,3 @@ int allfaceslinked (int iz , List_T *Liste , List_T *old){ return(CONTOUR_TROUVE); } -void PremierVolume(int iSurf, int *iVol){ - int i,j; - Surface *sur; - Volume *vol; - - *iVol = 0; - - List_T *temp = Tree2List(THEM->Volumes); - for(i=0;i<List_Nbr(temp);i++){ - List_Read(temp,i,&vol); - for(j=0;j<List_Nbr(vol->Surfaces);j++){ - List_Read(vol->Surfaces,j,&sur); - if(abs(sur->Num) == iSurf){ - List_Delete(temp); - *iVol = i+1; - return; - } - } - } - if(*iVol == 0) *iVol = iSurf; - - List_Delete(temp); -} - diff --git a/Graphics/Mesh.cpp b/Graphics/Mesh.cpp index b55d59fc4f..b5f766a933 100644 --- a/Graphics/Mesh.cpp +++ b/Graphics/Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: Mesh.cpp,v 1.25 2001-05-20 19:24:53 geuzaine Exp $ +// $Id: Mesh.cpp,v 1.26 2001-05-21 20:19:08 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -15,8 +15,6 @@ extern Mesh *THEM; extern Context_T CTX; -static int iVolume; - /* ------------------------------------------------------------------------ */ /* D r a w _ M e s h */ /* ------------------------------------------------------------------------ */ @@ -44,6 +42,8 @@ void draw_polygon_2d (double r, double g, double b, int n, } +static int iColor; + void ColorSwitch(int i){ glColor4ubv((GLubyte*)&CTX.color.mesh.carousel[i%10]); } @@ -70,6 +70,7 @@ void Draw_Mesh (Mesh *M) { glPointSize(2); glLineWidth(1); + iColor = 0; if(CTX.mesh.hidden) glEnable(GL_POLYGON_OFFSET_FILL); @@ -122,26 +123,24 @@ void Draw_Mesh (Mesh *M) { void Draw_Mesh_Volumes(void *a, void *b){ Volume **v; v = (Volume**)a; + iColor++; Tree_Action((*v)->Simplexes, Draw_Simplex_Volume); Tree_Action((*v)->Hexahedra, Draw_Hexahedron_Volume); Tree_Action((*v)->Prisms, Draw_Prism_Volume); } -void PremierVolume(int iSurf, int *iVol); - void Draw_Mesh_Surfaces (void *a,void *b){ Surface **s; s = (Surface**)a; - PremierVolume(abs((*s)->Num),&iVolume); - iVolume = -iVolume; + iColor++; Tree_Action((*s)->Simplexes, Draw_Simplex_Surfaces); } void Draw_Mesh_Curves (void *a, void *b){ Curve **c; - c = (Curve**)a; if((*c)->Num < 0)return; + iColor++; Tree_Action((*c)->Simplexes,Draw_Simplex_Points); } @@ -226,7 +225,7 @@ void Draw_Simplex_Volume (void *a, void *b){ } if(CTX.mesh.color_carousel) - ColorSwitch((*s)->iEnt+1); + ColorSwitch((*s)->iEnt); else glColor4ubv((GLubyte*)&CTX.color.mesh.tetrahedron); @@ -458,7 +457,7 @@ void Draw_Simplex_Surfaces (void *a, void *b){ } if(CTX.mesh.color_carousel) - ColorSwitch((*s)->iEnt); + ColorSwitch(iColor); else{ if(K==3) glColor4ubv((GLubyte*)&CTX.color.mesh.triangle); @@ -565,7 +564,7 @@ void Draw_Hexahedron_Volume (void *a, void *b){ } if(CTX.mesh.color_carousel) - ColorSwitch((*h)->iEnt+1); + ColorSwitch((*h)->iEnt); else glColor4ubv((GLubyte*)&CTX.color.mesh.hexahedron); @@ -658,7 +657,7 @@ void Draw_Prism_Volume (void *a, void *b){ if(!EntiteEstElleVisible((*p)->iEnt)) return; if(CTX.mesh.color_carousel) - ColorSwitch((*p)->iEnt+1); + ColorSwitch((*p)->iEnt); else glColor4ubv((GLubyte*)&CTX.color.mesh.prism); -- GitLab