diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 763391ff3c5af8cdcfac98b9412b246e00fa0eb6..73a84b3d19026badb2f54dddbad188361514b4b1 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -191,7 +191,7 @@ StringXNumber MeshOptions_Number[] = { StringXNumber PostProcessingOptions_Number[] = { { "Scales" , opt_post_scales , 1. }, { "Link" , opt_post_link , 0. }, - { "Smoothing" , opt_post_smooth , 0. }, + { "Smoothing" , opt_post_smooth , 1. }, { "AnimationDelay" , opt_post_anim_delay , 0.25 }, { "NbViews" , opt_post_nb_views , 0. }, { NULL , NULL , 0. } diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 95cf3abe974839470c427b6a58582d2b1167cb04..1d9ee8328cb604ff442387239db4416733823084 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.29 2001-02-12 17:38:02 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.30 2001-02-16 20:16:40 remacle Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -1307,7 +1307,7 @@ void view_duplicate_cb(CALLBACK_ARGS){ v = (Post_View*)List_Pointer(Post_ViewList, i); \ if(CTX.post.link == 2 || \ (CTX.post.link == 1 && v->Visible) || \ - (CTX.post.link == 0 && i == (int)data)){ + (CTX.post.link == 0 && i == WID->view_number)){ #define ENDVIEWMOD \ } \ diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 48ea3d7ba8ea6eb777ed18bf3d63c1535700b080..d8dfc81bab817cb492fa8cbfdaa9750a735f783a 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.44 2001-02-12 17:38:02 geuzaine Exp $ +// $Id: GUI.cpp,v 1.45 2001-02-16 20:16:40 remacle Exp $ // To make the interface as visually consistent as possible, please: // - use the BH, BW, WB, IW values for button heights/widths, window borders, etc. @@ -1744,7 +1744,8 @@ void GUI::create_view_options_window(int num){ { Fl_Return_Button* o = new Fl_Return_Button(width-2*BB-2*WB, height-BH-WB, BB, BH, "OK"); o->labelsize(CTX.fontsize); - o->callback(view_options_ok_cb); + printf("num = %d\n",num); + o->callback(view_options_ok_cb,(void*)num); } { Fl_Button* o = new Fl_Button(width-BB-WB, height-BH-WB, BB, BH, "cancel"); diff --git a/Graphics/IsoSimplex.cpp b/Graphics/IsoSimplex.cpp index bef930f9c95f28335435659c8b57b50e7f584233..967ca28be88d43df4ebd20f1464b837dac9b56ae 100644 --- a/Graphics/IsoSimplex.cpp +++ b/Graphics/IsoSimplex.cpp @@ -93,6 +93,8 @@ void IsoSimplex( Post_View *View, } } + if(nb < 3)return; + /* 3 possibilities for quads -) 0,2,5,3 @@ -121,66 +123,61 @@ void IsoSimplex( Post_View *View, v = unknown field we wanna draw */ - if(nb > 2) - { - double v1[3] = {Xp[2]-Xp[0],Yp[2]-Yp[0],Zp[2]-Zp[0]}; - double v2[3] = {Xp[1]-Xp[0],Yp[1]-Yp[0],Zp[1]-Zp[0]}; - double gr[3]; - double n[3],xx; - prodve(v1,v2,n); - norme(n); - gradSimplex(X,Y,Z,Val,gr); - prosca(gr,n,&xx); + double v1[3] = {Xp[2]-Xp[0],Yp[2]-Yp[0],Zp[2]-Zp[0]}; + double v2[3] = {Xp[1]-Xp[0],Yp[1]-Yp[0],Zp[1]-Zp[0]}; + double gr[3]; + double n[3],xx; + prodve(v1,v2,n); + norme(n); + gradSimplex(X,Y,Z,Val,gr); + prosca(gr,n,&xx); - if(xx > 0) + if(xx > 0) + { + for(i=0;i<nb;i++) { - for(i=0;i<nb;i++) - { - Xpi[i] = Xp[i]; - Ypi[i] = Yp[i]; - Zpi[i] = Zp[i]; - } - for(i=0;i<nb;i++) - { - Xp[i] = Xpi[nb-i-1]; - Yp[i] = Ypi[nb-i-1]; - Zp[i] = Zpi[nb-i-1]; - } + Xpi[i] = Xp[i]; + Ypi[i] = Yp[i]; + Zpi[i] = Zp[i]; } - else + for(i=0;i<nb;i++) { - n[0] = -n[0]; - n[1] = -n[1]; - n[2] = -n[2]; + Xp[i] = Xpi[nb-i-1]; + Yp[i] = Ypi[nb-i-1]; + Zp[i] = Zpi[nb-i-1]; } - if(preproNormals) + } + else + { + n[0] = -n[0]; + n[1] = -n[1]; + n[2] = -n[2]; + } + if(preproNormals) + { + for(i=0;i<nb;i++) { - for(i=0;i<nb;i++) - { - View->add_normal(Xp[i],Yp[i],Zp[i],n[0],n[1],n[2]); - } - return; + View->add_normal(Xp[i],Yp[i],Zp[i],n[0],n[1],n[2]); } - else + return; + } + else + { + for(i=0;i<nb;i++) { - for(i=0;i<nb;i++) + if(!View->get_normal(Xp[i],Yp[i],Zp[i],norms[3*i],norms[3*i+1],norms[3*i+2])) { - if(!View->get_normal(Xp[i],Yp[i],Zp[i],norms[3*i],norms[3*i+1],norms[3*i+2])) - { - //printf("coucou\n"); - norms[3*i] = n[0]; - norms[3*i+1] = n[1]; - norms[3*i+2] = n[2]; - } - } - } - } - - + //printf("coucou\n"); + norms[3*i] = n[0]; + norms[3*i+1] = n[1]; + norms[3*i+2] = n[2]; + } + } + } + if(nb == 3) Draw_Triangle(Xp,Yp,Zp,norms,Offset,Raise,shade); else if(nb == 4) - Draw_Quadrangle(Xp,Yp,Zp,norms,Offset,Raise,shade); - + Draw_Quadrangle(Xp,Yp,Zp,norms,Offset,Raise,shade); } diff --git a/Graphics/gl2ps.cpp b/Graphics/gl2ps.cpp index d07b59b9b789cb520ca685033bb98ec5a0d8959f..5f67567165cd1501687a10070eb7493afd8a60b9 100644 --- a/Graphics/gl2ps.cpp +++ b/Graphics/gl2ps.cpp @@ -1,4 +1,4 @@ -// $Id: gl2ps.cpp,v 1.7 2001-01-11 14:11:57 geuzaine Exp $ +// $Id: gl2ps.cpp,v 1.8 2001-02-16 20:16:40 remacle Exp $ /* * GL2PS, an OpenGL to Postscript Printing Library, version 0.31 @@ -36,7 +36,7 @@ static GL2PScontext gl2ps; -GLvoid gl2psMsg(GLint level, char *fmt, ...){ +void gl2psMsg(GLint level, char *fmt, ...){ va_list args; if(!(gl2ps.options & GL2PS_SILENT)){ @@ -69,12 +69,12 @@ GLvoid *gl2psRealloc(GLvoid *ptr, size_t size){ return(ptr); } -GLvoid gl2psFree(GLvoid *ptr){ +void gl2psFree(GLvoid *ptr){ if(!ptr) return; free(ptr); } -GLvoid gl2psListRealloc(GL2PSlist *list, GLint n){ +void gl2psListRealloc(GL2PSlist *list, GLint n){ if(n <= 0) return; if(!list->array){ list->nmax = ((n - 1) / list->incr + 1) * list->incr; @@ -103,12 +103,12 @@ GL2PSlist *gl2psListCreate(GLint n, GLint incr, GLint size){ return(list); } -GLvoid gl2psListDelete(GL2PSlist *list){ +void gl2psListDelete(GL2PSlist *list){ gl2psFree(list->array); gl2psFree(list); } -GLvoid gl2psListAdd(GL2PSlist *list, GLvoid *data){ +void gl2psListAdd(GL2PSlist *list, GLvoid *data){ list->n++; gl2psListRealloc(list, list->n); memcpy(&list->array[(list->n - 1) * list->size], data, list->size); @@ -118,18 +118,18 @@ GLint gl2psListNbr(GL2PSlist *list){ return(list->n); } -GLvoid *gl2psListPointer(GL2PSlist *list, GLint index){ +void *gl2psListPointer(GL2PSlist *list, GLint index){ if((index < 0) || (index >= list->n)) gl2psMsg(GL2PS_ERROR, "Wrong List Index in gl2psListPointer"); return(&list->array[index * list->size]); } -GLvoid gl2psListSort(GL2PSlist *list, +void gl2psListSort(GL2PSlist *list, GLint (*fcmp)(const GLvoid *a, const GLvoid *b)){ qsort(list->array, list->n, list->size, fcmp); } -GLvoid gl2psListAction(GL2PSlist *list, +void gl2psListAction(GL2PSlist *list, GLvoid (*action)(GLvoid *data, GLvoid *dummy)){ GLint i, dummy; @@ -957,7 +957,7 @@ GLint gl2psGetVertex(GL2PSvertex *v, GLfloat *p){ } } -GLint gl2psParseFeedbackBuffer(GLvoid){ +GLint gl2psParseFeedbackBuffer(){ GLint i, used, count, v, vtot, offset=0, dash=0; GLshort boundary, flag; GLfloat *current; @@ -1063,7 +1063,7 @@ GLint gl2psParseFeedbackBuffer(GLvoid){ return GL2PS_SUCCESS; } -GLvoid gl2psPrintPostscriptHeader(GLvoid){ +GLvoid gl2psPrintPostscriptHeader(){ GLint viewport[4], index; GLfloat rgba[4]; time_t now; @@ -1229,7 +1229,7 @@ GLvoid gl2psBeginPage(char *title, char *producer, GLint sort, GLint options, glRenderMode(GL_FEEDBACK); } -GLint gl2psEndPage(GLvoid){ +GLint gl2psEndPage(void){ GL2PSbsptree *root; GL2PSxyz eye={0., 0., 100000.}; GLint shademodel, res; diff --git a/Graphics/gl2ps.h b/Graphics/gl2ps.h index 9266b1474a2fc9a5ea9ceead3b995402b1fb9b63..eb5f8c623c267048ef70b40fc7fdb5e4cddb91e1 100644 --- a/Graphics/gl2ps.h +++ b/Graphics/gl2ps.h @@ -149,12 +149,12 @@ typedef struct { /* public functions */ -GLvoid gl2psBeginPage(char *title, char *producer, GLint sort, GLint options, +void gl2psBeginPage(char *title, char *producer, GLint sort, GLint options, GLint colormode, GLint colorsize, GL2PSrgba *colormap, GLint buffersize, FILE * stream); -GLint gl2psEndPage(GLvoid); -GLvoid gl2psText(char *str, char *fontname, GLint size); -GLvoid gl2psEnable(GLint mode); -GLvoid gl2psDisable(GLint mode); +GLint gl2psEndPage(void); +void gl2psText(char *str, char *fontname, GLint size); +void gl2psEnable(GLint mode); +void gl2psDisable(GLint mode); #endif diff --git a/Mesh/Print_Mesh.cpp b/Mesh/Print_Mesh.cpp index 541ef16b335f2743372946ae5058308fe87c2c98..4dd98bf87889ff85c9d82c275bdbb3195581154e 100644 --- a/Mesh/Print_Mesh.cpp +++ b/Mesh/Print_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: Print_Mesh.cpp,v 1.12 2001-01-12 13:29:00 geuzaine Exp $ +// $Id: Print_Mesh.cpp,v 1.13 2001-02-16 20:16:40 remacle Exp $ #include "Gmsh.h" #include "Const.h" @@ -107,6 +107,18 @@ void add_msh_simplex (void *a, void *b){ type = TETRAHEDRON; } + if(type == TETRAHEDRON) + { + if ((*S)->Volume_Simplexe () > 0){ + Vertex *temp; + temp = (*S)->V[0]; + (*S)->V[0] = (*S)->V[1]; + (*S)->V[1] = temp; + // if ((*S)->Volume_Simplexe () < 0) + Msg(WARNING, "Negative Volume for Simplex %d", (*S)->Num); + } + } + fprintf (mshfile, "%d %d %d %d %d", MSH_ELEMENT_NUM++, type,MSH_PHYSICAL_NUM,(*S)->iEnt, nbn + nbs); diff --git a/Parser/FunctionManager.cpp b/Parser/FunctionManager.cpp index 027ef6e36b7435a1ffe3273631ef53f89563f534..606c015b44854861396b688d71d6be9fb3b6132e 100644 --- a/Parser/FunctionManager.cpp +++ b/Parser/FunctionManager.cpp @@ -1,4 +1,4 @@ -// $Id: FunctionManager.cpp,v 1.8 2001-02-09 14:51:31 geuzaine Exp $ +// $Id: FunctionManager.cpp,v 1.9 2001-02-16 20:16:40 remacle Exp $ #include <stdio.h> #include <stack> @@ -30,20 +30,12 @@ class File_Position class mystack { public: -#ifdef WIN32 - std::stack<File_Position> s; -#else - stack<File_Position> s; -#endif + std::stack<File_Position> s; }; class mymap { public : -#ifdef WIN32 std::map<char*,File_Position,ltstr> m; -#else - map<char*,File_Position,ltstr> m; -#endif }; FunctionManager *FunctionManager::instance = 0;