diff --git a/Adapt/nrutil.h b/Adapt/nrutil.h index b1f26bc36859d917e2709e145f29de686bff73b6..191fc3528e8f13540eedf4f2cb2c706ec1262d69 100644 --- a/Adapt/nrutil.h +++ b/Adapt/nrutil.h @@ -1,7 +1,7 @@ #ifndef _NR_UTILS_H_ #define _NR_UTILS_H_ -#include "Const.h" +#include "Numeric.h" #define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a)) diff --git a/Box/Main.cpp b/Box/Main.cpp index d0b303f00291a8dd9cdeb3efcbc77f1218901319..99ad8a4ec4eed7e1d3573a9896fb3a0849a3998c 100644 --- a/Box/Main.cpp +++ b/Box/Main.cpp @@ -1,4 +1,4 @@ -// $Id: Main.cpp,v 1.9 2001-08-09 18:28:23 remacle Exp $ +// $Id: Main.cpp,v 1.10 2001-08-11 23:28:31 geuzaine Exp $ #include <signal.h> #include "ParUtil.h" @@ -11,7 +11,7 @@ #include "PluginManager.h" #include "Gmsh.h" #include "GmshVersion.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "Mesh.h" #include "Views.h" diff --git a/Common/Context.cpp b/Common/Context.cpp index 7f12dd27322540dfe7efb73a05cd55f695016a4d..53a44aa1797961a50d78d72e727aa829eb5f0194 100644 --- a/Common/Context.cpp +++ b/Common/Context.cpp @@ -1,7 +1,7 @@ -// $Id: Context.cpp,v 1.39 2001-02-20 18:32:58 geuzaine Exp $ +// $Id: Context.cpp,v 1.40 2001-08-11 23:28:31 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "Mesh.h" #include "Draw.h" diff --git a/Common/Context.h b/Common/Context.h index f02ae739aa25e1a7b690ea8f9262db43a000755f..c4ebf39cfba5a5135a4ed37d6b114f9c82254688 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -1,8 +1,6 @@ #ifndef _CONTEXT_H_ #define _CONTEXT_H_ -#include "Const.h" - // How RGBA values are packed and unpacked into/from a 4-byte integer # ifdef _LITTLE_ENDIAN @@ -26,14 +24,14 @@ class Context_T { public : // general options - char filename[NAME_STR_L]; // the name of the currently opened file - char base_filename[NAME_STR_L]; // the same without the extension + char filename[256]; // the name of the currently opened file + char base_filename[256]; // the same without the extension char *output_filename; // output file specified with command line option '-o' char *default_filename; // the name of the default file char *tmp_filename; // the name of the temp file - char *session_filename, sessionrc_filename[NAME_STR_L]; + char *session_filename, sessionrc_filename[256]; // the name of the sessionrc configuration file - char *options_filename, optionsrc_filename[NAME_STR_L]; + char *options_filename, optionsrc_filename[256]; // the name of the optionrc configuration file char *error_filename; // the name of the error file @@ -41,7 +39,7 @@ public : char *display; // forced display host:0.0 under X11 int terminal; // show we print to the terminal console? char *editor; // text editor command (with included '%s') - char home_dir[NAME_STR_L]; // the home directory + char home_dir[256]; // the home directory int position[2]; // position of the menu window on the screen int gl_position[2]; // position of the graphic window on the screen diff --git a/Common/GetOptions.cpp b/Common/GetOptions.cpp index 83fcbc78b0eb4a2e0d268072991d57f7cff3fe72..1fd654f2da0d445eae412e8450d5edb11371c063 100644 --- a/Common/GetOptions.cpp +++ b/Common/GetOptions.cpp @@ -1,10 +1,10 @@ -// $Id: GetOptions.cpp,v 1.34 2001-08-04 03:35:32 geuzaine Exp $ +// $Id: GetOptions.cpp,v 1.35 2001-08-11 23:28:31 geuzaine Exp $ #include <unistd.h> #include "Gmsh.h" #include "GmshUI.h" #include "GmshVersion.h" -#include "Const.h" +#include "Numeric.h" #include "Context.h" #include "Options.h" #include "Geo.h" @@ -494,7 +494,7 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { } - strncpy(CTX.filename, TheFileNameTab[0], NAME_STR_L); + strncpy(CTX.filename, TheFileNameTab[0], 255); } diff --git a/Common/Gmsh.h b/Common/Gmsh.h index ec3acf0e79846a2501a75cc417c0cde558033e2e..da95314a8d606725c2b5415fdb880736dc7ac27b 100644 --- a/Common/Gmsh.h +++ b/Common/Gmsh.h @@ -14,6 +14,11 @@ #undef false #define false 0 +#define TEXT_BUFFER_SIZE 1024 +#define SELECTION_BUFFER_SIZE 1024 +#define LABEL_STR_L 16 +#define MAX_OPEN_FILES 256 + #include <stdio.h> #include <stdlib.h> #include <math.h> diff --git a/Common/Numeric.cpp b/Common/Numeric.cpp new file mode 100644 index 0000000000000000000000000000000000000000..aca50feb50232fe10c419f3cbd79f1da809887b1 --- /dev/null +++ b/Common/Numeric.cpp @@ -0,0 +1,161 @@ +// $Id: Numeric.cpp,v 1.1 2001-08-11 23:28:31 geuzaine Exp $ + +#include "Gmsh.h" +#include "Numeric.h" + +// this file should contain only purely numerical routines (that do +// not depend on any Gmsh structures) + +double myatan2 (double a, double b){ + if (a == 0.0 && b == 0) + return 0.0; + return atan2 (a, b); +} + +double myacos (double a){ + if (a == 0) + return Pi * 0.5; + if (a == 1) + return 0.0; + return acos (a); +} + +void prodve (double a[3], double b[3], double c[3]){ + c[2] = a[0] * b[1] - a[1] * b[0]; + c[1] = -a[0] * b[2] + a[2] * b[0]; + c[0] = a[1] * b[2] - a[2] * b[1]; +} + +void prosca (double a[3], double b[3], double *c){ + *c = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; +} + +void norme (double a[3]){ + double mod; + mod = sqrt (a[0] * a[0] + a[1] * a[1] + a[2] * a[2]); + if (mod == 0.0) + return; + a[0] /= mod; + a[1] /= mod; + a[2] /= mod; +} + +int sys2x2 (double mat[2][2], double b[2], double res[2]){ + double det, ud, norm; + int i; + + norm = DSQR (mat[0][0]) + DSQR (mat[1][1]) + DSQR (mat[0][1]) + DSQR (mat[1][0]); + det = mat[0][0] * mat[1][1] - mat[1][0] * mat[0][1]; + + // TOLERANCE ! WARNING WARNING + if (norm == 0.0 || fabs (det) / norm < 1.e-07){ + Msg(DEBUG, "Assuming 2x2 matrix is singular (det/norm == %g)", fabs(det)/norm); + res[0] = res[1] = 0.0 ; + return 0; + } + ud = 1. / det; + + res[0] = b[0] * mat[1][1] - mat[0][1] * b[1]; + res[1] = mat[0][0] * b[1] - mat[1][0] * b[0]; + + for (i = 0; i < 2; i++) + res[i] *= ud; + return (1); +} + +int sys3x3 (double mat[3][3], double b[3], double res[3], double *det){ + double ud; + int i; + + *det = mat[0][0] * (mat[1][1] * mat[2][2] - mat[1][2] * mat[2][1]) - + mat[0][1] * (mat[1][0] * mat[2][2] - mat[1][2] * mat[2][0]) + + mat[0][2] * (mat[1][0] * mat[2][1] - mat[1][1] * mat[2][0]); + + if (*det == 0.0){ + res[0] = res[1] = res[2] = 0.0 ; + return (0); + } + + ud = 1. / (*det); + + res[0] = b[0] * (mat[1][1] * mat[2][2] - mat[1][2] * mat[2][1]) - + mat[0][1] * (b[1] * mat[2][2] - mat[1][2] * b[2]) + + mat[0][2] * (b[1] * mat[2][1] - mat[1][1] * b[2]); + + res[1] = mat[0][0] * (b[1] * mat[2][2] - mat[1][2] * b[2]) - + b[0] * (mat[1][0] * mat[2][2] - mat[1][2] * mat[2][0]) + + mat[0][2] * (mat[1][0] * b[2] - b[1] * mat[2][0]); + + res[2] = mat[0][0] * (mat[1][1] * b[2] - b[1] * mat[2][1]) - + mat[0][1] * (mat[1][0] * b[2] - b[1] * mat[2][0]) + + b[0] * (mat[1][0] * mat[2][1] - mat[1][1] * mat[2][0]); + + for (i = 0; i < 3; i++) + res[i] *= ud; + return (1); + +} + +int sys3x3_with_tol (double mat[3][3], double b[3], double res[3], double *det){ + int out; + double norm; + + out = sys3x3(mat,b,res,det); + norm = + DSQR (mat[0][0]) + DSQR (mat[0][1]) + DSQR (mat[0][2]) + + DSQR (mat[1][0]) + DSQR (mat[1][1]) + DSQR (mat[1][2]) + + DSQR (mat[2][0]) + DSQR (mat[2][1]) + DSQR (mat[2][2]) ; + + // TOLERANCE ! WARNING WARNING + if (norm == 0.0 || fabs (*det) / norm < 1.e-12){ + Msg(DEBUG, "Assuming 3x3 matrix is singular (det/norm == %g)", fabs(*det)/norm); + res[0] = res[1] = res[2] = 0.0 ; + return 0; + } + + return out ; +} + +int det3x3 (double mat[3][3], double *det){ + *det = mat[0][0] * (mat[1][1] * mat[2][2] - mat[1][2] * mat[2][1]) - + mat[0][1] * (mat[1][0] * mat[2][2] - mat[1][2] * mat[2][0]) + + mat[0][2] * (mat[1][0] * mat[2][1] - mat[1][1] * mat[2][0]); + return 1; +} + +int inv3x3 (double mat[3][3], double inv[3][3], double *det){ + double ud; + + *det = mat[0][0] * (mat[1][1] * mat[2][2] - mat[1][2] * mat[2][1]) - + mat[0][1] * (mat[1][0] * mat[2][2] - mat[1][2] * mat[2][0]) + + mat[0][2] * (mat[1][0] * mat[2][1] - mat[1][1] * mat[2][0]); + + if (*det == 0.0) + return (0); + + ud = 1. / (*det); + + inv[0][0] = ud * (mat[1][1] * mat[2][2] - mat[1][2] * mat[2][1]); + inv[0][1] = -ud * (mat[1][0] * mat[2][2] - mat[1][2] * mat[2][0]); + inv[0][2] = ud * (mat[1][0] * mat[2][1] - mat[1][1] * mat[2][0]); + inv[1][0] = -ud * (mat[0][1] * mat[2][2] - mat[0][2] * mat[2][1]); + inv[1][1] = ud * (mat[0][0] * mat[2][2] - mat[0][2] * mat[2][0]); + inv[1][2] = -ud * (mat[0][0] * mat[2][1] - mat[0][1] * mat[2][0]); + inv[2][0] = ud * (mat[0][1] * mat[1][2] - mat[0][2] * mat[1][1]); + inv[2][1] = -ud * (mat[0][0] * mat[1][2] - mat[0][2] * mat[1][0]); + inv[2][2] = ud * (mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0]); + return (1); + +} + +double angle_02pi (double A3){ + double DP = 2 * Pi; + while (A3 > DP || A3 < 0.){ + if (A3 > 0) + A3 -= DP; + else + A3 += DP; + } + return A3; +} + diff --git a/Common/Numeric.h b/Common/Numeric.h new file mode 100644 index 0000000000000000000000000000000000000000..7d00a54e852c54ab2e3bc60cf21ac772a5f4837a --- /dev/null +++ b/Common/Numeric.h @@ -0,0 +1,49 @@ +#ifndef _NUMERIC_H_ +#define _NUMERIC_H_ + +#include <math.h> + +#define RADTODEG 57.295779513082321 +#define RacineDeDeux 1.4142135623730950 +#define RacineDeTrois 1.7320508075688773 +#define Pi 3.1415926535897932 +#define Deux_Pi 6.2831853071795865 + +#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MAX(a,b) (((a)<(b))?(b):(a)) +#define SQR(a) ((a)*(a)) + +#define IMIN MIN +#define LMIN MIN +#define FMIN MIN +#define DMIN MIN + +#define IMAX MAX +#define LMAX MAX +#define FMAX MAX +#define DMAX MAX + +#define DSQR SQR +#define FSQR SQU + +#define THRESHOLD(a,b,c) (((a)>(c))?(c):((a)<(b)?(b):(a))) + +#define myhypot(a,b) (sqrt((a)*(a)+(b)*(b))) +#define sign(x) (((x)>=0)?1:-1) +#define Pred(x) ((x)->prev) +#define Succ(x) ((x)->next) +#define square(x) ((x)*(x)) + +double myatan2 (double a, double b); +double myacos (double a); +void prodve (double a[3], double b[3], double c[3]); +void prosca (double a[3], double b[3], double *c); +void norme (double a[3]); +int sys2x2 (double mat[2][2], double b[2], double res[2]); +int sys3x3 (double mat[3][3], double b[3], double res[3], double *det); +int sys3x3_with_tol (double mat[3][3], double b[3], double res[3], double *det); +int det3x3 (double mat[3][3], double *det); +int inv3x3 (double mat[3][3], double inv[3][3], double *det); +double angle_02pi (double A3); + +#endif diff --git a/Common/Static.h b/Common/Static.h index d0461f81b1bb9ff4c79b58bc6392434ab1faa1f9..44a4156f41ce53b42d0daa56e4b9162d030e5bd9 100644 --- a/Common/Static.h +++ b/Common/Static.h @@ -4,7 +4,7 @@ /* This file defines the static structures for Gmsh. It should be included only once, in your 'main' file */ -char yyname[NAME_STR_L]; +char yyname[256]; int yyerrorstate; int CurrentNodeNumber, CurrentSimplexNumber; diff --git a/Common/Views.cpp b/Common/Views.cpp index 284dd010f68c1e45ef3a6d3ac535c3b9f0fbe013..40ea8a6e52edb2ec3b7be3fbb95b8442b1412690 100644 --- a/Common/Views.cpp +++ b/Common/Views.cpp @@ -1,22 +1,21 @@ -// $Id: Views.cpp,v 1.49 2001-08-06 10:35:47 geuzaine Exp $ +// $Id: Views.cpp,v 1.50 2001-08-11 23:28:31 geuzaine Exp $ #include <set> #include "Gmsh.h" +#include "Numeric.h" #include "Views.h" #include "Context.h" #include "Options.h" #include "ColorTable.h" +extern Context_T CTX ; + +#define INFINITY 1.e200 + // this static stuff should be removed -int Post_ViewForceNumber = 0; List_T *Post_ViewList = NULL; Post_View *Post_ViewReference = NULL; - -extern Context_T CTX ; - -static Post_View *ActualView; -static int ActualViewNum=0, ActualViewIndex=0; -static int NbPoints, NbLines, NbTriangles, NbTetrahedra; +int Post_ViewForceNumber = 0; /* ------------------------------------------------------------------------ */ /* V i e w s */ @@ -31,309 +30,300 @@ int fcmpPostViewDuplicateOf(const void *v1, const void *v2){ } Post_View * BeginView(int allocate){ - Post_View v; + Post_View vv, *v; + static int UniqueNum=0; int i; if(!Post_ViewList) Post_ViewList = List_Create(100,1,sizeof(Post_View)); if(!Post_ViewForceNumber){ - // each view MUST have a unique, non-reattributable, number - v.Num = ++ActualViewNum; - List_Add(Post_ViewList, &v); + vv.Num = ++UniqueNum; // each view _must_ have a unique number + List_Add(Post_ViewList, &vv); } else{ - v.Num = Post_ViewForceNumber; - List_Replace(Post_ViewList,&v,fcmpPostViewNum); + vv.Num = Post_ViewForceNumber; + List_Replace(Post_ViewList,&vv,fcmpPostViewNum); } CTX.post.nb_views = List_Nbr(Post_ViewList); - ActualViewIndex = List_ISearch(Post_ViewList, &v, fcmpPostViewNum); - ActualView = (Post_View*)List_Pointer(Post_ViewList, ActualViewIndex); + i = List_ISearch(Post_ViewList, &vv, fcmpPostViewNum); + v = (Post_View*)List_Pointer(Post_ViewList, i); - NbPoints = NbLines = NbTriangles = NbTetrahedra = 0; - - ActualView->NbTimeStep = 0; - ActualView->NbSP = ActualView->NbVP = ActualView->NbTP = 0; - ActualView->NbSL = ActualView->NbVL = ActualView->NbTL = 0; - ActualView->NbST = ActualView->NbVT = ActualView->NbTT = 0; - ActualView->NbSS = ActualView->NbVS = ActualView->NbTS = 0; + v->Index = i; + v->Dirty = 1; + v->NbTimeStep = 0; + v->NbSP = v->NbVP = v->NbTP = 0; + v->NbSL = v->NbVL = v->NbTL = 0; + v->NbST = v->NbVT = v->NbTT = 0; + v->NbSS = v->NbVS = v->NbTS = 0; if(allocate){ - ActualView->datasize = sizeof(double); + v->datasize = sizeof(double); - ActualView->Time = List_Create(100,1000,sizeof(double)); + v->Time = List_Create(100,1000,sizeof(double)); - ActualView->SP = List_Create(100,1000,sizeof(double)); - ActualView->VP = List_Create(100,1000,sizeof(double)); - ActualView->TP = List_Create(100,1000,sizeof(double)); + v->SP = List_Create(100,1000,sizeof(double)); + v->VP = List_Create(100,1000,sizeof(double)); + v->TP = List_Create(100,1000,sizeof(double)); - ActualView->SL = List_Create(100,1000,sizeof(double)); - ActualView->VL = List_Create(100,1000,sizeof(double)); - ActualView->TL = List_Create(100,1000,sizeof(double)); + v->SL = List_Create(100,1000,sizeof(double)); + v->VL = List_Create(100,1000,sizeof(double)); + v->TL = List_Create(100,1000,sizeof(double)); - ActualView->ST = List_Create(100,1000,sizeof(double)); - ActualView->VT = List_Create(100,1000,sizeof(double)); - ActualView->TT = List_Create(100,1000,sizeof(double)); + v->ST = List_Create(100,1000,sizeof(double)); + v->VT = List_Create(100,1000,sizeof(double)); + v->TT = List_Create(100,1000,sizeof(double)); - ActualView->SS = List_Create(100,1000,sizeof(double)); - ActualView->VS = List_Create(100,1000,sizeof(double)); - ActualView->TS = List_Create(100,1000,sizeof(double)); + v->SS = List_Create(100,1000,sizeof(double)); + v->VS = List_Create(100,1000,sizeof(double)); + v->TS = List_Create(100,1000,sizeof(double)); } else{ - ActualView->Time = NULL; - ActualView->SP = NULL; ActualView->VP = NULL; ActualView->TP = NULL; - ActualView->SL = NULL; ActualView->VL = NULL; ActualView->TL = NULL; - ActualView->ST = NULL; ActualView->VT = NULL; ActualView->TT = NULL; - ActualView->SS = NULL; ActualView->VS = NULL; ActualView->TS = NULL; + v->Time = NULL; + v->SP = NULL; v->VP = NULL; v->TP = NULL; + v->SL = NULL; v->VL = NULL; v->TL = NULL; + v->ST = NULL; v->VT = NULL; v->TT = NULL; + v->SS = NULL; v->VS = NULL; v->TS = NULL; } // Copy all options from the reference view initialized in InitOptions() - CopyViewOptions(Post_ViewReference, ActualView); - - ActualView->Changed = 1; - ActualView->Links = 0; - ActualView->DuplicateOf = 0; - ActualView->ScalarOnly = 1; - ActualView->normals = NULL; - ActualView->Min = 1.e200; - ActualView->Max = -1.e200; + CopyViewOptions(Post_ViewReference, v); + + v->Changed = 1; + v->Links = 0; + v->DuplicateOf = 0; + v->ScalarOnly = 1; + v->normals = NULL; + v->Min = INFINITY; + v->Max = -INFINITY; for(i=0;i<3;i++){ - ActualView->BBox[2*i] = 1.e200; - ActualView->BBox[2*i+1] = -1.e200; + v->BBox[2*i] = INFINITY; + v->BBox[2*i+1] = -INFINITY; } - return ActualView; + return v; } -void Stat_ScalarSimplex(int nbnod, int N, double *X, double *Y, double *Z, double *V){ +void Stat_ScalarSimplex(Post_View *v, int nbnod, int N, + double *X, double *Y, double *Z, double *V){ int i; - if(!NbPoints && !NbLines && !NbTriangles && !NbTetrahedra){ - ActualView->Min = V[0]; - ActualView->Max = V[0]; - ActualView->NbTimeStep = N/nbnod; + if(v->Min == INFINITY || v->Max == -INFINITY){ + v->Min = V[0]; + v->Max = V[0]; + v->NbTimeStep = N/nbnod; } - else if(N/nbnod < ActualView->NbTimeStep) - ActualView->NbTimeStep = N/nbnod ; + else if(N/nbnod < v->NbTimeStep) + v->NbTimeStep = N/nbnod ; for(i=0 ; i<N ; i++){ - if(V[i] < ActualView->Min) ActualView->Min = V[i] ; - if(V[i] > ActualView->Max) ActualView->Max = V[i] ; + if(V[i] < v->Min) v->Min = V[i] ; + if(V[i] > v->Max) v->Max = V[i] ; } for(i=0 ; i<nbnod ; i++){ - if(X[i] < ActualView->BBox[0]) ActualView->BBox[0] = X[i] ; - if(X[i] > ActualView->BBox[1]) ActualView->BBox[1] = X[i] ; - if(Y[i] < ActualView->BBox[2]) ActualView->BBox[2] = Y[i] ; - if(Y[i] > ActualView->BBox[3]) ActualView->BBox[3] = Y[i] ; - if(Z[i] < ActualView->BBox[4]) ActualView->BBox[4] = Z[i] ; - if(Z[i] > ActualView->BBox[5]) ActualView->BBox[5] = Z[i] ; - } - - switch(nbnod){ - case 1 : NbPoints++; break; - case 2 : NbLines++; break; - case 3 : NbTriangles++; break; - case 4 : NbTetrahedra++; break; + if(X[i] < v->BBox[0]) v->BBox[0] = X[i] ; + if(X[i] > v->BBox[1]) v->BBox[1] = X[i] ; + if(Y[i] < v->BBox[2]) v->BBox[2] = Y[i] ; + if(Y[i] > v->BBox[3]) v->BBox[3] = Y[i] ; + if(Z[i] < v->BBox[4]) v->BBox[4] = Z[i] ; + if(Z[i] > v->BBox[5]) v->BBox[5] = Z[i] ; } } -void Stat_VectorSimplex(int nbnod, int N, double *X, double *Y, double *Z, double *V){ +void Stat_VectorSimplex(Post_View *v, int nbnod, int N, + double *X, double *Y, double *Z, double *V){ double l0; int i; - if(!NbPoints && !NbLines && !NbTriangles && !NbTetrahedra){ + if(v->Min == INFINITY || v->Max == -INFINITY){ l0 = sqrt(DSQR(V[0])+DSQR(V[1])+DSQR(V[2])); - ActualView->Min = l0; - ActualView->Max = l0; - ActualView->NbTimeStep = N/(3*nbnod) ; + v->Min = l0; + v->Max = l0; + v->NbTimeStep = N/(3*nbnod) ; } - else if(N/(3*nbnod) < ActualView->NbTimeStep) - ActualView->NbTimeStep = N/(3*nbnod) ; + else if(N/(3*nbnod) < v->NbTimeStep) + v->NbTimeStep = N/(3*nbnod) ; for(i=0 ; i<N ; i+=3){ l0 = sqrt(DSQR(V[i])+DSQR(V[i+1])+DSQR(V[i+2])); - if(l0 < ActualView->Min) ActualView->Min = l0 ; - if(l0 > ActualView->Max) ActualView->Max = l0 ; + if(l0 < v->Min) v->Min = l0 ; + if(l0 > v->Max) v->Max = l0 ; } for(i=0 ; i<nbnod ; i++){ - if(X[i] < ActualView->BBox[0]) ActualView->BBox[0] = X[i] ; - if(X[i] > ActualView->BBox[1]) ActualView->BBox[1] = X[i] ; - if(Y[i] < ActualView->BBox[2]) ActualView->BBox[2] = Y[i] ; - if(Y[i] > ActualView->BBox[3]) ActualView->BBox[3] = Y[i] ; - if(Z[i] < ActualView->BBox[4]) ActualView->BBox[4] = Z[i] ; - if(Z[i] > ActualView->BBox[5]) ActualView->BBox[5] = Z[i] ; + if(X[i] < v->BBox[0]) v->BBox[0] = X[i] ; + if(X[i] > v->BBox[1]) v->BBox[1] = X[i] ; + if(Y[i] < v->BBox[2]) v->BBox[2] = Y[i] ; + if(Y[i] > v->BBox[3]) v->BBox[3] = Y[i] ; + if(Z[i] < v->BBox[4]) v->BBox[4] = Z[i] ; + if(Z[i] > v->BBox[5]) v->BBox[5] = Z[i] ; } - ActualView->ScalarOnly = 0; - - switch(nbnod){ - case 1 : NbPoints++; break; - case 2 : NbLines++; break; - case 3 : NbTriangles++; break; - case 4 : NbTetrahedra++; break; - } + v->ScalarOnly = 0; } -void Stat_TensorSimplex(int nbnod, int N, double *X, double *Y, double *Z, double *v){ +void Stat_TensorSimplex(Post_View *v, int nbnod, int N, + double *X, double *Y, double *Z, double *V){ Msg(GERROR, "Tensor field views not implemented yet"); } -void EndView(int add_in_gui, char *file_name, char *name){ +void EndView(Post_View *v, int add_in_gui, char *file_name, char *name){ int i, nb; double d; extern int AddViewInUI(int , char *, int); // Points - if(ActualView->NbSP){ - nb = List_Nbr(ActualView->SP) / ActualView->NbSP ; - for(i = 0 ; i < List_Nbr(ActualView->SP) ; i+=nb) - Stat_ScalarSimplex(1, nb-3, - (double*)List_Pointer_Fast(ActualView->SP,i), - (double*)List_Pointer_Fast(ActualView->SP,i+1), - (double*)List_Pointer_Fast(ActualView->SP,i+2), - (double*)List_Pointer_Fast(ActualView->SP,i+3)); - } - if(ActualView->NbVP){ - nb = List_Nbr(ActualView->VP) / ActualView->NbVP ; - for(i = 0 ; i < List_Nbr(ActualView->VP) ; i+=nb) - Stat_VectorSimplex(1, nb-3, - (double*)List_Pointer_Fast(ActualView->VP,i), - (double*)List_Pointer_Fast(ActualView->VP,i+1), - (double*)List_Pointer_Fast(ActualView->VP,i+2), - (double*)List_Pointer_Fast(ActualView->VP,i+3)); - } - if(ActualView->NbTP){ - nb = List_Nbr(ActualView->TP) / ActualView->NbTP ; - for(i = 0 ; i < List_Nbr(ActualView->TP) ; i+=nb) - Stat_TensorSimplex(1, nb-3, - (double*)List_Pointer_Fast(ActualView->TP,i), - (double*)List_Pointer_Fast(ActualView->TP,i+1), - (double*)List_Pointer_Fast(ActualView->TP,i+2), - (double*)List_Pointer_Fast(ActualView->TP,i+3)); + if(v->NbSP){ + nb = List_Nbr(v->SP) / v->NbSP ; + for(i = 0 ; i < List_Nbr(v->SP) ; i+=nb) + Stat_ScalarSimplex(v, 1, nb-3, + (double*)List_Pointer_Fast(v->SP,i), + (double*)List_Pointer_Fast(v->SP,i+1), + (double*)List_Pointer_Fast(v->SP,i+2), + (double*)List_Pointer_Fast(v->SP,i+3)); + } + if(v->NbVP){ + nb = List_Nbr(v->VP) / v->NbVP ; + for(i = 0 ; i < List_Nbr(v->VP) ; i+=nb) + Stat_VectorSimplex(v, 1, nb-3, + (double*)List_Pointer_Fast(v->VP,i), + (double*)List_Pointer_Fast(v->VP,i+1), + (double*)List_Pointer_Fast(v->VP,i+2), + (double*)List_Pointer_Fast(v->VP,i+3)); + } + if(v->NbTP){ + nb = List_Nbr(v->TP) / v->NbTP ; + for(i = 0 ; i < List_Nbr(v->TP) ; i+=nb) + Stat_TensorSimplex(v, 1, nb-3, + (double*)List_Pointer_Fast(v->TP,i), + (double*)List_Pointer_Fast(v->TP,i+1), + (double*)List_Pointer_Fast(v->TP,i+2), + (double*)List_Pointer_Fast(v->TP,i+3)); } // Lines - if(ActualView->NbSL){ - nb = List_Nbr(ActualView->SL) / ActualView->NbSL ; - for(i = 0 ; i < List_Nbr(ActualView->SL) ; i+=nb) - Stat_ScalarSimplex(2, nb-6, - (double*)List_Pointer_Fast(ActualView->SL,i), - (double*)List_Pointer_Fast(ActualView->SL,i+2), - (double*)List_Pointer_Fast(ActualView->SL,i+4), - (double*)List_Pointer_Fast(ActualView->SL,i+6)); - } - if(ActualView->NbVL){ - nb = List_Nbr(ActualView->VL) / ActualView->NbVL ; - for(i = 0 ; i < List_Nbr(ActualView->VL) ; i+=nb) - Stat_VectorSimplex(2, nb-6, - (double*)List_Pointer_Fast(ActualView->VL,i), - (double*)List_Pointer_Fast(ActualView->VL,i+2), - (double*)List_Pointer_Fast(ActualView->VL,i+4), - (double*)List_Pointer_Fast(ActualView->VL,i+6)); - } - if(ActualView->NbTL){ - nb = List_Nbr(ActualView->TL) / ActualView->NbTL ; - for(i = 0 ; i < List_Nbr(ActualView->TL) ; i+=nb) - Stat_TensorSimplex(2, nb-6, - (double*)List_Pointer_Fast(ActualView->TL,i), - (double*)List_Pointer_Fast(ActualView->TL,i+2), - (double*)List_Pointer_Fast(ActualView->TL,i+4), - (double*)List_Pointer_Fast(ActualView->TL,i+6)); + if(v->NbSL){ + nb = List_Nbr(v->SL) / v->NbSL ; + for(i = 0 ; i < List_Nbr(v->SL) ; i+=nb) + Stat_ScalarSimplex(v, 2, nb-6, + (double*)List_Pointer_Fast(v->SL,i), + (double*)List_Pointer_Fast(v->SL,i+2), + (double*)List_Pointer_Fast(v->SL,i+4), + (double*)List_Pointer_Fast(v->SL,i+6)); + } + if(v->NbVL){ + nb = List_Nbr(v->VL) / v->NbVL ; + for(i = 0 ; i < List_Nbr(v->VL) ; i+=nb) + Stat_VectorSimplex(v, 2, nb-6, + (double*)List_Pointer_Fast(v->VL,i), + (double*)List_Pointer_Fast(v->VL,i+2), + (double*)List_Pointer_Fast(v->VL,i+4), + (double*)List_Pointer_Fast(v->VL,i+6)); + } + if(v->NbTL){ + nb = List_Nbr(v->TL) / v->NbTL ; + for(i = 0 ; i < List_Nbr(v->TL) ; i+=nb) + Stat_TensorSimplex(v, 2, nb-6, + (double*)List_Pointer_Fast(v->TL,i), + (double*)List_Pointer_Fast(v->TL,i+2), + (double*)List_Pointer_Fast(v->TL,i+4), + (double*)List_Pointer_Fast(v->TL,i+6)); } // Triangles - if(ActualView->NbST){ - nb = List_Nbr(ActualView->ST) / ActualView->NbST ; - for(i = 0 ; i < List_Nbr(ActualView->ST) ; i+=nb) - Stat_ScalarSimplex(3, nb-9, - (double*)List_Pointer_Fast(ActualView->ST,i), - (double*)List_Pointer_Fast(ActualView->ST,i+3), - (double*)List_Pointer_Fast(ActualView->ST,i+6), - (double*)List_Pointer_Fast(ActualView->ST,i+9)); - } - if(ActualView->NbVT){ - nb = List_Nbr(ActualView->VT) / ActualView->NbVT ; - for(i = 0 ; i < List_Nbr(ActualView->VT) ; i+=nb) - Stat_VectorSimplex(3, nb-9, - (double*)List_Pointer_Fast(ActualView->VT,i), - (double*)List_Pointer_Fast(ActualView->VT,i+3), - (double*)List_Pointer_Fast(ActualView->VT,i+6), - (double*)List_Pointer_Fast(ActualView->VT,i+9)); - } - if(ActualView->NbTT){ - nb = List_Nbr(ActualView->TT) / ActualView->NbTT ; - for(i = 0 ; i < List_Nbr(ActualView->TT) ; i+=nb) - Stat_TensorSimplex(3, nb-9, - (double*)List_Pointer_Fast(ActualView->TT,i), - (double*)List_Pointer_Fast(ActualView->TT,i+3), - (double*)List_Pointer_Fast(ActualView->TT,i+6), - (double*)List_Pointer_Fast(ActualView->TT,i+9)); + if(v->NbST){ + nb = List_Nbr(v->ST) / v->NbST ; + for(i = 0 ; i < List_Nbr(v->ST) ; i+=nb) + Stat_ScalarSimplex(v, 3, nb-9, + (double*)List_Pointer_Fast(v->ST,i), + (double*)List_Pointer_Fast(v->ST,i+3), + (double*)List_Pointer_Fast(v->ST,i+6), + (double*)List_Pointer_Fast(v->ST,i+9)); + } + if(v->NbVT){ + nb = List_Nbr(v->VT) / v->NbVT ; + for(i = 0 ; i < List_Nbr(v->VT) ; i+=nb) + Stat_VectorSimplex(v, 3, nb-9, + (double*)List_Pointer_Fast(v->VT,i), + (double*)List_Pointer_Fast(v->VT,i+3), + (double*)List_Pointer_Fast(v->VT,i+6), + (double*)List_Pointer_Fast(v->VT,i+9)); + } + if(v->NbTT){ + nb = List_Nbr(v->TT) / v->NbTT ; + for(i = 0 ; i < List_Nbr(v->TT) ; i+=nb) + Stat_TensorSimplex(v, 3, nb-9, + (double*)List_Pointer_Fast(v->TT,i), + (double*)List_Pointer_Fast(v->TT,i+3), + (double*)List_Pointer_Fast(v->TT,i+6), + (double*)List_Pointer_Fast(v->TT,i+9)); } // Tetrahedra - if(ActualView->NbSS){ - nb = List_Nbr(ActualView->SS) / ActualView->NbSS ; - for(i = 0 ; i < List_Nbr(ActualView->SS) ; i+=nb) - Stat_ScalarSimplex(4, nb-12, - (double*)List_Pointer_Fast(ActualView->SS,i), - (double*)List_Pointer_Fast(ActualView->SS,i+4), - (double*)List_Pointer_Fast(ActualView->SS,i+8), - (double*)List_Pointer_Fast(ActualView->SS,i+12)); - } - if(ActualView->NbVS){ - nb = List_Nbr(ActualView->VS) / ActualView->NbVS ; - for(i = 0 ; i < List_Nbr(ActualView->VS) ; i+=nb) - Stat_VectorSimplex(4, nb-12, - (double*)List_Pointer_Fast(ActualView->VS,i), - (double*)List_Pointer_Fast(ActualView->VS,i+4), - (double*)List_Pointer_Fast(ActualView->VS,i+8), - (double*)List_Pointer_Fast(ActualView->VS,i+12)); - } - if(ActualView->NbTS){ - nb = List_Nbr(ActualView->TS) / ActualView->NbTS ; - for(i = 0 ; i < List_Nbr(ActualView->TS) ; i+=nb) - Stat_TensorSimplex(4, nb-12, - (double*)List_Pointer_Fast(ActualView->TS,i), - (double*)List_Pointer_Fast(ActualView->TS,i+4), - (double*)List_Pointer_Fast(ActualView->TS,i+8), - (double*)List_Pointer_Fast(ActualView->TS,i+12)); + if(v->NbSS){ + nb = List_Nbr(v->SS) / v->NbSS ; + for(i = 0 ; i < List_Nbr(v->SS) ; i+=nb) + Stat_ScalarSimplex(v, 4, nb-12, + (double*)List_Pointer_Fast(v->SS,i), + (double*)List_Pointer_Fast(v->SS,i+4), + (double*)List_Pointer_Fast(v->SS,i+8), + (double*)List_Pointer_Fast(v->SS,i+12)); + } + if(v->NbVS){ + nb = List_Nbr(v->VS) / v->NbVS ; + for(i = 0 ; i < List_Nbr(v->VS) ; i+=nb) + Stat_VectorSimplex(v, 4, nb-12, + (double*)List_Pointer_Fast(v->VS,i), + (double*)List_Pointer_Fast(v->VS,i+4), + (double*)List_Pointer_Fast(v->VS,i+8), + (double*)List_Pointer_Fast(v->VS,i+12)); + } + if(v->NbTS){ + nb = List_Nbr(v->TS) / v->NbTS ; + for(i = 0 ; i < List_Nbr(v->TS) ; i+=nb) + Stat_TensorSimplex(v, 4, nb-12, + (double*)List_Pointer_Fast(v->TS,i), + (double*)List_Pointer_Fast(v->TS,i+4), + (double*)List_Pointer_Fast(v->TS,i+8), + (double*)List_Pointer_Fast(v->TS,i+12)); } // Dummy time values if using old parsed format... - if(ActualView->Time && !List_Nbr(ActualView->Time)){ - for(i=0 ; i<ActualView->NbTimeStep ; i++){ + if(v->Time && !List_Nbr(v->Time)){ + for(i=0 ; i<v->NbTimeStep ; i++){ d = (double)i; - List_Add(ActualView->Time, &d); + List_Add(v->Time, &d); } } - opt_view_name(ActualViewIndex, GMSH_SET|GMSH_GUI, name); - opt_view_filename(ActualViewIndex, GMSH_SET|GMSH_GUI, file_name); - opt_view_nb_timestep(ActualViewIndex, GMSH_GUI, 0); - opt_view_timestep(ActualViewIndex, GMSH_SET|GMSH_GUI, ActualView->TimeStep); - if(ActualView->Min > ActualView->Max){ - opt_view_min(ActualViewIndex, GMSH_SET|GMSH_GUI, 0.); - opt_view_max(ActualViewIndex, GMSH_SET|GMSH_GUI, 0.); + opt_view_name(v->Index, GMSH_SET|GMSH_GUI, name); + opt_view_filename(v->Index, GMSH_SET|GMSH_GUI, file_name); + opt_view_nb_timestep(v->Index, GMSH_GUI, 0); + opt_view_timestep(v->Index, GMSH_SET|GMSH_GUI, v->TimeStep); + if(v->Min > v->Max){ + opt_view_min(v->Index, GMSH_SET|GMSH_GUI, 0.); + opt_view_max(v->Index, GMSH_SET|GMSH_GUI, 0.); } else{ - opt_view_min(ActualViewIndex, GMSH_GUI, 0); - opt_view_max(ActualViewIndex, GMSH_GUI, 0); + opt_view_min(v->Index, GMSH_GUI, 0); + opt_view_max(v->Index, GMSH_GUI, 0); } - opt_view_custom_min(ActualViewIndex, GMSH_SET|GMSH_GUI, ActualView->Min); - opt_view_custom_max(ActualViewIndex, GMSH_SET|GMSH_GUI, ActualView->Max); + opt_view_custom_min(v->Index, GMSH_SET|GMSH_GUI, v->Min); + opt_view_custom_max(v->Index, GMSH_SET|GMSH_GUI, v->Max); - if(CTX.post.smooth) ActualView->smooth(); + if(CTX.post.smooth) v->smooth(); if(!Post_ViewForceNumber && add_in_gui) - AddViewInUI(List_Nbr(Post_ViewList), ActualView->Name, ActualView->Num); + AddViewInUI(List_Nbr(Post_ViewList), v->Name, v->Num); + + v->Dirty = 0; //the view is complete, we may draw it } bool FreeView(int num){ @@ -467,14 +457,15 @@ void Print_ColorTable(int num, char *prefix, FILE *file){ /* ------------------------------------------------------------------------ */ void Read_View(FILE *file, char *filename){ - char str[NAME_STR_L], name[NAME_STR_L]; + char str[256], name[256]; int nb, format, size, testone, swap; double version; + Post_View *v; while (1) { do { - fgets(str, NAME_STR_L, file) ; + fgets(str, 256, file) ; if (feof(file)) break ; } while (str[0] != '$') ; @@ -511,14 +502,14 @@ void Read_View(FILE *file, char *filename){ if (!strncmp(&str[1], "View", 4)) { - BeginView(0); + v = BeginView(0); fscanf(file, "%s %d %d %d %d %d %d %d %d %d %d %d %d %d\n", - name, &ActualView->NbTimeStep, - &ActualView->NbSP, &ActualView->NbVP, &ActualView->NbTP, - &ActualView->NbSL, &ActualView->NbVL, &ActualView->NbTL, - &ActualView->NbST, &ActualView->NbVT, &ActualView->NbTT, - &ActualView->NbSS, &ActualView->NbVS, &ActualView->NbTS); + name, &v->NbTimeStep, + &v->NbSP, &v->NbVP, &v->NbTP, + &v->NbSL, &v->NbVL, &v->NbTL, + &v->NbST, &v->NbVT, &v->NbTT, + &v->NbSS, &v->NbVS, &v->NbTS); swap = 0 ; if(format == LIST_FORMAT_BINARY){ @@ -529,69 +520,68 @@ void Read_View(FILE *file, char *filename){ } } - ActualView->datasize = size ; + v->datasize = size ; // Time values - ActualView->Time = List_CreateFromFile(ActualView->NbTimeStep, - size, file, format, swap); + v->Time = List_CreateFromFile(v->NbTimeStep, size, file, format, swap); // Points - nb = ActualView->NbSP ? ActualView->NbSP * (ActualView->NbTimeStep +3) : 0 ; - ActualView->SP = List_CreateFromFile(nb, size, file, format, swap); + nb = v->NbSP ? v->NbSP * (v->NbTimeStep +3) : 0 ; + v->SP = List_CreateFromFile(nb, size, file, format, swap); - nb = ActualView->NbVP ? ActualView->NbVP * (ActualView->NbTimeStep*3+3) : 0 ; - ActualView->VP = List_CreateFromFile(nb, size, file, format, swap); + nb = v->NbVP ? v->NbVP * (v->NbTimeStep*3+3) : 0 ; + v->VP = List_CreateFromFile(nb, size, file, format, swap); - nb = ActualView->NbTP ? ActualView->NbTP * (ActualView->NbTimeStep*9+3) : 0 ; - ActualView->TP = List_CreateFromFile(nb, size, file, format, swap); + nb = v->NbTP ? v->NbTP * (v->NbTimeStep*9+3) : 0 ; + v->TP = List_CreateFromFile(nb, size, file, format, swap); // Lines - nb = ActualView->NbSL ? ActualView->NbSL * (ActualView->NbTimeStep*2 +6) : 0 ; - ActualView->SL = List_CreateFromFile(nb, size, file, format, swap); + nb = v->NbSL ? v->NbSL * (v->NbTimeStep*2 +6) : 0 ; + v->SL = List_CreateFromFile(nb, size, file, format, swap); - nb = ActualView->NbVL ? ActualView->NbVL * (ActualView->NbTimeStep*2*3+6) : 0 ; - ActualView->VL = List_CreateFromFile(nb, size, file, format, swap); + nb = v->NbVL ? v->NbVL * (v->NbTimeStep*2*3+6) : 0 ; + v->VL = List_CreateFromFile(nb, size, file, format, swap); - nb = ActualView->NbTL ? ActualView->NbTL * (ActualView->NbTimeStep*2*9+6) : 0 ; - ActualView->TL = List_CreateFromFile(nb, size, file, format, swap); + nb = v->NbTL ? v->NbTL * (v->NbTimeStep*2*9+6) : 0 ; + v->TL = List_CreateFromFile(nb, size, file, format, swap); // Triangles - nb = ActualView->NbST ? ActualView->NbST * (ActualView->NbTimeStep*3 +9) : 0 ; - ActualView->ST = List_CreateFromFile(nb, size, file, format, swap); + nb = v->NbST ? v->NbST * (v->NbTimeStep*3 +9) : 0 ; + v->ST = List_CreateFromFile(nb, size, file, format, swap); - nb = ActualView->NbVT ? ActualView->NbVT * (ActualView->NbTimeStep*3*3+9) : 0 ; - ActualView->VT = List_CreateFromFile(nb, size, file, format, swap); + nb = v->NbVT ? v->NbVT * (v->NbTimeStep*3*3+9) : 0 ; + v->VT = List_CreateFromFile(nb, size, file, format, swap); - nb = ActualView->NbTT ? ActualView->NbTT * (ActualView->NbTimeStep*3*9+9) : 0 ; - ActualView->TT = List_CreateFromFile(nb, size, file, format, swap); + nb = v->NbTT ? v->NbTT * (v->NbTimeStep*3*9+9) : 0 ; + v->TT = List_CreateFromFile(nb, size, file, format, swap); // Tetrahedra - nb = ActualView->NbSS ? ActualView->NbSS * (ActualView->NbTimeStep*4 +12) : 0 ; - ActualView->SS = List_CreateFromFile(nb, size, file, format, swap); + nb = v->NbSS ? v->NbSS * (v->NbTimeStep*4 +12) : 0 ; + v->SS = List_CreateFromFile(nb, size, file, format, swap); - nb = ActualView->NbVS ? ActualView->NbVS * (ActualView->NbTimeStep*4*3+12) : 0 ; - ActualView->VS = List_CreateFromFile(nb, size, file, format, swap); + nb = v->NbVS ? v->NbVS * (v->NbTimeStep*4*3+12) : 0 ; + v->VS = List_CreateFromFile(nb, size, file, format, swap); - nb = ActualView->NbTS ? ActualView->NbTS * (ActualView->NbTimeStep*4*9+12) : 0 ; - ActualView->TS = List_CreateFromFile(nb, size, file, format, swap); + nb = v->NbTS ? v->NbTS * (v->NbTimeStep*4*9+12) : 0 ; + v->TS = List_CreateFromFile(nb, size, file, format, swap); Msg(DEBUG, "Read View '%s' (%d TimeSteps): %d %d %d %d %d %d %d %d %d %d %d %d", - name, ActualView->NbTimeStep, - ActualView->NbSP, ActualView->NbVP, ActualView->NbTP, - ActualView->NbSL, ActualView->NbVL, ActualView->NbTL, - ActualView->NbST, ActualView->NbVT, ActualView->NbTT, - ActualView->NbSS, ActualView->NbVS, ActualView->NbTS); + name, v->NbTimeStep, + v->NbSP, v->NbVP, v->NbTP, + v->NbSL, v->NbVL, v->NbTL, + v->NbST, v->NbVT, v->NbTT, + v->NbSS, v->NbVS, v->NbTS); Msg(DEBUG, "List_Nbrs: %d %d %d %d %d %d %d %d %d %d %d %d", - List_Nbr(ActualView->SP), List_Nbr(ActualView->VP), List_Nbr(ActualView->TP), - List_Nbr(ActualView->SL), List_Nbr(ActualView->VL), List_Nbr(ActualView->TL), - List_Nbr(ActualView->ST), List_Nbr(ActualView->VT), List_Nbr(ActualView->TT), - List_Nbr(ActualView->SS), List_Nbr(ActualView->VS), List_Nbr(ActualView->TS)); + List_Nbr(v->SP), List_Nbr(v->VP), List_Nbr(v->TP), + List_Nbr(v->SL), List_Nbr(v->VL), List_Nbr(v->TL), + List_Nbr(v->ST), List_Nbr(v->VT), List_Nbr(v->TT), + List_Nbr(v->SS), List_Nbr(v->VS), List_Nbr(v->TS)); - EndView(1, filename, name); + EndView(v, 1, filename, name); } do { - fgets(str, NAME_STR_L, file) ; + fgets(str, 256, file) ; if (feof(file)) Msg(GERROR,"Prematured end of file"); } while (str[0] != '$') ; @@ -617,12 +607,10 @@ void Write_View(int Flag_BIN, Post_View *v, char *filename){ else file = stdout; - fprintf(file, "$PostFormat /* Gmsh 1.0, %s */\n", - Flag_BIN ? "binary" : "ascii") ; + fprintf(file, "$PostFormat /* Gmsh 1.0, %s */\n", Flag_BIN ? "binary" : "ascii") ; fprintf(file, "1.0 %d %d\n", Flag_BIN, (int)sizeof(double)) ; fprintf(file, "$EndPostFormat\n") ; - for(i=0;i<(int)strlen(v->Name);i++) - if(v->Name[i]==' ') v->Name[i]='_'; + for(i=0;i<(int)strlen(v->Name);i++) if(v->Name[i]==' ') v->Name[i]='_'; // -> Il faudra changer le format de post pour autoriser les blancs. // On ajoutera aussi un entier par simplexe (num de region). // Devrait-on passer a un format liste de noeuds + liste de @@ -768,8 +756,8 @@ void smooth_list (List_T *SS , double *x,*y,*z,*v; int i,j,k; double *vals = new double[NbTimeStep]; - *min = 1.e200; - *max = -1.e200; + *min = INFINITY; + *max = -INFINITY; for(i = 0 ; i < List_Nbr(SS) ; i+=nb){ x = (double*)List_Pointer_Fast(SS,i); @@ -873,18 +861,18 @@ bool Post_View :: get_normal(double x, double y, double z, /* T r a n s f o r m a t i o n */ /* ------------------------------------------------------------------------ */ -void transform(double mat[3][3], double v[3], - double *x, double *y, double *z){ +static void transform(double mat[3][3], double v[3], + double *x, double *y, double *z){ *x = mat[0][0]*v[0] + mat[0][1]*v[1] + mat[0][2]*v[2]; *y = mat[1][0]*v[0] + mat[1][1]*v[1] + mat[1][2]*v[2]; *z = mat[2][0]*v[0] + mat[2][1]*v[1] + mat[2][2]*v[2]; } -void transform_list(List_T *V , - int NbTimeStep, - int nbvert, - int nb, - double mat[3][3]){ +static void transform_list(List_T *V , + int NbTimeStep, + int nbvert, + int nb, + double mat[3][3]){ double *x,*y,*z, v[3]; int i, j; diff --git a/Common/Views.h b/Common/Views.h index 6d99e8b2098b3d061b8d096d627363e91707e005..9c0ffa53832b65eb10d95112a261412af2bc963c 100644 --- a/Common/Views.h +++ b/Common/Views.h @@ -1,7 +1,6 @@ #ifndef _VIEWS_H_ #define _VIEWS_H_ -#include "Const.h" #include "ColorTable.h" class smooth_container; @@ -9,8 +8,8 @@ class smooth_container; class Post_View{ public : // intrinsic to a view - int Num, Changed, DuplicateOf, Links; - char FileName[NAME_STR_L], Name[NAME_STR_L]; + int Num, Index, Changed, DuplicateOf, Links, Dirty; + char FileName[256], Name[256]; // the data int datasize; // size(double) or sizeof(float) @@ -27,7 +26,7 @@ class Post_View{ double Min, Max, BBox[6]; // options - char Format[NAME_STR_L]; + char Format[256]; double CustomMin, CustomMax; double Offset[3], Raise[3], ArrowScale, Explode; int Visible, IntervalsType, NbIso, Light, SmoothNormals ; @@ -101,7 +100,7 @@ int fcmpPostViewNum(const void *v1, const void *v2); int fcmpPostViewDuplicateOf(const void *v1, const void *v2); Post_View * BeginView (int alloc); -void EndView (int AddInUI, char *FileName, char *Name); +void EndView (Post_View *v, int AddInUI, char *FileName, char *Name); void FreeView(Post_View *v); bool FreeView(int); void Read_View(FILE *file, char *filename); diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index f736e251def741886de8d132ab4096da30cfc5af..86250f817ed3c7f588d7444f83d4ed0de36f50ee 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.75 2001-08-06 09:44:22 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.76 2001-08-11 23:28:31 geuzaine Exp $ #include <sys/types.h> #include <signal.h> @@ -1469,7 +1469,7 @@ void view_reload_visible_cb(CALLBACK_ARGS) { void view_reload_cb(CALLBACK_ARGS){ Post_View tmp ; - char filename[NAME_STR_L]; + char filename[256]; if(!Post_ViewList) return; @@ -1552,10 +1552,8 @@ static void _duplicate_view(int num, int options){ v1 = (Post_View*)List_Pointer(Post_ViewList,num); - BeginView(0); - EndView(0, v1->FileName, v1->Name); - - v2 = (Post_View*)List_Pointer(Post_ViewList,List_Nbr(Post_ViewList)-1); + v2 = BeginView(0); + EndView(v2, 0, v1->FileName, v1->Name); if(!v1->DuplicateOf){ v2->DuplicateOf = v1->Num ; diff --git a/Fltk/Colorbar_Window.cpp b/Fltk/Colorbar_Window.cpp index a41004e87064e4cf1e2083d5a4bae64e81945ad7..0ca53097323844fc5583295e14cf054f21d2a676 100644 --- a/Fltk/Colorbar_Window.cpp +++ b/Fltk/Colorbar_Window.cpp @@ -1,7 +1,8 @@ -// $Id: Colorbar_Window.cpp,v 1.11 2001-08-04 00:37:57 geuzaine Exp $ +// $Id: Colorbar_Window.cpp,v 1.12 2001-08-11 23:28:31 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" +#include "Numeric.h" #include "GUI.h" #include "ColorTable.h" #include "Colorbar_Window.h" diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index d59b8c537b2ed46762eb087e8ceed2f2efd8e8a2..ec1e41d034feed2bd977a1539d57c65703a64b7e 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.105 2001-08-10 07:25:02 geuzaine Exp $ +// $Id: GUI.cpp,v 1.106 2001-08-11 23:28:31 geuzaine 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. @@ -7,12 +7,13 @@ #include "PluginManager.h" #include "Plugin.h" + #include "Gmsh.h" #include "GmshUI.h" +#include "Numeric.h" #include "GmshVersion.h" #include "Context.h" #include "Options.h" -#include "Const.h" #include "Geo.h" #include "Mesh.h" #include "Draw.h" diff --git a/Fltk/Opengl.cpp b/Fltk/Opengl.cpp index f3cf59b6af5798e45fb8836b8678e8c2766bf17a..4adbc4fa260fbf97caf31c56ee116de1ea818741 100644 --- a/Fltk/Opengl.cpp +++ b/Fltk/Opengl.cpp @@ -1,9 +1,9 @@ -// $Id: Opengl.cpp,v 1.19 2001-03-17 21:33:13 geuzaine Exp $ +// $Id: Opengl.cpp,v 1.20 2001-08-11 23:28:31 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" +#include "Numeric.h" #include "Context.h" -#include "Const.h" #include "Geo.h" #include "Mesh.h" #include "Draw.h" diff --git a/Fltk/Opengl_Window.cpp b/Fltk/Opengl_Window.cpp index 50c2f1ec387d941d53593d5ad3b6a6c0883667e9..e18556e66ea826d31ae3859d2fcc60c038e63115 100644 --- a/Fltk/Opengl_Window.cpp +++ b/Fltk/Opengl_Window.cpp @@ -1,9 +1,9 @@ -// $Id: Opengl_Window.cpp,v 1.16 2001-08-03 14:34:45 geuzaine Exp $ +// $Id: Opengl_Window.cpp,v 1.17 2001-08-11 23:28:31 geuzaine Exp $ #include "Gmsh.h" +#include "Numeric.h" #include "GmshUI.h" #include "Context.h" -#include "Const.h" #include "Geo.h" #include "Mesh.h" #include "Draw.h" diff --git a/Geo/CAD.cpp b/Geo/CAD.cpp index 75cad6df555176f44e672436b83f5ac832bb40d3..15fee06adc08627b3b1e1f587849b3b837f8b771 100644 --- a/Geo/CAD.cpp +++ b/Geo/CAD.cpp @@ -1,12 +1,11 @@ -// $Id: CAD.cpp,v 1.25 2001-06-25 18:34:59 remacle Exp $ +// $Id: CAD.cpp,v 1.26 2001-08-11 23:28:31 geuzaine Exp $ #include "Gmsh.h" +#include "Numeric.h" #include "Geo.h" #include "Mesh.h" #include "DataBase.h" #include "Interpolation.h" -#include "Numeric.h" -#include "Const.h" #include "Create.h" #include "CAD.h" #include "Edge.h" diff --git a/Geo/DataBase.cpp b/Geo/DataBase.cpp index e26d3ce47b8693551e76c64674c9947118447843..f8316ba966203cf6dc6701f3ba2520a3f7b5c43b 100644 --- a/Geo/DataBase.cpp +++ b/Geo/DataBase.cpp @@ -1,7 +1,7 @@ -// $Id: DataBase.cpp,v 1.15 2001-08-09 15:24:27 geuzaine Exp $ +// $Id: DataBase.cpp,v 1.16 2001-08-11 23:28:31 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "Mesh.h" #include "CAD.h" diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp index 0b841776664f3140a1c08d22a487861863d4be51..4ee2453e77dea81b8dc7ea572bab65b17216eebc 100644 --- a/Geo/Geo.cpp +++ b/Geo/Geo.cpp @@ -1,7 +1,7 @@ -// $Id: Geo.cpp,v 1.20 2001-07-30 12:40:35 geuzaine Exp $ +// $Id: Geo.cpp,v 1.21 2001-08-11 23:28:31 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "CAD.h" #include "DataBase.h" diff --git a/Geo/MinMax.cpp b/Geo/MinMax.cpp index 851d89fff62431f659eb65fe0f93866aa1cb5fe1..a66d23f3e4a69a077ba8630f0148bce9de5701a7 100644 --- a/Geo/MinMax.cpp +++ b/Geo/MinMax.cpp @@ -1,7 +1,7 @@ -// $Id: MinMax.cpp,v 1.5 2001-04-17 06:55:47 geuzaine Exp $ +// $Id: MinMax.cpp,v 1.6 2001-08-11 23:28:31 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Vertex.h" #include "Context.h" diff --git a/Geo/StepGeomDatabase.cpp b/Geo/StepGeomDatabase.cpp index f92d455a406125433c0988bc61e288b60e149538..913f4c49ea16ca5c328477620b38398f160deeb0 100644 --- a/Geo/StepGeomDatabase.cpp +++ b/Geo/StepGeomDatabase.cpp @@ -1,7 +1,7 @@ -// $Id: StepGeomDatabase.cpp,v 1.5 2001-01-08 08:05:43 geuzaine Exp $ +// $Id: StepGeomDatabase.cpp,v 1.6 2001-08-11 23:28:31 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "StepGeomDatabase.h" #include "DataBase.h" diff --git a/Graphics/Axes.cpp b/Graphics/Axes.cpp index 90173b7a7d0bb24659120327be0aac0b11361532..07a21d7c8117bd649750be28c3cf6961c1444962 100644 --- a/Graphics/Axes.cpp +++ b/Graphics/Axes.cpp @@ -1,8 +1,8 @@ -// $Id: Axes.cpp,v 1.4 2001-06-12 08:29:52 geuzaine Exp $ +// $Id: Axes.cpp,v 1.5 2001-08-11 23:28:31 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" #include "Draw.h" #include "Context.h" diff --git a/Graphics/Entity.cpp b/Graphics/Entity.cpp index 6ea36391497c04c24ae19349bd7817f7f13ffb31..fc49732fb567abd6619a8d55d6fd269b29cddd79 100644 --- a/Graphics/Entity.cpp +++ b/Graphics/Entity.cpp @@ -1,7 +1,8 @@ -// $Id: Entity.cpp,v 1.11 2001-08-06 16:47:57 geuzaine Exp $ +// $Id: Entity.cpp,v 1.12 2001-08-11 23:28:31 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" +#include "Numeric.h" #include "Mesh.h" #include "Draw.h" #include "Context.h" @@ -50,6 +51,7 @@ void Draw_Triangle (double *x, double *y, double *z, double *n, nn[0] = y1y0 * z2z0 - z1z0 * y2y0 ; nn[1] = z1z0 * x2x0 - x1x0 * z2z0 ; nn[2] = x1x0 * y2y0 - y1y0 * x2x0 ; + //norme(nn); not necessary if GL_NORMALIZE is enabled glNormal3dv(nn); } else diff --git a/Graphics/Geom.cpp b/Graphics/Geom.cpp index b1ccacbc9c08071daac81e6b412e5f363620ff0a..beadd9c9f24da577b8cc2283d8dd9f5518a9c36b 100644 --- a/Graphics/Geom.cpp +++ b/Graphics/Geom.cpp @@ -1,14 +1,15 @@ -// $Id: Geom.cpp,v 1.26 2001-08-10 10:06:38 geuzaine Exp $ +// $Id: Geom.cpp,v 1.27 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" +#include "Numeric.h" #include "Geo.h" #include "Mesh.h" +#include "Utils.h" #include "Draw.h" #include "Context.h" #include "Verif.h" #include "Interpolation.h" -#include "Numeric.h" #include "Visibility.h" #include "STL.h" #include "gl2ps.h" diff --git a/Graphics/IsoSimplex.cpp b/Graphics/IsoSimplex.cpp index d8261014e7ee5c5c567df18fb58c6e9fcd346cea..e2fdfa36e71de3028e845796af4b88c76eebdac5 100644 --- a/Graphics/IsoSimplex.cpp +++ b/Graphics/IsoSimplex.cpp @@ -65,7 +65,7 @@ void EnhanceSimplexPolygon (Post_View *View, double gr[3]; double n[3],xx; prodve(v1,v2,n); - norme(n); + //norme(n); not necessary since GL_NORMALIZE is enabled gradSimplex(X,Y,Z,Val,gr); prosca(gr,n,&xx); diff --git a/Graphics/Mesh.cpp b/Graphics/Mesh.cpp index 0edb41b324e0e9abdc5adee2eeeaa1dcbd403dbe..63346867b28f7c9c319f0f1181f91fdf80368947 100644 --- a/Graphics/Mesh.cpp +++ b/Graphics/Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: Mesh.cpp,v 1.37 2001-08-03 21:27:20 geuzaine Exp $ +// $Id: Mesh.cpp,v 1.38 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -488,14 +488,6 @@ void Draw_Simplex_Surfaces (void *a, void *b){ n[0] = m[0] = y1y0 * z2z0 - z1z0 * y2y0 ; n[1] = m[1] = z1z0 * x2x0 - x1x0 * z2z0 ; n[2] = m[2] = x1x0 * y2y0 - y1y0 * x2x0; - // norme(n); not necessary with glEnable(GL_NORMALIZE); - /* BOF BOF BOF - if(n[2] < -0.1){ - n[0] = -n[0]; - n[1] = -n[1]; - n[2] = -n[2]; - } - */ } if (CTX.mesh.hidden && CTX.mesh.shade){ @@ -594,6 +586,7 @@ void Draw_Hexahedron_Volume (void *a, void *b){ Hexahedron **h; int i ; double Xc = 0.0 , Yc = 0.0, Zc = 0.0 , X[8],Y[8],Z[8]; + char Num[100]; h = (Hexahedron**)a; @@ -648,6 +641,12 @@ void Draw_Hexahedron_Volume (void *a, void *b){ glVertex3d(X[7], Y[7], Z[7]); glEnd(); + if(CTX.mesh.volumes_num){ + sprintf(Num,"%d",(*h)->Num); + glRasterPos3d(Xc,Yc,Zc); + Draw_String(Num); + } + if (CTX.mesh.dual){ glColor4ubv((GLubyte*)&CTX.color.fg); @@ -699,48 +698,65 @@ void Draw_Hexahedron_Volume (void *a, void *b){ void Draw_Prism_Volume (void *a, void *b){ Prism **p; int i ; - double Xc = 0.0 , Yc = 0.0, Zc = 0.0 ; + double Xc = 0.0 , Yc = 0.0, Zc = 0.0, X[6],Y[6],Z[6] ; + char Num[100]; p = (Prism**)a; if(!EntiteEstElleVisible((*p)->iEnt)) return; - + + for(i=0 ; i<6 ; i++){ + Xc += (*p)->V[i]->Pos.X; + Yc += (*p)->V[i]->Pos.Y; + Zc += (*p)->V[i]->Pos.Z; + } + Xc /= 6. ; + Zc /= 6. ; + Yc /= 6. ; + + if(CTX.mesh.use_cut_plane){ + if(CTX.mesh.evalCutPlane(Xc,Yc,Zc) < 0)return; + } + if(CTX.mesh.color_carousel) ColorSwitch((*p)->iEnt); else glColor4ubv((GLubyte*)&CTX.color.mesh.prism); + for (i=0 ; i<6 ; i++) { + X[i] = Xc + CTX.mesh.explode * ((*p)->V[i]->Pos.X - Xc); + Y[i] = Yc + CTX.mesh.explode * ((*p)->V[i]->Pos.Y - Yc); + Z[i] = Zc + CTX.mesh.explode * ((*p)->V[i]->Pos.Z - Zc); + } + glBegin(GL_LINE_LOOP); - glVertex3d((*p)->V[0]->Pos.X, (*p)->V[0]->Pos.Y, (*p)->V[0]->Pos.Z); - glVertex3d((*p)->V[1]->Pos.X, (*p)->V[1]->Pos.Y, (*p)->V[1]->Pos.Z); - glVertex3d((*p)->V[2]->Pos.X, (*p)->V[2]->Pos.Y, (*p)->V[2]->Pos.Z); + glVertex3d(X[0], Y[0], Z[0]); + glVertex3d(X[1], Y[1], Z[1]); + glVertex3d(X[2], Y[2], Z[2]); glEnd(); glBegin(GL_LINE_LOOP); - glVertex3d((*p)->V[3]->Pos.X, (*p)->V[3]->Pos.Y, (*p)->V[3]->Pos.Z); - glVertex3d((*p)->V[4]->Pos.X, (*p)->V[4]->Pos.Y, (*p)->V[4]->Pos.Z); - glVertex3d((*p)->V[5]->Pos.X, (*p)->V[5]->Pos.Y, (*p)->V[5]->Pos.Z); + glVertex3d(X[3], Y[3], Z[3]); + glVertex3d(X[4], Y[4], Z[4]); + glVertex3d(X[5], Y[5], Z[5]); glEnd(); glBegin(GL_LINES); - glVertex3d((*p)->V[0]->Pos.X, (*p)->V[0]->Pos.Y, (*p)->V[0]->Pos.Z); - glVertex3d((*p)->V[3]->Pos.X, (*p)->V[3]->Pos.Y, (*p)->V[3]->Pos.Z); - glVertex3d((*p)->V[1]->Pos.X, (*p)->V[1]->Pos.Y, (*p)->V[1]->Pos.Z); - glVertex3d((*p)->V[4]->Pos.X, (*p)->V[4]->Pos.Y, (*p)->V[4]->Pos.Z); - glVertex3d((*p)->V[2]->Pos.X, (*p)->V[2]->Pos.Y, (*p)->V[2]->Pos.Z); - glVertex3d((*p)->V[5]->Pos.X, (*p)->V[5]->Pos.Y, (*p)->V[5]->Pos.Z); + glVertex3d(X[0], Y[0], Z[0]); + glVertex3d(X[3], Y[3], Z[3]); + glVertex3d(X[1], Y[1], Z[1]); + glVertex3d(X[4], Y[4], Z[4]); + glVertex3d(X[2], Y[2], Z[2]); + glVertex3d(X[5], Y[5], Z[5]); glEnd(); - if (CTX.mesh.dual){ - for(i=0 ; i<6 ; i++){ - Xc += (*p)->V[i]->Pos.X; - Yc += (*p)->V[i]->Pos.Y; - Zc += (*p)->V[i]->Pos.Z; - } - Xc /= 6. ; - Zc /= 6. ; - Yc /= 6. ; + if(CTX.mesh.volumes_num){ + sprintf(Num,"%d",(*p)->Num); + glRasterPos3d(Xc,Yc,Zc); + Draw_String(Num); + } + if(CTX.mesh.dual){ glColor4ubv((GLubyte*)&CTX.color.fg); glEnable(GL_LINE_STIPPLE); glLineStipple(1,0x0F0F); @@ -749,33 +765,32 @@ void Draw_Prism_Volume (void *a, void *b){ glVertex3d(Xc, Yc, Zc); glVertex3d ( ((*p)->V[0]->Pos.X+(*p)->V[2]->Pos.X+(*p)->V[1]->Pos.X)/3., - ((*p)->V[0]->Pos.Y+(*p)->V[2]->Pos.Y+(*p)->V[1]->Pos.Y)/3., - ((*p)->V[0]->Pos.Z+(*p)->V[2]->Pos.Z+(*p)->V[1]->Pos.Z)/3. ); + ((*p)->V[0]->Pos.Y+(*p)->V[2]->Pos.Y+(*p)->V[1]->Pos.Y)/3., + ((*p)->V[0]->Pos.Z+(*p)->V[2]->Pos.Z+(*p)->V[1]->Pos.Z)/3. ); glVertex3d(Xc, Yc, Zc); glVertex3d ( ((*p)->V[3]->Pos.X+(*p)->V[4]->Pos.X+(*p)->V[5]->Pos.X)/3., - ((*p)->V[3]->Pos.Y+(*p)->V[4]->Pos.Y+(*p)->V[5]->Pos.Y)/3., - ((*p)->V[3]->Pos.Z+(*p)->V[4]->Pos.Z+(*p)->V[5]->Pos.Z)/3. ); + ((*p)->V[3]->Pos.Y+(*p)->V[4]->Pos.Y+(*p)->V[5]->Pos.Y)/3., + ((*p)->V[3]->Pos.Z+(*p)->V[4]->Pos.Z+(*p)->V[5]->Pos.Z)/3. ); glVertex3d(Xc, Yc, Zc); glVertex3d ( ((*p)->V[0]->Pos.X+(*p)->V[1]->Pos.X+(*p)->V[4]->Pos.X+(*p)->V[3]->Pos.X)/4., - ((*p)->V[0]->Pos.Y+(*p)->V[1]->Pos.Y+(*p)->V[4]->Pos.Y+(*p)->V[3]->Pos.Y)/4., - ((*p)->V[0]->Pos.Z+(*p)->V[1]->Pos.Z+(*p)->V[4]->Pos.Z+(*p)->V[3]->Pos.Z)/4. ); + ((*p)->V[0]->Pos.Y+(*p)->V[1]->Pos.Y+(*p)->V[4]->Pos.Y+(*p)->V[3]->Pos.Y)/4., + ((*p)->V[0]->Pos.Z+(*p)->V[1]->Pos.Z+(*p)->V[4]->Pos.Z+(*p)->V[3]->Pos.Z)/4. ); glVertex3d(Xc, Yc, Zc); glVertex3d ( ((*p)->V[0]->Pos.X+(*p)->V[3]->Pos.X+(*p)->V[5]->Pos.X+(*p)->V[2]->Pos.X)/4., - ((*p)->V[0]->Pos.Y+(*p)->V[3]->Pos.Y+(*p)->V[5]->Pos.Y+(*p)->V[2]->Pos.Y)/4., - ((*p)->V[0]->Pos.Z+(*p)->V[3]->Pos.Z+(*p)->V[5]->Pos.Z+(*p)->V[2]->Pos.Z)/4. ); + ((*p)->V[0]->Pos.Y+(*p)->V[3]->Pos.Y+(*p)->V[5]->Pos.Y+(*p)->V[2]->Pos.Y)/4., + ((*p)->V[0]->Pos.Z+(*p)->V[3]->Pos.Z+(*p)->V[5]->Pos.Z+(*p)->V[2]->Pos.Z)/4. ); glVertex3d(Xc, Yc, Zc); glVertex3d ( ((*p)->V[1]->Pos.X+(*p)->V[2]->Pos.X+(*p)->V[5]->Pos.X+(*p)->V[4]->Pos.X)/4., - ((*p)->V[1]->Pos.Y+(*p)->V[2]->Pos.Y+(*p)->V[5]->Pos.Y+(*p)->V[4]->Pos.Y)/4., - ((*p)->V[1]->Pos.Z+(*p)->V[2]->Pos.Z+(*p)->V[5]->Pos.Z+(*p)->V[4]->Pos.Z)/4. ); + ((*p)->V[1]->Pos.Y+(*p)->V[2]->Pos.Y+(*p)->V[5]->Pos.Y+(*p)->V[4]->Pos.Y)/4., + ((*p)->V[1]->Pos.Z+(*p)->V[2]->Pos.Z+(*p)->V[5]->Pos.Z+(*p)->V[4]->Pos.Z)/4. ); glEnd(); glDisable(GL_LINE_STIPPLE); gl2psDisable(GL2PS_LINE_STIPPLE); } - } diff --git a/Graphics/Post.cpp b/Graphics/Post.cpp index 498cafeaffbb231f1870c35a02fb3a85a059dd65..07e5a154fd6eb7ebf428b23b0964e2cd615c63af 100644 --- a/Graphics/Post.cpp +++ b/Graphics/Post.cpp @@ -1,7 +1,8 @@ -// $Id: Post.cpp,v 1.22 2001-08-03 21:27:20 geuzaine Exp $ +// $Id: Post.cpp,v 1.23 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" +#include "Numeric.h" #include "Geo.h" #include "Mesh.h" #include "Draw.h" @@ -179,7 +180,7 @@ void Draw_Post (void) { v = (Post_View*)List_Pointer(Post_ViewList,iView); - if(v->Visible){ + if(v->Visible && !v->Dirty){ if(CTX.display_lists && !v->Changed && glIsList(v->Num)){ @@ -194,14 +195,12 @@ void Draw_Post (void) { glNewList(v->Num, GL_COMPILE_AND_EXECUTE); } - if(v->Light && v->IntervalsType != DRAW_POST_ISO){ + if(v->Light) InitShading(); - } - else{ + else InitNoShading(); - } - if(v->ShowElement || v->ArrowType == DRAW_POST_DISPLACEMENT) + if(v->ShowElement) glEnable(GL_POLYGON_OFFSET_FILL) ; // force this diff --git a/Graphics/PostSimplex.cpp b/Graphics/PostSimplex.cpp index cd865d6ca724f20f8537d844be2efecc0aff2e5a..ebdefcf01fe743db8c78a48574eabd19e79beeb6 100644 --- a/Graphics/PostSimplex.cpp +++ b/Graphics/PostSimplex.cpp @@ -1,4 +1,4 @@ -// $Id: PostSimplex.cpp,v 1.28 2001-08-09 18:28:23 remacle Exp $ +// $Id: PostSimplex.cpp,v 1.29 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -12,7 +12,7 @@ extern Context_T CTX; -void Draw_Simplex(int nbnod, double *X, double *Y, double *Z, +void Draw_Simplex(Post_View *View, int nbnod, double *X, double *Y, double *Z, double Raise[3][5]){ int k; double xx[4], yy[4], zz[4]; @@ -37,6 +37,7 @@ void Draw_Simplex(int nbnod, double *X, double *Y, double *Z, yy[k] = Y[k]+Raise[1][k] ; zz[k] = Z[k]+Raise[2][k] ; } + if(View->Light) glDisable(GL_LIGHTING); glBegin(GL_LINES); glVertex3d(xx[0], yy[0], zz[0]); glVertex3d(xx[1], yy[1], zz[1]); glVertex3d(xx[0], yy[0], zz[0]); glVertex3d(xx[2], yy[2], zz[2]); @@ -45,6 +46,7 @@ void Draw_Simplex(int nbnod, double *X, double *Y, double *Z, glVertex3d(xx[1], yy[1], zz[1]); glVertex3d(xx[3], yy[3], zz[3]); glVertex3d(xx[2], yy[2], zz[2]); glVertex3d(xx[3], yy[3], zz[3]); glEnd(); + if(View->Light) glEnable(GL_LIGHTING); break; } } @@ -71,7 +73,7 @@ void Draw_ScalarPoint(Post_View *View, RaiseFill(0, d, ValMin, Raise); - if(View->ShowElement) Draw_Simplex(1,X,Y,Z,Raise); + if(View->ShowElement) Draw_Simplex(View,1,X,Y,Z,Raise); if(d>=ValMin && d<=ValMax){ Palette2(View,ValMin,ValMax,d); @@ -123,7 +125,7 @@ void Draw_ScalarLine(Post_View *View, for(k=0 ; k<2 ; k++) RaiseFill(k, Val[k], ValMin, Raise); - if(View->ShowElement) Draw_Simplex(2,X,Y,Z,Raise); + if(View->ShowElement) Draw_Simplex(View,2,X,Y,Z,Raise); if(View->IntervalsType == DRAW_POST_NUMERIC){ @@ -267,18 +269,15 @@ void Draw_ScalarTriangle(Post_View *View, int preproNormals, norms[3*i+2] = nn[2]; } } - - // hey geuz, t'avais mis glNormal3dv(nn); + //norme(norms); not necessary since GL_NORMALIZE is enabled + //norme(&norms[3]); + //norme(&norms[6]); glNormal3dv(norms); } - norme(norms); - norme(&norms[3]); - norme(&norms[6]); - if(preproNormals) return; - if(View->ShowElement) Draw_Simplex(3,X,Y,Z,Raise); + if(View->ShowElement) Draw_Simplex(View,3,X,Y,Z,Raise); if(View->IntervalsType == DRAW_POST_NUMERIC){ @@ -401,7 +400,7 @@ void Draw_ScalarTetrahedron(Post_View *View, int preproNormals, for(k=0 ; k<4 ; k++) RaiseFill(k, Val[k], ValMin, Raise); - if(!preproNormals && View->ShowElement) Draw_Simplex(4,X,Y,Z,Raise); + if(!preproNormals && View->ShowElement) Draw_Simplex(View,4,X,Y,Z,Raise); if(!preproNormals && View->IntervalsType == DRAW_POST_NUMERIC){ @@ -486,7 +485,7 @@ void Draw_VectorSimplex(int nbnod, Post_View *View, return; } - if(View->ShowElement) Draw_Simplex(nbnod,X,Y,Z,Raise); + if(View->ShowElement) Draw_Simplex(View,nbnod,X,Y,Z,Raise); if(View->ArrowLocation == DRAW_POST_LOCATE_COG || View->IntervalsType == DRAW_POST_NUMERIC){ diff --git a/Graphics/Scale.cpp b/Graphics/Scale.cpp index cc50f28a70b9e9019028b9f208bfc106b98accc7..e3d5ec76246bb99e3f63f51bad077a070c2f9dd6 100644 --- a/Graphics/Scale.cpp +++ b/Graphics/Scale.cpp @@ -1,8 +1,8 @@ -// $Id: Scale.cpp,v 1.20 2001-08-06 12:26:26 geuzaine Exp $ +// $Id: Scale.cpp,v 1.21 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" #include "Draw.h" #include "Context.h" diff --git a/Mesh/1D_Mesh.cpp b/Mesh/1D_Mesh.cpp index ecfce07e0e187a2f14df3db0081e98b43e3be7fa..17b5ac1685e73f3b427b17eb77e6d4d78dee4125 100644 --- a/Mesh/1D_Mesh.cpp +++ b/Mesh/1D_Mesh.cpp @@ -1,12 +1,12 @@ -// $Id: 1D_Mesh.cpp,v 1.17 2001-08-01 16:37:15 geuzaine Exp $ +// $Id: 1D_Mesh.cpp,v 1.18 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "Mesh.h" +#include "Utils.h" #include "Context.h" #include "Interpolation.h" -#include "Numeric.h" extern Mesh *THEM; extern Context_T CTX; @@ -161,7 +161,7 @@ void Maillage_Curve (void *data, void *dummy){ } else{ pV = Create_Vertex ((*v)->Num, (*v)->Pos.X, (*v)->Pos.Y, - (*v)->Pos.Z, (*v)->lc, 0.0); + (*v)->Pos.Z, (*v)->lc, c->ubeg); pV->ListCurves = List_Create (1, 1, sizeof (Curve *)); List_Add (pV->ListCurves, &c); Tree_Insert (THEM->Vertices, &pV); @@ -205,7 +205,7 @@ void Maillage_Curve (void *data, void *dummy){ } else{ pV = Create_Vertex ((*v)->Num, (*v)->Pos.X, (*v)->Pos.Y, - (*v)->Pos.Z, (*v)->lc, 0.0); + (*v)->Pos.Z, (*v)->lc, c->uend); pV->ListCurves = List_Create (1, 1, sizeof (Curve *)); List_Add (pV->ListCurves, &c); Tree_Insert (THEM->Vertices, &pV); diff --git a/Mesh/2D_BGMesh.cpp b/Mesh/2D_BGMesh.cpp index 1460e04ff75b0eab74b5a500e00134519da200f3..8113d3d6e657cfe0a608914bad34fe9b6847c283 100644 --- a/Mesh/2D_BGMesh.cpp +++ b/Mesh/2D_BGMesh.cpp @@ -1,7 +1,7 @@ -// $Id: 2D_BGMesh.cpp,v 1.7 2001-04-08 20:36:49 geuzaine Exp $ +// $Id: 2D_BGMesh.cpp,v 1.8 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" #include "2D_Mesh.h" diff --git a/Mesh/2D_Bowyer.cpp b/Mesh/2D_Bowyer.cpp index c781205ae4d433b5ede1af4323a0425f948449cc..d0c7fbcfad2a869c7ed3e7cf988343b7f76dd24f 100644 --- a/Mesh/2D_Bowyer.cpp +++ b/Mesh/2D_Bowyer.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Bowyer.cpp,v 1.7 2001-04-08 20:36:49 geuzaine Exp $ +// $Id: 2D_Bowyer.cpp,v 1.8 2001-08-11 23:28:32 geuzaine Exp $ /* @@ -22,7 +22,7 @@ */ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" #include "2D_Mesh.h" diff --git a/Mesh/2D_Bricks.cpp b/Mesh/2D_Bricks.cpp index ee3303e7edf911934b7c5f874ebaa27ab13c4e19..58ccb628765332d7888144142de9f5bfdf586ad0 100644 --- a/Mesh/2D_Bricks.cpp +++ b/Mesh/2D_Bricks.cpp @@ -1,7 +1,7 @@ -// $Id: 2D_Bricks.cpp,v 1.4 2001-01-08 08:05:44 geuzaine Exp $ +// $Id: 2D_Bricks.cpp,v 1.5 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" #include "2D_Mesh.h" diff --git a/Mesh/2D_Cylindrical.cpp b/Mesh/2D_Cylindrical.cpp index 9c1c6fcfd3f318c0885bebe7ba3f53ddac631cfe..3b3e8e89aed77cc3964311ac5365bbb7640f7765 100644 --- a/Mesh/2D_Cylindrical.cpp +++ b/Mesh/2D_Cylindrical.cpp @@ -1,10 +1,9 @@ -// $Id: 2D_Cylindrical.cpp,v 1.6 2001-06-02 16:24:51 geuzaine Exp $ +// $Id: 2D_Cylindrical.cpp,v 1.7 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" #include "Context.h" -#include "Numeric.h" extern Mesh *THEM; extern Context_T CTX; diff --git a/Mesh/2D_DivAndConq.cpp b/Mesh/2D_DivAndConq.cpp index 1f002b8ff1010193356165f157ed3599acbadfe5..0e6c17f5f9f7b8ff5bf92ea6e7d01a9ee9a11b71 100644 --- a/Mesh/2D_DivAndConq.cpp +++ b/Mesh/2D_DivAndConq.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_DivAndConq.cpp,v 1.10 2001-04-08 20:36:49 geuzaine Exp $ +// $Id: 2D_DivAndConq.cpp,v 1.11 2001-08-11 23:28:32 geuzaine Exp $ /* @@ -21,7 +21,7 @@ */ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" #include "2D_Mesh.h" diff --git a/Mesh/2D_Elliptic.cpp b/Mesh/2D_Elliptic.cpp index fff8c30975fbc09d8e622d71a13bbb8fa75d0328..57bcdeca76aa35fff40721a0e395bc24a7c4e6dc 100644 --- a/Mesh/2D_Elliptic.cpp +++ b/Mesh/2D_Elliptic.cpp @@ -1,7 +1,7 @@ -// $Id: 2D_Elliptic.cpp,v 1.6 2001-06-02 16:24:51 geuzaine Exp $ +// $Id: 2D_Elliptic.cpp,v 1.7 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "CAD.h" #include "Mesh.h" diff --git a/Mesh/2D_InitMesh.cpp b/Mesh/2D_InitMesh.cpp index 34091d2c68fa58042b8cc81d5287efdad16e8404..0302675ce480ef071f9ce0b9a94824be964a02f5 100644 --- a/Mesh/2D_InitMesh.cpp +++ b/Mesh/2D_InitMesh.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_InitMesh.cpp,v 1.7 2001-04-08 20:36:49 geuzaine Exp $ +// $Id: 2D_InitMesh.cpp,v 1.8 2001-08-11 23:28:32 geuzaine Exp $ /* @@ -55,10 +55,9 @@ */ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" #include "2D_Mesh.h" -#include "Numeric.h" static int pointA,pointB,Counter,Stagnant,StopNow; static Tree_T *ETree,*EDToSwap; diff --git a/Mesh/2D_Links.cpp b/Mesh/2D_Links.cpp index 51a52883cd77114865d2b5945cbb6553ddef447b..1165b56731beb8099c043dd2c93925c86585f8fa 100644 --- a/Mesh/2D_Links.cpp +++ b/Mesh/2D_Links.cpp @@ -1,7 +1,7 @@ -// $Id: 2D_Links.cpp,v 1.8 2001-06-25 13:30:57 remacle Exp $ +// $Id: 2D_Links.cpp,v 1.9 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" #include "2D_Mesh.h" diff --git a/Mesh/2D_Mesh.cpp b/Mesh/2D_Mesh.cpp index 4fcd6452e67c5d2e777af98adc41e8fc68b19e98..a77a6639c3c2f291bdbb4cad051093d8e7fac118 100644 --- a/Mesh/2D_Mesh.cpp +++ b/Mesh/2D_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Mesh.cpp,v 1.31 2001-08-01 16:37:15 geuzaine Exp $ +// $Id: 2D_Mesh.cpp,v 1.32 2001-08-11 23:28:32 geuzaine Exp $ /* Maillage Delaunay d'une surface (Point insertion Technique) @@ -16,13 +16,13 @@ */ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "CAD.h" #include "Mesh.h" +#include "Utils.h" #include "Create.h" #include "2D_Mesh.h" -#include "Numeric.h" #include "Context.h" extern Mesh *THEM; diff --git a/Mesh/2D_Mesh_Aniso.cpp b/Mesh/2D_Mesh_Aniso.cpp index c7b732b7e067e74c1ee946dd2d23e4e86c7baaf2..78e3c3154319f877937c2cb0d30a85523196bb7c 100644 --- a/Mesh/2D_Mesh_Aniso.cpp +++ b/Mesh/2D_Mesh_Aniso.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Mesh_Aniso.cpp,v 1.17 2001-06-06 21:29:58 remacle Exp $ +// $Id: 2D_Mesh_Aniso.cpp,v 1.18 2001-08-11 23:28:32 geuzaine Exp $ /* Jean-Francois Remacle @@ -8,14 +8,13 @@ */ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "CAD.h" #include "Mesh.h" #include "Interpolation.h" #include "Create.h" #include "Context.h" -#include "Numeric.h" extern Context_T CTX ; extern double LC2D ; diff --git a/Mesh/2D_Parametric.cpp b/Mesh/2D_Parametric.cpp index 36ea5e5b12edb4fd1d869519e8cd42b266fb000e..0996538f4dc49f1b255b774bb455656115f027d7 100644 --- a/Mesh/2D_Parametric.cpp +++ b/Mesh/2D_Parametric.cpp @@ -1,7 +1,7 @@ -// $Id: 2D_Parametric.cpp,v 1.5 2001-06-02 16:24:51 geuzaine Exp $ +// $Id: 2D_Parametric.cpp,v 1.6 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "CAD.h" #include "Interpolation.h" @@ -9,7 +9,6 @@ #include "2D_Mesh.h" #include "Create.h" #include "Context.h" -#include "Numeric.h" extern Mesh *THEM; extern Context_T CTX; diff --git a/Mesh/2D_Recombine.cpp b/Mesh/2D_Recombine.cpp index b4298957a9cb6749449cea92be3701f57702410b..91806c3365fce56b61a822ca418da72732b8ac73 100644 --- a/Mesh/2D_Recombine.cpp +++ b/Mesh/2D_Recombine.cpp @@ -1,11 +1,11 @@ -// $Id: 2D_Recombine.cpp,v 1.8 2001-06-28 07:46:11 geuzaine Exp $ +// $Id: 2D_Recombine.cpp,v 1.9 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" +#include "Utils.h" #include "2D_Mesh.h" #include "Create.h" -#include "Numeric.h" #include "Context.h" extern Context_T CTX; diff --git a/Mesh/2D_Util.cpp b/Mesh/2D_Util.cpp index b7358ee61121cfd55a8110a29210031179140e0d..32dc5e8d6051a9fd8d04fffb906c58e09920c58a 100644 --- a/Mesh/2D_Util.cpp +++ b/Mesh/2D_Util.cpp @@ -1,7 +1,7 @@ -// $Id: 2D_Util.cpp,v 1.11 2001-06-25 18:34:59 remacle Exp $ +// $Id: 2D_Util.cpp,v 1.12 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" #include "2D_Mesh.h" #include "Context.h" diff --git a/Mesh/3D_Bricks.cpp b/Mesh/3D_Bricks.cpp index bae086d4278f129c21c8db5a49113cb16805ee83..9c02ee80172672bde0fbed2223cf55b39c619d3b 100644 --- a/Mesh/3D_Bricks.cpp +++ b/Mesh/3D_Bricks.cpp @@ -1,7 +1,7 @@ -// $Id: 3D_Bricks.cpp,v 1.6 2001-01-08 08:05:45 geuzaine Exp $ +// $Id: 3D_Bricks.cpp,v 1.7 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" Brick LaBrique (Grid_T * pGrid, double X, double Y, double Z){ diff --git a/Mesh/3D_Coherence.cpp b/Mesh/3D_Coherence.cpp index 5b59c7f9ceedbb7ccde9fe2913b1b8c2de2b3f7a..c493d0eeeea72201e9f11cb9344734aba4a16fd0 100644 --- a/Mesh/3D_Coherence.cpp +++ b/Mesh/3D_Coherence.cpp @@ -1,12 +1,11 @@ -// $Id: 3D_Coherence.cpp,v 1.15 2001-06-07 14:20:08 remacle Exp $ +// $Id: 3D_Coherence.cpp,v 1.16 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "Mesh.h" #include "3D_Mesh.h" #include "Create.h" -#include "Numeric.h" extern Mesh *THEM; extern int CurrentNodeNumber, FACE_DIMENSION; diff --git a/Mesh/3D_Divide.cpp b/Mesh/3D_Divide.cpp index 0b893eeeb3b88410a57851f387a88b45479e84ab..a345e8567907134318672a7eaa82af04930b111b 100644 --- a/Mesh/3D_Divide.cpp +++ b/Mesh/3D_Divide.cpp @@ -1,4 +1,4 @@ -// $Id: 3D_Divide.cpp,v 1.11 2001-04-08 20:36:50 geuzaine Exp $ +// $Id: 3D_Divide.cpp,v 1.12 2001-08-11 23:28:32 geuzaine Exp $ /* Routine de division des elements tetraedriques ou triangulaires @@ -10,7 +10,7 @@ */ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" extern int edges_tetra[6][2]; diff --git a/Mesh/3D_Extrude_Old.cpp b/Mesh/3D_Extrude_Old.cpp index 76dd20b8672fc743b978aa8bd241f13f5ba7fed7..2d22ec0ee5160c980eeb5919c8e7ac452b85085c 100644 --- a/Mesh/3D_Extrude_Old.cpp +++ b/Mesh/3D_Extrude_Old.cpp @@ -1,4 +1,4 @@ -// $Id: 3D_Extrude_Old.cpp,v 1.11 2001-06-27 15:42:00 geuzaine Exp $ +// $Id: 3D_Extrude_Old.cpp,v 1.12 2001-08-11 23:28:32 geuzaine Exp $ // This is the old extrusion mesh generator -> only available through // the command line option -extrude (w/o -recombine). This mesh @@ -29,7 +29,7 @@ #define K2 1.e6 // to store MAXLAYERS #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "CAD.h" #include "Mesh.h" diff --git a/Mesh/3D_Mesh.cpp b/Mesh/3D_Mesh.cpp index 232b52e8f1a4be3f25ff9183755b235b53ebc2a2..74a17c376a219934ef0d06d27a94cde963e65d1d 100644 --- a/Mesh/3D_Mesh.cpp +++ b/Mesh/3D_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: 3D_Mesh.cpp,v 1.23 2001-08-01 16:37:15 geuzaine Exp $ +// $Id: 3D_Mesh.cpp,v 1.24 2001-08-11 23:28:32 geuzaine Exp $ /* @@ -17,11 +17,10 @@ */ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" #include "3D_Mesh.h" #include "Create.h" -#include "Numeric.h" #include "Context.h" extern Mesh *THEM, *LOCAL; diff --git a/Mesh/Create.cpp b/Mesh/Create.cpp index 25293b2f3fc720488007cbe76cbac12779704b65..c65a204159ea74c6ba713eac253e3b48d567419b 100644 --- a/Mesh/Create.cpp +++ b/Mesh/Create.cpp @@ -1,11 +1,11 @@ -// $Id: Create.cpp,v 1.22 2001-08-01 16:37:15 geuzaine Exp $ +// $Id: Create.cpp,v 1.23 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "CAD.h" #include "Mesh.h" -#include "Numeric.h" +#include "Utils.h" #include "Context.h" #include "Create.h" diff --git a/Mesh/Edge.cpp b/Mesh/Edge.cpp index 52dcb872edd8b5365d35612886bda3fa8e3c58dc..357b88a5f8aa9b11f2769f01e30e41cca0d992d7 100644 --- a/Mesh/Edge.cpp +++ b/Mesh/Edge.cpp @@ -1,8 +1,8 @@ -// $Id: Edge.cpp,v 1.5 2001-06-06 21:29:58 remacle Exp $ +// $Id: Edge.cpp,v 1.6 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" +#include "Numeric.h" #include "Mesh.h" -#include "Const.h" #include "Edge.h" #include "Tools.h" diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp index 85ee825d877884fa2b81d7f0b47df0febbd58b33..b3e132fc55516e499d967634205ece5da813b8df 100644 --- a/Mesh/Generator.cpp +++ b/Mesh/Generator.cpp @@ -1,7 +1,7 @@ -// $Id: Generator.cpp,v 1.23 2001-06-25 15:22:26 remacle Exp $ +// $Id: Generator.cpp,v 1.24 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" #include "Create.h" #include "Context.h" diff --git a/Mesh/Interpolation.cpp b/Mesh/Interpolation.cpp index 2328e7536e9716ee1bbba4a60dc6c5fb72188bd5..bc775a0e671597c7981aabec49e33141b89914fb 100644 --- a/Mesh/Interpolation.cpp +++ b/Mesh/Interpolation.cpp @@ -1,11 +1,11 @@ -// $Id: Interpolation.cpp,v 1.9 2001-06-02 16:24:51 geuzaine Exp $ +// $Id: Interpolation.cpp,v 1.10 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "CAD.h" #include "Mesh.h" -#include "Numeric.h" +#include "Utils.h" #include "Interpolation.h" /* ------------------------------------------------------------------------ */ diff --git a/Mesh/MeshQuality.cpp b/Mesh/MeshQuality.cpp index ae6c7dcf622f74e3ed21187f8aaff3ccd84c07d8..570bf05a963a6a09f5c343b67b9dc2c917de40a2 100644 --- a/Mesh/MeshQuality.cpp +++ b/Mesh/MeshQuality.cpp @@ -1,9 +1,8 @@ -// $Id: MeshQuality.cpp,v 1.4 2001-05-23 07:29:42 geuzaine Exp $ +// $Id: MeshQuality.cpp,v 1.5 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" -#include "Mesh.h" #include "Numeric.h" +#include "Mesh.h" /* Fonctions calculant differents parametres donnant la qualite d'un maillage (surtout 3-D) */ diff --git a/Mesh/Metric.cpp b/Mesh/Metric.cpp index 2606d9f27248f48774f4df7cfc9e788a53e26ed2..2b179b759c7d0ae522f1e67de3c1755d2b493771 100644 --- a/Mesh/Metric.cpp +++ b/Mesh/Metric.cpp @@ -1,7 +1,7 @@ -// $Id: Metric.cpp,v 1.5 2001-01-08 08:05:46 geuzaine Exp $ +// $Id: Metric.cpp,v 1.6 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "CAD.h" #include "Mesh.h" diff --git a/Mesh/Print_Mesh.cpp b/Mesh/Print_Mesh.cpp index ecb870bb00f593d9ed66e8c9b923e4bc82f21eb2..d81d43457e8bf9b44cc23b0d0e4f76512a92dc28 100644 --- a/Mesh/Print_Mesh.cpp +++ b/Mesh/Print_Mesh.cpp @@ -1,7 +1,7 @@ -// $Id: Print_Mesh.cpp,v 1.24 2001-08-02 07:26:38 geuzaine Exp $ +// $Id: Print_Mesh.cpp,v 1.25 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "CAD.h" #include "Mesh.h" diff --git a/Mesh/SecondOrder.cpp b/Mesh/SecondOrder.cpp index ce347f0ee90c7bfa40b052b1b1037cc424f4be1d..b893ed481a42988f831bbb7c4d58ad80e6c9710a 100644 --- a/Mesh/SecondOrder.cpp +++ b/Mesh/SecondOrder.cpp @@ -1,8 +1,9 @@ -// $Id: SecondOrder.cpp,v 1.5 2001-01-08 08:05:46 geuzaine Exp $ +// $Id: SecondOrder.cpp,v 1.6 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" #include "Geo.h" #include "Mesh.h" +#include "Utils.h" #include "Interpolation.h" #include "Numeric.h" diff --git a/Mesh/Simplex.cpp b/Mesh/Simplex.cpp index 22b397d4bfddf971644cc5957c571ab104256924..5bb46fd95cd8cbe9be491a21c1cff2c3dc5e3495 100644 --- a/Mesh/Simplex.cpp +++ b/Mesh/Simplex.cpp @@ -1,11 +1,10 @@ -// $Id: Simplex.cpp,v 1.15 2001-07-26 18:47:59 remacle Exp $ +// $Id: Simplex.cpp,v 1.16 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "Mesh.h" #include "Simplex.h" -#include "Numeric.h" #include "Context.h" extern Context_T CTX; diff --git a/Mesh/Smoothing.cpp b/Mesh/Smoothing.cpp index ab13c852d411a83fceb6d9462388bac4aac4e7b4..003331721e64cb836d155f3b27f6d5f9f4aa8b76 100644 --- a/Mesh/Smoothing.cpp +++ b/Mesh/Smoothing.cpp @@ -1,7 +1,7 @@ -// $Id: Smoothing.cpp,v 1.5 2001-06-06 21:29:58 remacle Exp $ +// $Id: Smoothing.cpp,v 1.6 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" diff --git a/Mesh/SwapEdge.cpp b/Mesh/SwapEdge.cpp index 24095611ec98f0fa2270448e8a15f8fe4d442e32..74b695638f71ab7dbfc84d4f336248d7e2283a50 100644 --- a/Mesh/SwapEdge.cpp +++ b/Mesh/SwapEdge.cpp @@ -1,7 +1,7 @@ -// $Id: SwapEdge.cpp,v 1.6 2001-04-08 20:36:50 geuzaine Exp $ +// $Id: SwapEdge.cpp,v 1.7 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Mesh.h" #include "SwapPatterns.h" diff --git a/Mesh/Numeric.cpp b/Mesh/Utils.cpp similarity index 75% rename from Mesh/Numeric.cpp rename to Mesh/Utils.cpp index 7e0c497c0386225281798a635436d3dddf200f53..f7afd790f465d73f42435dd3e517ff0074df2c91 100644 --- a/Mesh/Numeric.cpp +++ b/Mesh/Utils.cpp @@ -1,51 +1,16 @@ -// $Id: Numeric.cpp,v 1.17 2001-08-01 21:18:21 geuzaine Exp $ +// $Id: Utils.cpp,v 1.1 2001-08-11 23:28:32 geuzaine Exp $ #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "CAD.h" #include "Mesh.h" -#include "Numeric.h" #include "Interpolation.h" #include "nrutil.h" #include "Context.h" extern Context_T CTX; -double myatan2 (double a, double b){ - if (a == 0.0 && b == 0) - return 0.0; - return atan2 (a, b); -} - -double myacos (double a){ - if (a == 0) - return Pi * 0.5; - if (a == 1) - return 0.0; - return acos (a); -} - -void prodve (double a[3], double b[3], double c[3]){ - c[2] = a[0] * b[1] - a[1] * b[0]; - c[1] = -a[0] * b[2] + a[2] * b[0]; - c[0] = a[1] * b[2] - a[2] * b[1]; -} - -void prosca (double a[3], double b[3], double *c){ - *c = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; -} - -void norme (double a[3]){ - double mod; - mod = sqrt (a[0] * a[0] + a[1] * a[1] + a[2] * a[2]); - if (mod == 0.0) - return; - a[0] /= mod; - a[1] /= mod; - a[2] /= mod; -} - void direction (Vertex * v1, Vertex * v2, double d[3]){ d[0] = v2->Pos.X - v1->Pos.X; d[1] = v2->Pos.Y - v1->Pos.Y; @@ -63,115 +28,6 @@ void Projette (Vertex * v, double mat[3][3]){ v->Pos.Z = Z; } -int sys2x2 (double mat[2][2], double b[2], double res[2]){ - double det, ud, norm; - int i; - - norm = DSQR (mat[0][0]) + DSQR (mat[1][1]) + DSQR (mat[0][1]) + DSQR (mat[1][0]); - det = mat[0][0] * mat[1][1] - mat[1][0] * mat[0][1]; - - // TOLERANCE ! WARNING WARNING - if (norm == 0.0 || fabs (det) / norm < 1.e-07){ - Msg(DEBUG, "Assuming 2x2 matrix is singular (det/norm == %g)", fabs(det)/norm); - res[0] = res[1] = 0.0 ; - return 0; - } - ud = 1. / det; - - res[0] = b[0] * mat[1][1] - mat[0][1] * b[1]; - res[1] = mat[0][0] * b[1] - mat[1][0] * b[0]; - - for (i = 0; i < 2; i++) - res[i] *= ud; - return (1); -} - -int sys3x3 (double mat[3][3], double b[3], double res[3], double *det){ - double ud; - int i; - - *det = mat[0][0] * (mat[1][1] * mat[2][2] - mat[1][2] * mat[2][1]) - - mat[0][1] * (mat[1][0] * mat[2][2] - mat[1][2] * mat[2][0]) + - mat[0][2] * (mat[1][0] * mat[2][1] - mat[1][1] * mat[2][0]); - - if (*det == 0.0){ - res[0] = res[1] = res[2] = 0.0 ; - return (0); - } - - ud = 1. / (*det); - - res[0] = b[0] * (mat[1][1] * mat[2][2] - mat[1][2] * mat[2][1]) - - mat[0][1] * (b[1] * mat[2][2] - mat[1][2] * b[2]) + - mat[0][2] * (b[1] * mat[2][1] - mat[1][1] * b[2]); - - res[1] = mat[0][0] * (b[1] * mat[2][2] - mat[1][2] * b[2]) - - b[0] * (mat[1][0] * mat[2][2] - mat[1][2] * mat[2][0]) + - mat[0][2] * (mat[1][0] * b[2] - b[1] * mat[2][0]); - - res[2] = mat[0][0] * (mat[1][1] * b[2] - b[1] * mat[2][1]) - - mat[0][1] * (mat[1][0] * b[2] - b[1] * mat[2][0]) + - b[0] * (mat[1][0] * mat[2][1] - mat[1][1] * mat[2][0]); - - for (i = 0; i < 3; i++) - res[i] *= ud; - return (1); - -} - -int sys3x3_with_tol (double mat[3][3], double b[3], double res[3], double *det){ - int out; - double norm; - - out = sys3x3(mat,b,res,det); - norm = - DSQR (mat[0][0]) + DSQR (mat[0][1]) + DSQR (mat[0][2]) + - DSQR (mat[1][0]) + DSQR (mat[1][1]) + DSQR (mat[1][2]) + - DSQR (mat[2][0]) + DSQR (mat[2][1]) + DSQR (mat[2][2]) ; - - // TOLERANCE ! WARNING WARNING - if (norm == 0.0 || fabs (*det) / norm < 1.e-12){ - Msg(DEBUG, "Assuming 3x3 matrix is singular (det/norm == %g)", fabs(*det)/norm); - res[0] = res[1] = res[2] = 0.0 ; - return 0; - } - - return out ; -} - -int det3x3 (double mat[3][3], double *det){ - *det = mat[0][0] * (mat[1][1] * mat[2][2] - mat[1][2] * mat[2][1]) - - mat[0][1] * (mat[1][0] * mat[2][2] - mat[1][2] * mat[2][0]) + - mat[0][2] * (mat[1][0] * mat[2][1] - mat[1][1] * mat[2][0]); - return 1; -} - -int inv3x3 (double mat[3][3], double inv[3][3], double *det){ - double ud; - - *det = mat[0][0] * (mat[1][1] * mat[2][2] - mat[1][2] * mat[2][1]) - - mat[0][1] * (mat[1][0] * mat[2][2] - mat[1][2] * mat[2][0]) + - mat[0][2] * (mat[1][0] * mat[2][1] - mat[1][1] * mat[2][0]); - - if (*det == 0.0) - return (0); - - ud = 1. / (*det); - - inv[0][0] = ud * (mat[1][1] * mat[2][2] - mat[1][2] * mat[2][1]); - inv[0][1] = -ud * (mat[1][0] * mat[2][2] - mat[1][2] * mat[2][0]); - inv[0][2] = ud * (mat[1][0] * mat[2][1] - mat[1][1] * mat[2][0]); - inv[1][0] = -ud * (mat[0][1] * mat[2][2] - mat[0][2] * mat[2][1]); - inv[1][1] = ud * (mat[0][0] * mat[2][2] - mat[0][2] * mat[2][0]); - inv[1][2] = -ud * (mat[0][0] * mat[2][1] - mat[0][1] * mat[2][0]); - inv[2][0] = ud * (mat[0][1] * mat[1][2] - mat[0][2] * mat[1][1]); - inv[2][1] = -ud * (mat[0][0] * mat[1][2] - mat[0][2] * mat[1][0]); - inv[2][2] = ud * (mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0]); - return (1); - -} - - void MeanPlane(List_T *points, Surface *s){ int i, j, ix, iy, iz, N; double det,sys[3][3],b[3],res[3],mod,t1[3],t2[3],ex[3],s2s[2][2],r2[2],X,Y,Z; @@ -617,17 +473,6 @@ int Oriente (List_T * cu, double n[3]){ return (0); } -double angle_02pi (double A3){ - double DP = 2 * Pi; - while (A3 > DP || A3 < 0.){ - if (A3 > 0) - A3 -= DP; - else - A3 += DP; - } - return A3; -} - double angle_3p (Vertex * V, Vertex * P1, Vertex * P2){ double PA[3], PB[3], angplan; double cosc, sinc, c[3]; diff --git a/Mesh/Numeric.h b/Mesh/Utils.h similarity index 62% rename from Mesh/Numeric.h rename to Mesh/Utils.h index 4208df365c8f6147c6cca9e982859a8b688cbf27..12c5a589c0b7dd4a2245427f1b6d2c647e0907af 100644 --- a/Mesh/Numeric.h +++ b/Mesh/Utils.h @@ -1,27 +1,15 @@ -#ifndef _NUMERIC_H_ -#define _NUMERIC_H_ +#ifndef _UTILS_H_ +#define _UTILS_H_ -double myatan2 (double a, double b); -double myacos (double a); -void prodve (double a[3], double b[3], double c[3]); -void prosca (double a[3], double b[3], double *c); -void norme (double a[3]); void direction (Vertex * v1, Vertex * v2, double d[3]); void Projette (Vertex * v, double mat[3][3]); -int sys2x2 (double mat[2][2], double b[2], double res[2]); -int sys3x3 (double mat[3][3], double b[3], double res[3], double *det); -int sys3x3_with_tol (double mat[3][3], double b[3], double res[3], double *det); -int det3x3 (double mat[3][3], double *det); -int inv3x3 (double mat[3][3], double inv[3][3], double *det); void MeanPlane(List_T *point, Surface *s); - void find_bestuv (Surface * s, double X, double Y, double *U, double *V, double *Z, int N); void XYtoUV (Surface * s, double *X, double *Y, double *U, double *V, double *Z); void XYZtoUV (Surface *s, double X, double Y, double Z, double *U, double *V); int Oriente (List_T * cu, double n[3]); -double angle_02pi (double A3); double angle_3p (Vertex * V, Vertex * P1, Vertex * P2); double angle_plan (Vertex * V, Vertex * P1, Vertex * P2, double n[3]); double angle_3pts (Vertex * a, Vertex * b, Vertex * c); diff --git a/Motif/CbColorbar.cpp b/Motif/CbColorbar.cpp index 419959e81e1f443749773dc54ddf82108dd4ef0e..5dd96c8c2839df16c2353d6d4c1f5fa745a61b72 100644 --- a/Motif/CbColorbar.cpp +++ b/Motif/CbColorbar.cpp @@ -1,8 +1,8 @@ -// $Id: CbColorbar.cpp,v 1.1 2001-01-08 08:20:10 geuzaine Exp $ +// $Id: CbColorbar.cpp,v 1.2 2001-08-11 23:28:33 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" -#include "Const.h" +#include "Numeric.h" #include "XColors.h" #include "Widgets.h" #include "Register.h" diff --git a/Motif/CbContext.cpp b/Motif/CbContext.cpp index 6a38c257dc9dbbe3f774e2d8472d49f68f23a174..510f1ff020515d93d1cc0307195d6b895fe6a7e9 100644 --- a/Motif/CbContext.cpp +++ b/Motif/CbContext.cpp @@ -1,4 +1,4 @@ -// $Id: CbContext.cpp,v 1.5 2001-01-29 08:43:44 geuzaine Exp $ +// $Id: CbContext.cpp,v 1.6 2001-08-11 23:28:33 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -601,8 +601,8 @@ int AddViewInUI(int i, char *Name, int Num){ if(i > NB_BUTT_MAX -1) return 1; - txt_post[i-1] = (char*)Malloc(NAME_STR_L*sizeof(char)); - strncpy(txt_post[i-1],Name,NAME_STR_L); + txt_post[i-1] = (char*)Malloc(256*sizeof(char)); + strncpy(txt_post[i-1],Name,255); if(actual_global_context == CONTEXT_POST) ActualizeContextCb(NULL,(XtPointer)actual_global_context,NULL); @@ -621,7 +621,7 @@ void RemoveViewCb(Widget w, XtPointer client_data, XtPointer call_data){ v = (Post_View*)List_Pointer(Post_ViewList,(long int)i-1); while(txt_post[i]){ - strncpy(txt_post[i-1], txt_post[i], NAME_STR_L); + strncpy(txt_post[i-1], txt_post[i], 255); i++; } Free(txt_post[i-1]); diff --git a/Motif/CbPost.cpp b/Motif/CbPost.cpp index 51f2501f2f2120bd84e9c3ca100289c1fa2be3b6..c1e77dacb1c4abdcbec76badf93159e16f303a4d 100644 --- a/Motif/CbPost.cpp +++ b/Motif/CbPost.cpp @@ -1,4 +1,4 @@ -// $Id: CbPost.cpp,v 1.6 2001-04-17 06:55:47 geuzaine Exp $ +// $Id: CbPost.cpp,v 1.7 2001-08-11 23:28:33 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -103,10 +103,8 @@ void DuplicateViewCb (Widget w, XtPointer client_data, XtPointer call_data){ v1 = (Post_View*)List_Pointer(Post_ViewList,(long int)client_data-1); - BeginView(0); - EndView(0, v1->FileName, v1->Name); - - v2 = (Post_View*)List_Pointer(Post_ViewList,List_Nbr(Post_ViewList)-1); + v2 = BeginView(0); + EndView(v2, 0, v1->FileName, v1->Name); if(!v1->DuplicateOf){ v2->DuplicateOf = v1->Num ; @@ -152,7 +150,7 @@ static int All = 0; void ReloadViewCb (Widget w, XtPointer client_data, XtPointer call_data){ Post_View *v, tmp ; - char filename[NAME_STR_L]; + char filename[256]; if(!Post_ViewList) return; diff --git a/Parser/Gmsh.l b/Parser/Gmsh.l index 65a4bc9636b16a3f03dd4b69048ef11e5bf7e8bd..a4424a10a660ff92f7855091737f10dc0aa3d096 100644 --- a/Parser/Gmsh.l +++ b/Parser/Gmsh.l @@ -1,6 +1,6 @@ %{ -// $Id: Gmsh.l,v 1.34 2001-08-08 14:05:26 remacle Exp $ +// $Id: Gmsh.l,v 1.35 2001-08-11 23:28:33 geuzaine Exp $ #include <stdio.h> #include <stdlib.h> @@ -8,7 +8,7 @@ #include <math.h> #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "CAD.h" #include "Gmsh.tab.cpp.h" diff --git a/Parser/Gmsh.tab.cpp b/Parser/Gmsh.tab.cpp index 9337e04ffc23b57df93ce4b7d5b9e3c6da55478a..219e3d72556cf405f8bec2be3ebc3548b0fc98f4 100644 --- a/Parser/Gmsh.tab.cpp +++ b/Parser/Gmsh.tab.cpp @@ -174,7 +174,7 @@ #line 1 "Gmsh.y" -// $Id: Gmsh.tab.cpp,v 1.104 2001-08-09 18:28:23 remacle Exp $ +// $Id: Gmsh.tab.cpp,v 1.105 2001-08-11 23:28:33 geuzaine Exp $ // // Generaliser sprintf avec des chaines de caracteres @@ -186,7 +186,7 @@ #endif #include "ParUtil.h" #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Context.h" #include "Geo.h" #include "CAD.h" @@ -220,9 +220,9 @@ static int yylinenoTab[MAX_OPEN_FILES]; static fpos_t yyposImbricatedLoopsTab[MAX_OPEN_FILES]; static double LoopControlVariablesTab[MAX_OPEN_FILES][3]; static char* LoopControlVariablesNameTab[MAX_OPEN_FILES]; -static char yynameTab[MAX_OPEN_FILES][NAME_STR_L]; -static char tmpstring[NAME_STR_L]; -static char tmpstring2[NAME_STR_L], tmpstring3[NAME_STR_L]; +static char yynameTab[MAX_OPEN_FILES][256]; +static char tmpstring[256]; +static char tmpstring2[256], tmpstring3[256]; static Symbol TheSymbol, *pSymbol; static Surface *STL_Surf; static Shape TheShape; @@ -588,35 +588,35 @@ static const short yyrline[] = { 0, 289, 294, 298, 301, 306, 310, 314, 318, 323, 327, 330, 334, 338, 342, 346, 350, 354, 357, 361, 364, 368, 371, 380, 384, 390, 392, 393, 394, 395, 396, - 397, 398, 399, 400, 401, 402, 405, 410, 439, 445, - 452, 457, 458, 459, 460, 461, 462, 463, 464, 465, - 466, 467, 468, 471, 474, 478, 484, 490, 493, 497, - 503, 509, 512, 516, 522, 528, 531, 535, 543, 549, - 552, 556, 564, 570, 573, 577, 585, 591, 594, 598, - 610, 616, 619, 623, 635, 641, 644, 648, 660, 666, - 669, 673, 686, 692, 695, 699, 712, 718, 721, 725, - 738, 750, 752, 753, 754, 755, 757, 759, 761, 792, - 826, 873, 888, 897, 912, 924, 938, 961, 985, 997, - 1011, 1023, 1037, 1053, 1069, 1082, 1102, 1113, 1119, 1138, - 1149, 1157, 1163, 1169, 1188, 1194, 1210, 1217, 1223, 1229, - 1235, 1241, 1260, 1272, 1278, 1297, 1318, 1326, 1332, 1338, - 1344, 1356, 1362, 1368, 1380, 1386, 1391, 1396, 1403, 1405, - 1406, 1409, 1414, 1425, 1443, 1451, 1456, 1467, 1535, 1555, - 1561, 1565, 1585, 1601, 1615, 1640, 1665, 1691, 1697, 1702, - 1707, 1711, 1721, 1727, 1733, 1737, 1741, 1745, 1749, 1754, - 1759, 1765, 1772, 1776, 1781, 1802, 1812, 1831, 1849, 1867, - 1889, 1910, 1931, 1945, 1966, 1971, 1982, 1984, 1985, 1986, - 1987, 1990, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, - 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, - 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, - 2036, 2037, 2042, 2047, 2048, 2049, 2053, 2064, 2081, 2092, - 2111, 2127, 2143, 2159, 2176, 2181, 2185, 2189, 2193, 2198, - 2203, 2207, 2211, 2217, 2221, 2226, 2230, 2235, 2239, 2243, - 2249, 2255, 2262, 2268, 2272, 2276, 2286, 2293, 2304, 2318, - 2334, 2354, 2378, 2384, 2388, 2392, 2403, 2408, 2419, 2424, - 2442, 2447, 2460, 2466, 2472, 2477, 2485, 2498, 2502, 2527, - 2541 + 397, 398, 399, 400, 401, 402, 405, 410, 439, 444, + 450, 455, 456, 457, 458, 459, 460, 461, 462, 463, + 464, 465, 466, 469, 472, 476, 482, 488, 491, 495, + 501, 507, 510, 514, 520, 526, 529, 533, 541, 547, + 550, 554, 562, 568, 571, 575, 583, 589, 592, 596, + 608, 614, 617, 621, 633, 639, 642, 646, 658, 664, + 667, 671, 684, 690, 693, 697, 710, 716, 719, 723, + 736, 748, 750, 751, 752, 753, 755, 757, 759, 790, + 824, 871, 886, 895, 910, 922, 936, 959, 983, 995, + 1009, 1021, 1035, 1051, 1067, 1080, 1100, 1111, 1117, 1136, + 1147, 1155, 1161, 1167, 1186, 1192, 1208, 1215, 1221, 1227, + 1233, 1239, 1258, 1270, 1276, 1295, 1316, 1324, 1330, 1336, + 1342, 1354, 1360, 1366, 1378, 1384, 1389, 1394, 1401, 1403, + 1404, 1407, 1412, 1423, 1441, 1449, 1454, 1465, 1533, 1553, + 1559, 1563, 1583, 1599, 1613, 1638, 1663, 1689, 1695, 1700, + 1705, 1709, 1719, 1725, 1731, 1735, 1739, 1743, 1747, 1752, + 1757, 1763, 1770, 1774, 1779, 1800, 1810, 1829, 1847, 1865, + 1887, 1908, 1929, 1943, 1964, 1969, 1980, 1982, 1983, 1984, + 1985, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, + 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, + 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, + 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, + 2034, 2035, 2040, 2045, 2046, 2047, 2051, 2062, 2079, 2090, + 2109, 2125, 2141, 2157, 2174, 2179, 2183, 2187, 2191, 2196, + 2201, 2205, 2209, 2215, 2219, 2224, 2228, 2233, 2237, 2241, + 2247, 2253, 2260, 2266, 2270, 2274, 2284, 2291, 2302, 2316, + 2332, 2352, 2376, 2382, 2386, 2390, 2401, 2406, 2417, 2422, + 2440, 2445, 2458, 2464, 2470, 2475, 2483, 2496, 2500, 2525, + 2539 }; #endif @@ -3300,96 +3300,94 @@ case 68: case 69: #line 441 "Gmsh.y" { - if(!strcmp(yyvsp[-5].c, "View")) - EndView(1, yyname, yyvsp[-4].c); + if(!strcmp(yyvsp[-5].c, "View")) EndView(View, 1, yyname, yyvsp[-4].c); ; break;} case 70: -#line 446 "Gmsh.y" +#line 445 "Gmsh.y" { - if(!strcmp(yyvsp[-7].c, "View")) - EndView(1, yyname, yyvsp[-6].c); + if(!strcmp(yyvsp[-7].c, "View")) EndView(View, 1, yyname, yyvsp[-6].c); ; break;} case 71: -#line 454 "Gmsh.y" +#line 452 "Gmsh.y" { View = BeginView(1); ; break;} case 84: -#line 473 "Gmsh.y" +#line 471 "Gmsh.y" { List_Add(View->SP, &yyvsp[0].d) ; ; break;} case 85: -#line 475 "Gmsh.y" +#line 473 "Gmsh.y" { List_Add(View->SP, &yyvsp[0].d) ; ; break;} case 86: -#line 480 "Gmsh.y" +#line 478 "Gmsh.y" { List_Add(View->SP, &yyvsp[-5].d); List_Add(View->SP, &yyvsp[-3].d); List_Add(View->SP, &yyvsp[-1].d); ; break;} case 87: -#line 485 "Gmsh.y" +#line 483 "Gmsh.y" { View->NbSP++ ; ; break;} case 88: -#line 492 "Gmsh.y" +#line 490 "Gmsh.y" { List_Add(View->VP, &yyvsp[0].d) ; ; break;} case 89: -#line 494 "Gmsh.y" +#line 492 "Gmsh.y" { List_Add(View->VP, &yyvsp[0].d) ; ; break;} case 90: -#line 499 "Gmsh.y" +#line 497 "Gmsh.y" { List_Add(View->VP, &yyvsp[-5].d); List_Add(View->VP, &yyvsp[-3].d); List_Add(View->VP, &yyvsp[-1].d); ; break;} case 91: -#line 504 "Gmsh.y" +#line 502 "Gmsh.y" { View->NbVP++ ; ; break;} case 92: -#line 511 "Gmsh.y" +#line 509 "Gmsh.y" { List_Add(View->TP, &yyvsp[0].d) ; ; break;} case 93: -#line 513 "Gmsh.y" +#line 511 "Gmsh.y" { List_Add(View->TP, &yyvsp[0].d) ; ; break;} case 94: -#line 518 "Gmsh.y" +#line 516 "Gmsh.y" { List_Add(View->TP, &yyvsp[-5].d); List_Add(View->TP, &yyvsp[-3].d); List_Add(View->TP, &yyvsp[-1].d); ; break;} case 95: -#line 523 "Gmsh.y" +#line 521 "Gmsh.y" { View->NbTP++ ; ; break;} case 96: -#line 530 "Gmsh.y" +#line 528 "Gmsh.y" { List_Add(View->SL, &yyvsp[0].d) ; ; break;} case 97: -#line 532 "Gmsh.y" +#line 530 "Gmsh.y" { List_Add(View->SL, &yyvsp[0].d) ; ; break;} case 98: -#line 538 "Gmsh.y" +#line 536 "Gmsh.y" { List_Add(View->SL, &yyvsp[-11].d); List_Add(View->SL, &yyvsp[-5].d); List_Add(View->SL, &yyvsp[-9].d); List_Add(View->SL, &yyvsp[-3].d); @@ -3397,21 +3395,21 @@ case 98: ; break;} case 99: -#line 544 "Gmsh.y" +#line 542 "Gmsh.y" { View->NbSL++ ; ; break;} case 100: -#line 551 "Gmsh.y" +#line 549 "Gmsh.y" { List_Add(View->VL, &yyvsp[0].d) ; ; break;} case 101: -#line 553 "Gmsh.y" +#line 551 "Gmsh.y" { List_Add(View->VL, &yyvsp[0].d) ; ; break;} case 102: -#line 559 "Gmsh.y" +#line 557 "Gmsh.y" { List_Add(View->VL, &yyvsp[-11].d); List_Add(View->VL, &yyvsp[-5].d); List_Add(View->VL, &yyvsp[-9].d); List_Add(View->VL, &yyvsp[-3].d); @@ -3419,21 +3417,21 @@ case 102: ; break;} case 103: -#line 565 "Gmsh.y" +#line 563 "Gmsh.y" { View->NbVL++ ; ; break;} case 104: -#line 572 "Gmsh.y" +#line 570 "Gmsh.y" { List_Add(View->TL, &yyvsp[0].d) ; ; break;} case 105: -#line 574 "Gmsh.y" +#line 572 "Gmsh.y" { List_Add(View->TL, &yyvsp[0].d) ; ; break;} case 106: -#line 580 "Gmsh.y" +#line 578 "Gmsh.y" { List_Add(View->TL, &yyvsp[-11].d); List_Add(View->TL, &yyvsp[-5].d); List_Add(View->TL, &yyvsp[-9].d); List_Add(View->TL, &yyvsp[-3].d); @@ -3441,21 +3439,21 @@ case 106: ; break;} case 107: -#line 586 "Gmsh.y" +#line 584 "Gmsh.y" { View->NbTL++ ; ; break;} case 108: -#line 593 "Gmsh.y" +#line 591 "Gmsh.y" { List_Add(View->ST, &yyvsp[0].d) ; ; break;} case 109: -#line 595 "Gmsh.y" +#line 593 "Gmsh.y" { List_Add(View->ST, &yyvsp[0].d) ; ; break;} case 110: -#line 602 "Gmsh.y" +#line 600 "Gmsh.y" { List_Add(View->ST, &yyvsp[-17].d); List_Add(View->ST, &yyvsp[-11].d); List_Add(View->ST, &yyvsp[-5].d); @@ -3466,21 +3464,21 @@ case 110: ; break;} case 111: -#line 611 "Gmsh.y" +#line 609 "Gmsh.y" { View->NbST++ ; ; break;} case 112: -#line 618 "Gmsh.y" +#line 616 "Gmsh.y" { List_Add(View->VT, &yyvsp[0].d) ; ; break;} case 113: -#line 620 "Gmsh.y" +#line 618 "Gmsh.y" { List_Add(View->VT, &yyvsp[0].d) ; ; break;} case 114: -#line 627 "Gmsh.y" +#line 625 "Gmsh.y" { List_Add(View->VT, &yyvsp[-17].d); List_Add(View->VT, &yyvsp[-11].d); List_Add(View->VT, &yyvsp[-5].d); @@ -3491,21 +3489,21 @@ case 114: ; break;} case 115: -#line 636 "Gmsh.y" +#line 634 "Gmsh.y" { View->NbVT++ ; ; break;} case 116: -#line 643 "Gmsh.y" +#line 641 "Gmsh.y" { List_Add(View->TT, &yyvsp[0].d) ; ; break;} case 117: -#line 645 "Gmsh.y" +#line 643 "Gmsh.y" { List_Add(View->TT, &yyvsp[0].d) ; ; break;} case 118: -#line 652 "Gmsh.y" +#line 650 "Gmsh.y" { List_Add(View->TT, &yyvsp[-17].d); List_Add(View->TT, &yyvsp[-11].d); List_Add(View->TT, &yyvsp[-5].d); @@ -3516,21 +3514,21 @@ case 118: ; break;} case 119: -#line 661 "Gmsh.y" +#line 659 "Gmsh.y" { View->NbTT++ ; ; break;} case 120: -#line 668 "Gmsh.y" +#line 666 "Gmsh.y" { List_Add(View->SS, &yyvsp[0].d) ; ; break;} case 121: -#line 670 "Gmsh.y" +#line 668 "Gmsh.y" { List_Add(View->SS, &yyvsp[0].d) ; ; break;} case 122: -#line 678 "Gmsh.y" +#line 676 "Gmsh.y" { List_Add(View->SS, &yyvsp[-23].d); List_Add(View->SS, &yyvsp[-17].d); List_Add(View->SS, &yyvsp[-11].d); List_Add(View->SS, &yyvsp[-5].d); @@ -3541,21 +3539,21 @@ case 122: ; break;} case 123: -#line 687 "Gmsh.y" +#line 685 "Gmsh.y" { View->NbSS++ ; ; break;} case 124: -#line 694 "Gmsh.y" +#line 692 "Gmsh.y" { List_Add(View->VS, &yyvsp[0].d) ; ; break;} case 125: -#line 696 "Gmsh.y" +#line 694 "Gmsh.y" { List_Add(View->VS, &yyvsp[0].d) ; ; break;} case 126: -#line 704 "Gmsh.y" +#line 702 "Gmsh.y" { List_Add(View->VS, &yyvsp[-23].d); List_Add(View->VS, &yyvsp[-17].d); List_Add(View->VS, &yyvsp[-11].d); List_Add(View->VS, &yyvsp[-5].d); @@ -3566,21 +3564,21 @@ case 126: ; break;} case 127: -#line 713 "Gmsh.y" +#line 711 "Gmsh.y" { View->NbVS++ ; ; break;} case 128: -#line 720 "Gmsh.y" +#line 718 "Gmsh.y" { List_Add(View->TS, &yyvsp[0].d) ; ; break;} case 129: -#line 722 "Gmsh.y" +#line 720 "Gmsh.y" { List_Add(View->TS, &yyvsp[0].d) ; ; break;} case 130: -#line 730 "Gmsh.y" +#line 728 "Gmsh.y" { List_Add(View->TS, &yyvsp[-23].d); List_Add(View->TS, &yyvsp[-17].d); List_Add(View->TS, &yyvsp[-11].d); List_Add(View->TS, &yyvsp[-5].d); @@ -3591,41 +3589,41 @@ case 130: ; break;} case 131: -#line 739 "Gmsh.y" +#line 737 "Gmsh.y" { View->NbTS++ ; ; break;} case 132: -#line 751 "Gmsh.y" +#line 749 "Gmsh.y" { yyval.i = 0 ; ; break;} case 133: -#line 752 "Gmsh.y" +#line 750 "Gmsh.y" { yyval.i = 1 ; ; break;} case 134: -#line 753 "Gmsh.y" +#line 751 "Gmsh.y" { yyval.i = 2 ; ; break;} case 135: -#line 754 "Gmsh.y" +#line 752 "Gmsh.y" { yyval.i = 3 ; ; break;} case 136: -#line 755 "Gmsh.y" +#line 753 "Gmsh.y" { yyval.i = 4 ; ; break;} case 137: -#line 758 "Gmsh.y" +#line 756 "Gmsh.y" { yyval.i = 1 ; ; break;} case 138: -#line 759 "Gmsh.y" +#line 757 "Gmsh.y" { yyval.i = -1 ; ; break;} case 139: -#line 766 "Gmsh.y" +#line 764 "Gmsh.y" { TheSymbol.Name = yyvsp[-3].c; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))){ @@ -3653,7 +3651,7 @@ case 139: ; break;} case 140: -#line 793 "Gmsh.y" +#line 791 "Gmsh.y" { TheSymbol.Name = yyvsp[-6].c; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))){ @@ -3688,7 +3686,7 @@ case 140: ; break;} case 141: -#line 827 "Gmsh.y" +#line 825 "Gmsh.y" { if(List_Nbr(yyvsp[-5].l) != List_Nbr(yyvsp[-1].l)) vyyerror("Incompatible array dimensions in affectation"); @@ -3736,7 +3734,7 @@ case 141: ; break;} case 142: -#line 874 "Gmsh.y" +#line 872 "Gmsh.y" { TheSymbol.Name = yyvsp[-5].c; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))){ @@ -3752,7 +3750,7 @@ case 142: ; break;} case 143: -#line 889 "Gmsh.y" +#line 887 "Gmsh.y" { TheSymbol.Name = yyvsp[-2].c; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) @@ -3762,7 +3760,7 @@ case 143: ; break;} case 144: -#line 898 "Gmsh.y" +#line 896 "Gmsh.y" { TheSymbol.Name = yyvsp[-5].c ; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) @@ -3776,7 +3774,7 @@ case 144: ; break;} case 145: -#line 913 "Gmsh.y" +#line 911 "Gmsh.y" { if(!(pStrCat = Get_StringOptionCategory(yyvsp[-5].c))) vyyerror("Unknown string option class '%s'", yyvsp[-5].c); @@ -3789,7 +3787,7 @@ case 145: ; break;} case 146: -#line 925 "Gmsh.y" +#line 923 "Gmsh.y" { if(!(pStrCat = Get_StringOptionCategory(yyvsp[-8].c))) vyyerror("Unknown string option class '%s'", yyvsp[-8].c); @@ -3802,7 +3800,7 @@ case 146: ; break;} case 147: -#line 939 "Gmsh.y" +#line 937 "Gmsh.y" { if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-5].c))) vyyerror("Unknown numeric option class '%s'", yyvsp[-5].c); @@ -3826,7 +3824,7 @@ case 147: ; break;} case 148: -#line 962 "Gmsh.y" +#line 960 "Gmsh.y" { if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-8].c))) vyyerror("Unknown numeric option class '%s'", yyvsp[-8].c); @@ -3851,7 +3849,7 @@ case 148: ; break;} case 149: -#line 986 "Gmsh.y" +#line 984 "Gmsh.y" { if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-4].c))) vyyerror("Unknown numeric option class '%s'", yyvsp[-4].c); @@ -3864,7 +3862,7 @@ case 149: ; break;} case 150: -#line 998 "Gmsh.y" +#line 996 "Gmsh.y" { if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-7].c))) vyyerror("Unknown numeric option class '%s'", yyvsp[-7].c); @@ -3877,7 +3875,7 @@ case 150: ; break;} case 151: -#line 1012 "Gmsh.y" +#line 1010 "Gmsh.y" { if(!(pColCat = Get_ColorOptionCategory(yyvsp[-7].c))) vyyerror("Unknown color option class '%s'", yyvsp[-7].c); @@ -3890,7 +3888,7 @@ case 151: ; break;} case 152: -#line 1024 "Gmsh.y" +#line 1022 "Gmsh.y" { if(!(pColCat = Get_ColorOptionCategory(yyvsp[-10].c))) vyyerror("Unknown color option class '%s'", yyvsp[-10].c); @@ -3903,7 +3901,7 @@ case 152: ; break;} case 153: -#line 1038 "Gmsh.y" +#line 1036 "Gmsh.y" { ColorTable *ct = Get_ColorTable(0); if(!ct) @@ -3920,7 +3918,7 @@ case 153: ; break;} case 154: -#line 1054 "Gmsh.y" +#line 1052 "Gmsh.y" { ColorTable *ct = Get_ColorTable((int)yyvsp[-6].d); if(!ct) @@ -3937,7 +3935,7 @@ case 154: ; break;} case 155: -#line 1070 "Gmsh.y" +#line 1068 "Gmsh.y" { #ifndef _NOPLUGIN try @@ -3952,7 +3950,7 @@ case 155: ; break;} case 156: -#line 1083 "Gmsh.y" +#line 1081 "Gmsh.y" { #ifndef _NOPLUGIN try @@ -3967,7 +3965,7 @@ case 156: ; break;} case 157: -#line 1107 "Gmsh.y" +#line 1105 "Gmsh.y" { Cdbpts101((int)yyvsp[-4].d,yyvsp[-1].v[0],yyvsp[-1].v[1],yyvsp[-1].v[2],yyvsp[-1].v[3],yyvsp[-1].v[4]); yyval.s.Type = MSH_POINT; @@ -3975,7 +3973,7 @@ case 157: ; break;} case 158: -#line 1114 "Gmsh.y" +#line 1112 "Gmsh.y" { Cdbz101((int)yyvsp[-4].d,MSH_PHYSICAL_POINT,0,0,0,0,0,NULL,yyvsp[-1].l,NULL); yyval.s.Type = MSH_PHYSICAL_POINT; @@ -3983,7 +3981,7 @@ case 158: ; break;} case 159: -#line 1120 "Gmsh.y" +#line 1118 "Gmsh.y" { Vertex *v; Attractor *a; @@ -4004,7 +4002,7 @@ case 159: ; break;} case 160: -#line 1139 "Gmsh.y" +#line 1137 "Gmsh.y" { for(i=0;i<List_Nbr(yyvsp[-3].l);i++){ List_Read(yyvsp[-3].l,i,&d); @@ -4017,14 +4015,14 @@ case 160: ; break;} case 161: -#line 1150 "Gmsh.y" +#line 1148 "Gmsh.y" { yyval.s.Type = MSH_POINT; yyval.s.Num = (int)yyvsp[-2].d; ; break;} case 162: -#line 1158 "Gmsh.y" +#line 1156 "Gmsh.y" { Cdbseg101((int)yyvsp[-4].d,MSH_SEGM_LINE,1,yyvsp[-1].l,NULL,-1,-1,0.,1.,NULL,NULL,NULL); yyval.s.Type = MSH_SEGM_LINE; @@ -4032,7 +4030,7 @@ case 162: ; break;} case 163: -#line 1164 "Gmsh.y" +#line 1162 "Gmsh.y" { Cdbseg101((int)yyvsp[-4].d,MSH_SEGM_SPLN,3,yyvsp[-1].l,NULL,-1,-1,0.,1.,NULL,NULL,NULL); yyval.s.Type = MSH_SEGM_SPLN; @@ -4040,7 +4038,7 @@ case 163: ; break;} case 164: -#line 1170 "Gmsh.y" +#line 1168 "Gmsh.y" { Curve *c; Attractor *a; @@ -4061,7 +4059,7 @@ case 164: ; break;} case 165: -#line 1189 "Gmsh.y" +#line 1187 "Gmsh.y" { Cdbseg101((int)yyvsp[-4].d,MSH_SEGM_CIRC,2,yyvsp[-1].l,NULL,-1,-1,0.,1.,NULL,NULL,NULL); yyval.s.Type = MSH_SEGM_CIRC ; @@ -4069,7 +4067,7 @@ case 165: ; break;} case 166: -#line 1195 "Gmsh.y" +#line 1193 "Gmsh.y" { List_T *temp; int i,j; @@ -4087,7 +4085,7 @@ case 166: ; break;} case 167: -#line 1212 "Gmsh.y" +#line 1210 "Gmsh.y" { Cdbseg101((int)yyvsp[-14].d,MSH_SEGM_PARAMETRIC,2,NULL,NULL,-1,-1,yyvsp[-10].d,yyvsp[-8].d,yyvsp[-6].c,yyvsp[-4].c,yyvsp[-2].c); yyval.s.Type = MSH_SEGM_PARAMETRIC ; @@ -4095,7 +4093,7 @@ case 167: ; break;} case 168: -#line 1218 "Gmsh.y" +#line 1216 "Gmsh.y" { Cdbseg101((int)yyvsp[-4].d,MSH_SEGM_ELLI,2,yyvsp[-1].l,NULL,-1,-1,0.,1.,NULL,NULL,NULL); yyval.s.Type = MSH_SEGM_ELLI ; @@ -4103,7 +4101,7 @@ case 168: ; break;} case 169: -#line 1224 "Gmsh.y" +#line 1222 "Gmsh.y" { Cdbz101((int)yyvsp[-4].d,MSH_PHYSICAL_LINE,0,0,0,0,0,NULL,yyvsp[-1].l,NULL); yyval.s.Type = MSH_PHYSICAL_LINE; @@ -4111,7 +4109,7 @@ case 169: ; break;} case 170: -#line 1230 "Gmsh.y" +#line 1228 "Gmsh.y" { yyval.s.Type = MSH_SEGM_LOOP; Cdbz101((int)yyvsp[-4].d,yyval.s.Type,0,0,0,0,0,NULL,yyvsp[-1].l,NULL); @@ -4119,7 +4117,7 @@ case 170: ; break;} case 171: -#line 1236 "Gmsh.y" +#line 1234 "Gmsh.y" { Cdbseg101((int)yyvsp[-4].d,MSH_SEGM_BSPLN,2,yyvsp[-1].l,NULL,-1,-1,0.,1.,NULL,NULL,NULL); yyval.s.Type = MSH_SEGM_BSPLN; @@ -4127,7 +4125,7 @@ case 171: ; break;} case 172: -#line 1242 "Gmsh.y" +#line 1240 "Gmsh.y" { List_T *Temp; int i; @@ -4148,7 +4146,7 @@ case 172: ; break;} case 173: -#line 1261 "Gmsh.y" +#line 1259 "Gmsh.y" { yyval.s.Num = (int)yyvsp[-2].d; Curve *c = FindCurve(yyval.s.Num,THEM); @@ -4159,7 +4157,7 @@ case 173: ; break;} case 174: -#line 1273 "Gmsh.y" +#line 1271 "Gmsh.y" { Cdbz101((int)yyvsp[-4].d,MSH_SURF_PLAN,0,0,0,0,0,NULL,yyvsp[-1].l,NULL); yyval.s.Type = MSH_SURF_PLAN; @@ -4167,7 +4165,7 @@ case 174: ; break;} case 175: -#line 1279 "Gmsh.y" +#line 1277 "Gmsh.y" { Surface *s,*support; support = FindSurface((int)yyvsp[-4].d,THEM); @@ -4188,7 +4186,7 @@ case 175: ; break;} case 176: -#line 1298 "Gmsh.y" +#line 1296 "Gmsh.y" { List_Read(yyvsp[-1].l,0,&d); i = (int)d; @@ -4211,7 +4209,7 @@ case 176: ; break;} case 177: -#line 1321 "Gmsh.y" +#line 1319 "Gmsh.y" { CreateNurbsSurface ( (int) yyvsp[-16].d , (int)yyvsp[-4].d , (int)yyvsp[-2].d , yyvsp[-13].l, yyvsp[-10].l, yyvsp[-8].l); yyval.s.Type = MSH_SURF_NURBS; @@ -4219,13 +4217,13 @@ case 177: ; break;} case 178: -#line 1329 "Gmsh.y" +#line 1327 "Gmsh.y" { CreateNurbsSurfaceSupport ((int)yyvsp[-16].d, (int) yyvsp[-4].d , (int) yyvsp[-2].d , yyvsp[-13].l, yyvsp[-10].l, yyvsp[-8].l); ; break;} case 179: -#line 1333 "Gmsh.y" +#line 1331 "Gmsh.y" { Cdbz101((int)yyvsp[-4].d,MSH_PHYSICAL_SURFACE,0,0,0,0,0,NULL,yyvsp[-1].l,NULL); yyval.s.Type = MSH_PHYSICAL_SURFACE; @@ -4233,7 +4231,7 @@ case 179: ; break;} case 180: -#line 1339 "Gmsh.y" +#line 1337 "Gmsh.y" { Cdbz101((int)yyvsp[-4].d,MSH_SURF_LOOP,0,0,0,0,0,NULL,yyvsp[-1].l,NULL); yyval.s.Type = MSH_SURF_LOOP; @@ -4241,7 +4239,7 @@ case 180: ; break;} case 181: -#line 1345 "Gmsh.y" +#line 1343 "Gmsh.y" { yyval.s.Num = (int)yyvsp[-2].d; Surface *s = FindSurface(yyval.s.Num,THEM); @@ -4252,7 +4250,7 @@ case 181: ; break;} case 182: -#line 1357 "Gmsh.y" +#line 1355 "Gmsh.y" { Cdbz101((int)yyvsp[-4].d,MSH_VOLUME,0,0,0,0,0,NULL,yyvsp[-1].l,NULL); yyval.s.Type = MSH_VOLUME; @@ -4260,7 +4258,7 @@ case 182: ; break;} case 183: -#line 1363 "Gmsh.y" +#line 1361 "Gmsh.y" { Cdbz101((int)yyvsp[-4].d,MSH_VOLUME,0,0,0,0,0,NULL,yyvsp[-1].l,NULL); yyval.s.Type = MSH_VOLUME; @@ -4268,7 +4266,7 @@ case 183: ; break;} case 184: -#line 1369 "Gmsh.y" +#line 1367 "Gmsh.y" { Cdbz101((int)yyvsp[-4].d,MSH_PHYSICAL_VOLUME,0,0,0,0,0,NULL,yyvsp[-1].l,NULL); yyval.s.Type = MSH_PHYSICAL_VOLUME; @@ -4276,60 +4274,60 @@ case 184: ; break;} case 185: -#line 1382 "Gmsh.y" +#line 1380 "Gmsh.y" { TranslateShapes (yyvsp[-3].v[0],yyvsp[-3].v[1],yyvsp[-3].v[2],yyvsp[-1].l,1); yyval.l = yyvsp[-1].l; ; break;} case 186: -#line 1387 "Gmsh.y" +#line 1385 "Gmsh.y" { RotateShapes(yyvsp[-8].v[0],yyvsp[-8].v[1],yyvsp[-8].v[2],yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].d,yyvsp[-1].l); yyval.l = yyvsp[-1].l; ; break;} case 187: -#line 1392 "Gmsh.y" +#line 1390 "Gmsh.y" { SymmetryShapes(yyvsp[-3].v[0],yyvsp[-3].v[1],yyvsp[-3].v[2],yyvsp[-3].v[3],yyvsp[-1].l,1); yyval.l = yyvsp[-1].l; ; break;} case 188: -#line 1397 "Gmsh.y" +#line 1395 "Gmsh.y" { DilatShapes(yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].d,yyvsp[-1].l,1); yyval.l = yyvsp[-1].l; ; break;} case 189: -#line 1404 "Gmsh.y" +#line 1402 "Gmsh.y" { yyval.l = yyvsp[0].l; ; break;} case 190: -#line 1405 "Gmsh.y" +#line 1403 "Gmsh.y" { yyval.l = yyvsp[0].l; ; break;} case 191: -#line 1406 "Gmsh.y" +#line 1404 "Gmsh.y" { yyval.l = yyvsp[0].l; ; break;} case 192: -#line 1411 "Gmsh.y" +#line 1409 "Gmsh.y" { yyval.l = List_Create(3,3,sizeof(Shape)); ; break;} case 193: -#line 1415 "Gmsh.y" +#line 1413 "Gmsh.y" { List_Add(yyval.l,&yyvsp[0].s); yyval.l = yyvsp[-1].l; ; break;} case 194: -#line 1427 "Gmsh.y" +#line 1425 "Gmsh.y" { yyval.l = List_Create(3,3,sizeof(Shape)); for(i=0;i<List_Nbr(yyvsp[-1].l);i++){ @@ -4341,7 +4339,7 @@ case 194: ; break;} case 195: -#line 1445 "Gmsh.y" +#line 1443 "Gmsh.y" { for(i=0;i<List_Nbr(yyvsp[-1].l);i++){ List_Read (yyvsp[-1].l,i,&TheShape); @@ -4350,20 +4348,20 @@ case 195: ; break;} case 196: -#line 1452 "Gmsh.y" +#line 1450 "Gmsh.y" { if(!strcmp(yyvsp[-4].c, "View")) FreeView((int)yyvsp[-2].d); ; break;} case 197: -#line 1457 "Gmsh.y" +#line 1455 "Gmsh.y" { Init_Mesh(THEM, 1); ; break;} case 198: -#line 1469 "Gmsh.y" +#line 1467 "Gmsh.y" { if(!strcmp(yyvsp[-2].c, "Include")){ @@ -4432,7 +4430,7 @@ case 198: ; break;} case 199: -#line 1536 "Gmsh.y" +#line 1534 "Gmsh.y" { if(!strcmp(yyvsp[-2].c, "Sleep")){ @@ -4454,7 +4452,7 @@ case 199: ; break;} case 200: -#line 1556 "Gmsh.y" +#line 1554 "Gmsh.y" { #ifndef _NOPLUGIN GMSH_PluginManager::Instance()->Action(yyvsp[-4].c,yyvsp[-1].c,0); @@ -4462,13 +4460,13 @@ case 200: ; break;} case 201: -#line 1562 "Gmsh.y" +#line 1560 "Gmsh.y" { exit(0); ; break;} case 202: -#line 1566 "Gmsh.y" +#line 1564 "Gmsh.y" { if(!CTX.batch){ // we're in interactive mode if(Tree_Nbr(THEM->Points) != Last_NumberOfPoints){ @@ -4484,7 +4482,7 @@ case 202: ; break;} case 203: -#line 1588 "Gmsh.y" +#line 1586 "Gmsh.y" { FILE* ff; if(RecursionLevel) @@ -4500,7 +4498,7 @@ case 203: ; break;} case 204: -#line 1602 "Gmsh.y" +#line 1600 "Gmsh.y" { FILE* ff; if(RecursionLevel) @@ -4516,7 +4514,7 @@ case 204: ; break;} case 205: -#line 1616 "Gmsh.y" +#line 1614 "Gmsh.y" { FILE* ff; if(RecursionLevel) @@ -4543,7 +4541,7 @@ case 205: ; break;} case 206: -#line 1641 "Gmsh.y" +#line 1639 "Gmsh.y" { FILE* ff; if(RecursionLevel) @@ -4570,7 +4568,7 @@ case 206: ; break;} case 207: -#line 1666 "Gmsh.y" +#line 1664 "Gmsh.y" { if(LoopControlVariablesTab[ImbricatedLoop-1][1] > LoopControlVariablesTab[ImbricatedLoop-1][0]){ @@ -4598,7 +4596,7 @@ case 207: ; break;} case 208: -#line 1692 "Gmsh.y" +#line 1690 "Gmsh.y" { if(!FunctionManager::Instance()->createFunction(yyvsp[0].c,yyin,yylineno)) vyyerror("Redefinition of function %s",yyvsp[0].c); @@ -4606,39 +4604,39 @@ case 208: ; break;} case 209: -#line 1698 "Gmsh.y" +#line 1696 "Gmsh.y" { if(!FunctionManager::Instance()->leaveFunction(&yyin,yylineno)) vyyerror("Error while exiting function"); ; break;} case 210: -#line 1703 "Gmsh.y" +#line 1701 "Gmsh.y" { if(!FunctionManager::Instance()->enterFunction(yyvsp[-1].c,&yyin,yylineno)) vyyerror("Unknown function %s",yyvsp[-1].c); ; break;} case 211: -#line 1708 "Gmsh.y" +#line 1706 "Gmsh.y" { if(!yyvsp[-1].d) skip_until("If", "EndIf"); ; break;} case 212: -#line 1712 "Gmsh.y" +#line 1710 "Gmsh.y" { ; break;} case 213: -#line 1723 "Gmsh.y" +#line 1721 "Gmsh.y" { Curve *pc, *prc; Extrude_ProtudePoint(1,(int)yyvsp[-4].d,yyvsp[-2].v[0],yyvsp[-2].v[1],yyvsp[-2].v[2],0.,0.,0.,0.,&pc,&prc,NULL); ; break;} case 214: -#line 1728 "Gmsh.y" +#line 1726 "Gmsh.y" { Curve *pc, *prc; Extrude_ProtudePoint(0,(int)yyvsp[-8].d,yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].v[0],yyvsp[-4].v[1],yyvsp[-4].v[2],yyvsp[-2].d, @@ -4646,69 +4644,69 @@ case 214: ; break;} case 215: -#line 1734 "Gmsh.y" +#line 1732 "Gmsh.y" { Extrude_ProtudeCurve(1,(int)yyvsp[-4].d,yyvsp[-2].v[0],yyvsp[-2].v[1],yyvsp[-2].v[2],0.,0.,0.,0.,NULL); ; break;} case 216: -#line 1738 "Gmsh.y" +#line 1736 "Gmsh.y" { Extrude_ProtudeCurve(0,(int)yyvsp[-8].d,yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].v[0],yyvsp[-4].v[1],yyvsp[-4].v[2],yyvsp[-2].d,NULL); ; break;} case 217: -#line 1742 "Gmsh.y" +#line 1740 "Gmsh.y" { Extrude_ProtudeSurface(1,(int)yyvsp[-4].d,yyvsp[-2].v[0],yyvsp[-2].v[1],yyvsp[-2].v[2],0.,0.,0.,0.,0,NULL); ; break;} case 218: -#line 1746 "Gmsh.y" +#line 1744 "Gmsh.y" { Extrude_ProtudeSurface(0,(int)yyvsp[-8].d,yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].v[0],yyvsp[-4].v[1],yyvsp[-4].v[2],yyvsp[-2].d,0,NULL); ; break;} case 219: -#line 1750 "Gmsh.y" +#line 1748 "Gmsh.y" { extr.mesh.ExtrudeMesh = false; extr.mesh.Recombine = false; ; break;} case 220: -#line 1755 "Gmsh.y" +#line 1753 "Gmsh.y" { int vol = NEWREG(); Extrude_ProtudeSurface(1,(int)yyvsp[-8].d,yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],0.,0.,0.,0.,vol,&extr); ; break;} case 221: -#line 1760 "Gmsh.y" +#line 1758 "Gmsh.y" { extr.mesh.ExtrudeMesh = false; extr.mesh.Recombine = false; ; break;} case 222: -#line 1766 "Gmsh.y" +#line 1764 "Gmsh.y" { int vol = NEWREG(); Extrude_ProtudeSurface(0,(int)yyvsp[-12].d,yyvsp[-10].v[0],yyvsp[-10].v[1],yyvsp[-10].v[2],yyvsp[-8].v[0],yyvsp[-8].v[1],yyvsp[-8].v[2],yyvsp[-6].d,vol,&extr); ; break;} case 223: -#line 1774 "Gmsh.y" +#line 1772 "Gmsh.y" { ; break;} case 224: -#line 1777 "Gmsh.y" +#line 1775 "Gmsh.y" { ; break;} case 225: -#line 1783 "Gmsh.y" +#line 1781 "Gmsh.y" { double d; int j; @@ -4730,13 +4728,13 @@ case 225: ; break;} case 226: -#line 1803 "Gmsh.y" +#line 1801 "Gmsh.y" { extr.mesh.Recombine = true; ; break;} case 227: -#line 1814 "Gmsh.y" +#line 1812 "Gmsh.y" { Curve *c; for(i=0;i<List_Nbr(yyvsp[-3].l);i++){ @@ -4756,7 +4754,7 @@ case 227: ; break;} case 228: -#line 1832 "Gmsh.y" +#line 1830 "Gmsh.y" { Curve *c; for(i=0;i<List_Nbr(yyvsp[-6].l);i++){ @@ -4776,7 +4774,7 @@ case 228: ; break;} case 229: -#line 1850 "Gmsh.y" +#line 1848 "Gmsh.y" { Curve *c; for(i=0;i<List_Nbr(yyvsp[-6].l);i++){ @@ -4796,7 +4794,7 @@ case 229: ; break;} case 230: -#line 1868 "Gmsh.y" +#line 1866 "Gmsh.y" { Surface *s = FindSurface((int)yyvsp[-4].d,THEM); if(!s) @@ -4820,7 +4818,7 @@ case 230: ; break;} case 231: -#line 1890 "Gmsh.y" +#line 1888 "Gmsh.y" { Surface *s = FindSurface((int)yyvsp[-4].d,THEM); if(!s) @@ -4843,7 +4841,7 @@ case 231: ; break;} case 232: -#line 1911 "Gmsh.y" +#line 1909 "Gmsh.y" { Volume *v = FindVolume((int)yyvsp[-4].d,THEM); if(!v) @@ -4866,7 +4864,7 @@ case 232: ; break;} case 233: -#line 1932 "Gmsh.y" +#line 1930 "Gmsh.y" { Surface *s; for(i=0;i<List_Nbr(yyvsp[-3].l);i++){ @@ -4882,7 +4880,7 @@ case 233: ; break;} case 234: -#line 1946 "Gmsh.y" +#line 1944 "Gmsh.y" { Surface *s; for(i=0;i<List_Nbr(yyvsp[-1].l);i++){ @@ -4898,71 +4896,71 @@ case 234: ; break;} case 235: -#line 1968 "Gmsh.y" +#line 1966 "Gmsh.y" { Coherence_PS(); ; break;} case 236: -#line 1972 "Gmsh.y" +#line 1970 "Gmsh.y" { IntersectAllSegmentsTogether(); ; break;} case 237: -#line 1983 "Gmsh.y" +#line 1981 "Gmsh.y" {yyval.i = 1;; break;} case 238: -#line 1984 "Gmsh.y" +#line 1982 "Gmsh.y" {yyval.i = 0;; break;} case 239: -#line 1985 "Gmsh.y" +#line 1983 "Gmsh.y" {yyval.i = -1;; break;} case 240: -#line 1986 "Gmsh.y" +#line 1984 "Gmsh.y" {yyval.i = -1;; break;} case 241: -#line 1987 "Gmsh.y" +#line 1985 "Gmsh.y" {yyval.i = -1;; break;} case 242: -#line 1991 "Gmsh.y" +#line 1989 "Gmsh.y" { yyval.d = yyvsp[0].d; ; break;} case 243: -#line 1992 "Gmsh.y" +#line 1990 "Gmsh.y" { yyval.d = yyvsp[-1].d ; ; break;} case 244: -#line 1993 "Gmsh.y" +#line 1991 "Gmsh.y" { yyval.d = -yyvsp[0].d ; ; break;} case 245: -#line 1994 "Gmsh.y" +#line 1992 "Gmsh.y" { yyval.d = yyvsp[0].d; ; break;} case 246: -#line 1995 "Gmsh.y" +#line 1993 "Gmsh.y" { yyval.d = !yyvsp[0].d ; ; break;} case 247: -#line 1996 "Gmsh.y" +#line 1994 "Gmsh.y" { yyval.d = yyvsp[-2].d - yyvsp[0].d ; ; break;} case 248: -#line 1997 "Gmsh.y" +#line 1995 "Gmsh.y" { yyval.d = yyvsp[-2].d + yyvsp[0].d ; ; break;} case 249: -#line 1998 "Gmsh.y" +#line 1996 "Gmsh.y" { yyval.d = yyvsp[-2].d * yyvsp[0].d ; ; break;} case 250: -#line 2000 "Gmsh.y" +#line 1998 "Gmsh.y" { if(!yyvsp[0].d) vyyerror("Division by zero in '%g / %g'", yyvsp[-2].d, yyvsp[0].d); @@ -4971,151 +4969,151 @@ case 250: ; break;} case 251: -#line 2006 "Gmsh.y" +#line 2004 "Gmsh.y" { yyval.d = (int)yyvsp[-2].d % (int)yyvsp[0].d ; ; break;} case 252: -#line 2007 "Gmsh.y" +#line 2005 "Gmsh.y" { yyval.d = pow(yyvsp[-2].d,yyvsp[0].d) ; ; break;} case 253: -#line 2008 "Gmsh.y" +#line 2006 "Gmsh.y" { yyval.d = yyvsp[-2].d < yyvsp[0].d ; ; break;} case 254: -#line 2009 "Gmsh.y" +#line 2007 "Gmsh.y" { yyval.d = yyvsp[-2].d > yyvsp[0].d ; ; break;} case 255: -#line 2010 "Gmsh.y" +#line 2008 "Gmsh.y" { yyval.d = yyvsp[-2].d <= yyvsp[0].d ; ; break;} case 256: -#line 2011 "Gmsh.y" +#line 2009 "Gmsh.y" { yyval.d = yyvsp[-2].d >= yyvsp[0].d ; ; break;} case 257: -#line 2012 "Gmsh.y" +#line 2010 "Gmsh.y" { yyval.d = yyvsp[-2].d == yyvsp[0].d ; ; break;} case 258: -#line 2013 "Gmsh.y" +#line 2011 "Gmsh.y" { yyval.d = yyvsp[-2].d != yyvsp[0].d ; ; break;} case 259: -#line 2014 "Gmsh.y" +#line 2012 "Gmsh.y" { yyval.d = yyvsp[-2].d && yyvsp[0].d ; ; break;} case 260: -#line 2015 "Gmsh.y" +#line 2013 "Gmsh.y" { yyval.d = yyvsp[-2].d || yyvsp[0].d ; ; break;} case 261: -#line 2016 "Gmsh.y" +#line 2014 "Gmsh.y" { yyval.d = yyvsp[-4].d? yyvsp[-2].d : yyvsp[0].d ; ; break;} case 262: -#line 2017 "Gmsh.y" +#line 2015 "Gmsh.y" { yyval.d = exp(yyvsp[-1].d); ; break;} case 263: -#line 2018 "Gmsh.y" +#line 2016 "Gmsh.y" { yyval.d = log(yyvsp[-1].d); ; break;} case 264: -#line 2019 "Gmsh.y" +#line 2017 "Gmsh.y" { yyval.d = log10(yyvsp[-1].d); ; break;} case 265: -#line 2020 "Gmsh.y" +#line 2018 "Gmsh.y" { yyval.d = sqrt(yyvsp[-1].d); ; break;} case 266: -#line 2021 "Gmsh.y" +#line 2019 "Gmsh.y" { yyval.d = sin(yyvsp[-1].d); ; break;} case 267: -#line 2022 "Gmsh.y" +#line 2020 "Gmsh.y" { yyval.d = asin(yyvsp[-1].d); ; break;} case 268: -#line 2023 "Gmsh.y" +#line 2021 "Gmsh.y" { yyval.d = cos(yyvsp[-1].d); ; break;} case 269: -#line 2024 "Gmsh.y" +#line 2022 "Gmsh.y" { yyval.d = acos(yyvsp[-1].d); ; break;} case 270: -#line 2025 "Gmsh.y" +#line 2023 "Gmsh.y" { yyval.d = tan(yyvsp[-1].d); ; break;} case 271: -#line 2026 "Gmsh.y" +#line 2024 "Gmsh.y" { yyval.d = atan(yyvsp[-1].d); ; break;} case 272: -#line 2027 "Gmsh.y" +#line 2025 "Gmsh.y" { yyval.d = atan2(yyvsp[-3].d,yyvsp[-1].d); ; break;} case 273: -#line 2028 "Gmsh.y" +#line 2026 "Gmsh.y" { yyval.d = sinh(yyvsp[-1].d); ; break;} case 274: -#line 2029 "Gmsh.y" +#line 2027 "Gmsh.y" { yyval.d = cosh(yyvsp[-1].d); ; break;} case 275: -#line 2030 "Gmsh.y" +#line 2028 "Gmsh.y" { yyval.d = tanh(yyvsp[-1].d); ; break;} case 276: -#line 2031 "Gmsh.y" +#line 2029 "Gmsh.y" { yyval.d = fabs(yyvsp[-1].d); ; break;} case 277: -#line 2032 "Gmsh.y" +#line 2030 "Gmsh.y" { yyval.d = floor(yyvsp[-1].d); ; break;} case 278: -#line 2033 "Gmsh.y" +#line 2031 "Gmsh.y" { yyval.d = ceil(yyvsp[-1].d); ; break;} case 279: -#line 2034 "Gmsh.y" +#line 2032 "Gmsh.y" { yyval.d = fmod(yyvsp[-3].d,yyvsp[-1].d); ; break;} case 280: -#line 2035 "Gmsh.y" +#line 2033 "Gmsh.y" { yyval.d = fmod(yyvsp[-3].d,yyvsp[-1].d); ; break;} case 281: -#line 2036 "Gmsh.y" +#line 2034 "Gmsh.y" { yyval.d = sqrt(yyvsp[-3].d*yyvsp[-3].d+yyvsp[-1].d*yyvsp[-1].d); ; break;} case 282: -#line 2037 "Gmsh.y" +#line 2035 "Gmsh.y" { yyval.d = yyvsp[-1].d*(double)rand()/(double)RAND_MAX; ; break;} case 283: -#line 2046 "Gmsh.y" +#line 2044 "Gmsh.y" { yyval.d = yyvsp[0].d; ; break;} case 284: -#line 2047 "Gmsh.y" +#line 2045 "Gmsh.y" { yyval.d = 3.141592653589793; ; break;} case 285: -#line 2048 "Gmsh.y" +#line 2046 "Gmsh.y" { yyval.d = ParUtil::Instance()->rank(); ; break;} case 286: -#line 2049 "Gmsh.y" +#line 2047 "Gmsh.y" { yyval.d = ParUtil::Instance()->size(); ; break;} case 287: -#line 2054 "Gmsh.y" +#line 2052 "Gmsh.y" { TheSymbol.Name = yyvsp[0].c ; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) { @@ -5127,7 +5125,7 @@ case 287: ; break;} case 288: -#line 2065 "Gmsh.y" +#line 2063 "Gmsh.y" { TheSymbol.Name = yyvsp[-3].c ; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) { @@ -5145,7 +5143,7 @@ case 288: ; break;} case 289: -#line 2082 "Gmsh.y" +#line 2080 "Gmsh.y" { TheSymbol.Name = yyvsp[-1].c ; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) { @@ -5157,7 +5155,7 @@ case 289: ; break;} case 290: -#line 2093 "Gmsh.y" +#line 2091 "Gmsh.y" { TheSymbol.Name = yyvsp[-4].c ; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) { @@ -5175,7 +5173,7 @@ case 290: ; break;} case 291: -#line 2112 "Gmsh.y" +#line 2110 "Gmsh.y" { if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-2].c))){ vyyerror("Unknown numeric option class '%s'", yyvsp[-2].c); @@ -5192,7 +5190,7 @@ case 291: ; break;} case 292: -#line 2128 "Gmsh.y" +#line 2126 "Gmsh.y" { if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-5].c))){ vyyerror("Unknown numeric option class '%s'", yyvsp[-5].c); @@ -5209,7 +5207,7 @@ case 292: ; break;} case 293: -#line 2144 "Gmsh.y" +#line 2142 "Gmsh.y" { if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-3].c))){ vyyerror("Unknown numeric option class '%s'", yyvsp[-3].c); @@ -5226,7 +5224,7 @@ case 293: ; break;} case 294: -#line 2160 "Gmsh.y" +#line 2158 "Gmsh.y" { if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-6].c))){ vyyerror("Unknown numeric option class '%s'", yyvsp[-6].c); @@ -5243,130 +5241,130 @@ case 294: ; break;} case 295: -#line 2178 "Gmsh.y" +#line 2176 "Gmsh.y" { memcpy(yyval.v, yyvsp[0].v, 5*sizeof(double)) ; ; break;} case 296: -#line 2182 "Gmsh.y" +#line 2180 "Gmsh.y" { for(i=0 ; i<5 ; i++) yyval.v[i] = -yyvsp[0].v[i] ; ; break;} case 297: -#line 2186 "Gmsh.y" +#line 2184 "Gmsh.y" { for(i=0 ; i<5 ; i++) yyval.v[i] = yyvsp[0].v[i]; ; break;} case 298: -#line 2190 "Gmsh.y" +#line 2188 "Gmsh.y" { for(i=0 ; i<5 ; i++) yyval.v[i] = yyvsp[-2].v[i] - yyvsp[0].v[i] ; ; break;} case 299: -#line 2194 "Gmsh.y" +#line 2192 "Gmsh.y" { for(i=0 ; i<5 ; i++) yyval.v[i] = yyvsp[-2].v[i] + yyvsp[0].v[i] ; ; break;} case 300: -#line 2200 "Gmsh.y" +#line 2198 "Gmsh.y" { yyval.v[0]=yyvsp[-9].d; yyval.v[1]=yyvsp[-7].d; yyval.v[2]=yyvsp[-5].d; yyval.v[3]=yyvsp[-3].d; yyval.v[4]=yyvsp[-1].d; ; break;} case 301: -#line 2204 "Gmsh.y" +#line 2202 "Gmsh.y" { yyval.v[0]=yyvsp[-7].d; yyval.v[1]=yyvsp[-5].d; yyval.v[2]=yyvsp[-3].d; yyval.v[3]=yyvsp[-1].d; yyval.v[4]=1.0; ; break;} case 302: -#line 2208 "Gmsh.y" +#line 2206 "Gmsh.y" { yyval.v[0]=yyvsp[-5].d; yyval.v[1]=yyvsp[-3].d; yyval.v[2]=yyvsp[-1].d; yyval.v[3]=0.0; yyval.v[4]=1.0; ; break;} case 303: -#line 2212 "Gmsh.y" +#line 2210 "Gmsh.y" { yyval.v[0]=yyvsp[-5].d; yyval.v[1]=yyvsp[-3].d; yyval.v[2]=yyvsp[-1].d; yyval.v[3]=0.0; yyval.v[4]=1.0; ; break;} case 304: -#line 2219 "Gmsh.y" +#line 2217 "Gmsh.y" { ; break;} case 305: -#line 2222 "Gmsh.y" +#line 2220 "Gmsh.y" { ; break;} case 306: -#line 2228 "Gmsh.y" +#line 2226 "Gmsh.y" { ; break;} case 307: -#line 2231 "Gmsh.y" +#line 2229 "Gmsh.y" { ; break;} case 308: -#line 2237 "Gmsh.y" +#line 2235 "Gmsh.y" { ; break;} case 309: -#line 2240 "Gmsh.y" +#line 2238 "Gmsh.y" { yyval.l=yyvsp[-1].l; ; break;} case 310: -#line 2244 "Gmsh.y" +#line 2242 "Gmsh.y" { yyval.l=yyvsp[-1].l; ; break;} case 311: -#line 2251 "Gmsh.y" +#line 2249 "Gmsh.y" { yyval.l = List_Create(2,1,sizeof(List_T*)) ; List_Add(yyval.l, &(yyvsp[0].l)) ; ; break;} case 312: -#line 2256 "Gmsh.y" +#line 2254 "Gmsh.y" { List_Add(yyval.l, &(yyvsp[0].l)) ; ; break;} case 313: -#line 2264 "Gmsh.y" +#line 2262 "Gmsh.y" { yyval.l = List_Create(2,1,sizeof(double)) ; List_Add(yyval.l, &(yyvsp[0].d)) ; ; break;} case 314: -#line 2269 "Gmsh.y" +#line 2267 "Gmsh.y" { yyval.l = yyvsp[0].l ; ; break;} case 315: -#line 2273 "Gmsh.y" +#line 2271 "Gmsh.y" { yyval.l=yyvsp[-1].l; ; break;} case 316: -#line 2277 "Gmsh.y" +#line 2275 "Gmsh.y" { yyval.l=yyvsp[-1].l; for(i=0 ; i<List_Nbr(yyval.l) ; i++){ @@ -5376,7 +5374,7 @@ case 316: ; break;} case 317: -#line 2288 "Gmsh.y" +#line 2286 "Gmsh.y" { yyval.l = List_Create(2,1,sizeof(double)) ; for(d=yyvsp[-2].d ; (yyvsp[-2].d<yyvsp[0].d)?(d<=yyvsp[0].d):(d>=yyvsp[0].d) ; (yyvsp[-2].d<yyvsp[0].d)?(d+=1.):(d-=1.)) @@ -5384,7 +5382,7 @@ case 317: ; break;} case 318: -#line 2294 "Gmsh.y" +#line 2292 "Gmsh.y" { yyval.l = List_Create(2,1,sizeof(double)) ; if(!yyvsp[0].d || (yyvsp[-4].d<yyvsp[-2].d && yyvsp[0].d<0) || (yyvsp[-4].d>yyvsp[-2].d && yyvsp[0].d>0)){ @@ -5397,7 +5395,7 @@ case 318: ; break;} case 319: -#line 2305 "Gmsh.y" +#line 2303 "Gmsh.y" { yyval.l = List_Create(2,1,sizeof(double)) ; TheSymbol.Name = yyvsp[-2].c ; @@ -5413,7 +5411,7 @@ case 319: ; break;} case 320: -#line 2319 "Gmsh.y" +#line 2317 "Gmsh.y" { yyval.l = List_Create(2,1,sizeof(double)) ; TheSymbol.Name = yyvsp[-2].c ; @@ -5431,7 +5429,7 @@ case 320: ; break;} case 321: -#line 2335 "Gmsh.y" +#line 2333 "Gmsh.y" { yyval.l = List_Create(2,1,sizeof(double)) ; TheSymbol.Name = yyvsp[-5].c ; @@ -5453,7 +5451,7 @@ case 321: ; break;} case 322: -#line 2355 "Gmsh.y" +#line 2353 "Gmsh.y" { yyval.l = List_Create(2,1,sizeof(double)) ; TheSymbol.Name = yyvsp[-5].c ; @@ -5477,26 +5475,26 @@ case 322: ; break;} case 323: -#line 2380 "Gmsh.y" +#line 2378 "Gmsh.y" { yyval.l = List_Create(2,1,sizeof(double)) ; List_Add(yyval.l, &(yyvsp[0].d)) ; ; break;} case 324: -#line 2385 "Gmsh.y" +#line 2383 "Gmsh.y" { yyval.l = yyvsp[0].l ; ; break;} case 325: -#line 2389 "Gmsh.y" +#line 2387 "Gmsh.y" { List_Add(yyval.l, &(yyvsp[0].d)) ; ; break;} case 326: -#line 2393 "Gmsh.y" +#line 2391 "Gmsh.y" { for(i=0 ; i<List_Nbr(yyvsp[0].l) ; i++){ List_Read(yyvsp[0].l, i, &d) ; @@ -5506,26 +5504,26 @@ case 326: ; break;} case 327: -#line 2405 "Gmsh.y" +#line 2403 "Gmsh.y" { yyval.u = PACK_COLOR((int)yyvsp[-7].d, (int)yyvsp[-5].d, (int)yyvsp[-3].d, (int)yyvsp[-1].d); ; break;} case 328: -#line 2409 "Gmsh.y" +#line 2407 "Gmsh.y" { yyval.u = PACK_COLOR((int)yyvsp[-5].d, (int)yyvsp[-3].d, (int)yyvsp[-1].d, 255); ; break;} case 329: -#line 2420 "Gmsh.y" +#line 2418 "Gmsh.y" { yyval.u = Get_ColorForString(ColorString, -1, yyvsp[0].c, &flag); if(flag) vyyerror("Unknown color '%s'", yyvsp[0].c); ; break;} case 330: -#line 2425 "Gmsh.y" +#line 2423 "Gmsh.y" { if(!(pColCat = Get_ColorOptionCategory(yyvsp[-4].c))){ vyyerror("Unknown color option class '%s'", yyvsp[-4].c); @@ -5543,13 +5541,13 @@ case 330: ; break;} case 331: -#line 2444 "Gmsh.y" +#line 2442 "Gmsh.y" { yyval.l = yyvsp[-1].l; ; break;} case 332: -#line 2448 "Gmsh.y" +#line 2446 "Gmsh.y" { yyval.l = List_Create(256,10,sizeof(unsigned int)) ; ColorTable *ct = Get_ColorTable((int)yyvsp[-3].d); @@ -5562,26 +5560,26 @@ case 332: ; break;} case 333: -#line 2462 "Gmsh.y" +#line 2460 "Gmsh.y" { yyval.l = List_Create(256,10,sizeof(unsigned int)) ; List_Add(yyval.l, &(yyvsp[0].u)) ; ; break;} case 334: -#line 2467 "Gmsh.y" +#line 2465 "Gmsh.y" { List_Add(yyval.l, &(yyvsp[0].u)) ; ; break;} case 335: -#line 2474 "Gmsh.y" +#line 2472 "Gmsh.y" { yyval.c = yyvsp[0].c; ; break;} case 336: -#line 2478 "Gmsh.y" +#line 2476 "Gmsh.y" { yyval.c = (char *)Malloc((strlen(yyvsp[-3].c)+strlen(yyvsp[-1].c)+1)*sizeof(char)) ; strcpy(yyval.c, yyvsp[-3].c) ; @@ -5591,7 +5589,7 @@ case 336: ; break;} case 337: -#line 2486 "Gmsh.y" +#line 2484 "Gmsh.y" { yyval.c = (char *)Malloc((strlen(yyvsp[-1].c)+1)*sizeof(char)) ; for(i=strlen(yyvsp[-1].c)-1; i>=0; i--){ @@ -5606,13 +5604,13 @@ case 337: ; break;} case 338: -#line 2499 "Gmsh.y" +#line 2497 "Gmsh.y" { yyval.c = yyvsp[-1].c; ; break;} case 339: -#line 2503 "Gmsh.y" +#line 2501 "Gmsh.y" { for(i = 0 ; i<List_Nbr(yyvsp[-1].l) ; i++){ if(!i){ @@ -5639,7 +5637,7 @@ case 339: ; break;} case 340: -#line 2528 "Gmsh.y" +#line 2526 "Gmsh.y" { if(!(pStrCat = Get_StringOptionCategory(yyvsp[-3].c))) vyyerror("Unknown string option class '%s'", yyvsp[-3].c); @@ -5655,7 +5653,7 @@ case 340: ; break;} case 341: -#line 2542 "Gmsh.y" +#line 2540 "Gmsh.y" { if(!(pStrCat = Get_StringOptionCategory(yyvsp[-6].c))) vyyerror("Unknown string option class '%s'", yyvsp[-6].c); @@ -5892,7 +5890,7 @@ yyerrhandle: } return 1; } -#line 2557 "Gmsh.y" +#line 2555 "Gmsh.y" void InitSymbols(void){ diff --git a/Parser/Gmsh.y b/Parser/Gmsh.y index 8d01c63dada8af8c54e1f13611d4fdc6a8800434..cd7fc5e6c0e42626df15ad5de47c7b1beabe3566 100644 --- a/Parser/Gmsh.y +++ b/Parser/Gmsh.y @@ -1,6 +1,6 @@ %{ -// $Id: Gmsh.y,v 1.90 2001-08-09 15:24:54 geuzaine Exp $ +// $Id: Gmsh.y,v 1.91 2001-08-11 23:28:33 geuzaine Exp $ // // Generaliser sprintf avec des chaines de caracteres @@ -12,7 +12,7 @@ #endif #include "ParUtil.h" #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Context.h" #include "Geo.h" #include "CAD.h" @@ -46,9 +46,9 @@ static int yylinenoTab[MAX_OPEN_FILES]; static fpos_t yyposImbricatedLoopsTab[MAX_OPEN_FILES]; static double LoopControlVariablesTab[MAX_OPEN_FILES][3]; static char* LoopControlVariablesNameTab[MAX_OPEN_FILES]; -static char yynameTab[MAX_OPEN_FILES][NAME_STR_L]; -static char tmpstring[NAME_STR_L]; -static char tmpstring2[NAME_STR_L], tmpstring3[NAME_STR_L]; +static char yynameTab[MAX_OPEN_FILES][256]; +static char tmpstring[256]; +static char tmpstring2[256], tmpstring3[256]; static Symbol TheSymbol, *pSymbol; static Surface *STL_Surf; static Shape TheShape; @@ -439,13 +439,11 @@ Printf : View : tSTRING tBIGSTR '{' Views '}' tEND { - if(!strcmp($1, "View")) - EndView(1, yyname, $2); + if(!strcmp($1, "View")) EndView(View, 1, yyname, $2); } | tSTRING tBIGSTR tSTRING VExpr '{' Views '}' tEND { - if(!strcmp($1, "View")) - EndView(1, yyname, $2); + if(!strcmp($1, "View")) EndView(View, 1, yyname, $2); } ; diff --git a/Parser/Gmsh.yy.cpp b/Parser/Gmsh.yy.cpp index a4f1b8d3478f429ef56b03046b4c16ce93c1444e..34b942df2d030f8bac7c9deee8cbe5e98bebed2a 100644 --- a/Parser/Gmsh.yy.cpp +++ b/Parser/Gmsh.yy.cpp @@ -2,7 +2,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.104 2001-08-09 18:28:23 remacle Exp $ + * $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.105 2001-08-11 23:28:33 geuzaine Exp $ */ #define FLEX_SCANNER @@ -995,7 +995,7 @@ char *yytext; #define INITIAL 0 #line 2 "Gmsh.l" -// $Id: Gmsh.yy.cpp,v 1.104 2001-08-09 18:28:23 remacle Exp $ +// $Id: Gmsh.yy.cpp,v 1.105 2001-08-11 23:28:33 geuzaine Exp $ #include <stdio.h> #include <stdlib.h> @@ -1003,7 +1003,7 @@ char *yytext; #include <math.h> #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Geo.h" #include "CAD.h" #include "Gmsh.tab.cpp.h" diff --git a/Parser/OpenFile.cpp b/Parser/OpenFile.cpp index 403a640d562705aab82681c5359efe60966586e5..416be12b59be1781f5bbc641215d5c9c9ff4901e 100644 --- a/Parser/OpenFile.cpp +++ b/Parser/OpenFile.cpp @@ -1,6 +1,7 @@ -// $Id: OpenFile.cpp,v 1.18 2001-07-08 15:45:48 geuzaine Exp $ +// $Id: OpenFile.cpp,v 1.19 2001-08-11 23:28:34 geuzaine Exp $ + #include "Gmsh.h" -#include "Const.h" +#include "Numeric.h" #include "Context.h" #include "Parser.h" #include "OpenFile.h" @@ -31,7 +32,7 @@ int ParseFile(char *f){ char String[256]; int status; - strncpy(yyname,f,NAME_STR_L); + strncpy(yyname,f,255); yyerrorstate=0; yylineno=1; @@ -112,8 +113,8 @@ void OpenProblem(char *name){ ParseString(TheOptString); - strncpy(CTX.filename,name,NAME_STR_L); - strncpy(CTX.base_filename,name,NAME_STR_L); + strncpy(CTX.filename,name,255); + strncpy(CTX.base_filename,name,255); strcpy(ext,name+(strlen(name)-4)); if(!strcmp(ext,".geo") || !strcmp(ext,".GEO") || @@ -127,7 +128,7 @@ void OpenProblem(char *name){ strcat(CTX.filename,".geo"); } - strncpy(THEM->name, CTX.base_filename,NAME_STR_L); + strncpy(THEM->name, CTX.base_filename,255); if(!CTX.batch){ #if _XMOTIF diff --git a/Parser/OpenFile.h b/Parser/OpenFile.h index add2da5ef0bcd417731a401ab7cfcac62d36a186..f3bcad2ffa999111fa51cda57d0564a704078739 100644 --- a/Parser/OpenFile.h +++ b/Parser/OpenFile.h @@ -1,8 +1,6 @@ #ifndef _OPENFILE_H_ #define _OPENFILE_H_ -#include "Const.h" - int ParseFile(char *filename); void ParseString(char *str); void OpenProblem(char *filename); diff --git a/Parser/Parser.h b/Parser/Parser.h index f6b9878808f06c3fbde01b7bfcfa4712495b77fb..8e387f1561ff83f1cf3d965025c4e7ca7487137e 100644 --- a/Parser/Parser.h +++ b/Parser/Parser.h @@ -17,7 +17,7 @@ int yylex (); extern FILE *yyin; extern int yylineno; -extern char yyname[NAME_STR_L]; +extern char yyname[256]; extern char *yytext; extern int yyerrorstate; diff --git a/doc/VERSIONS b/doc/VERSIONS index 7dc89c1fb455c61ad336b352b75b6c9efd7c3e64..e258eaefd53e036543f7fba43912ea2266370090 100644 --- a/doc/VERSIONS +++ b/doc/VERSIONS @@ -1,10 +1,11 @@ -$Id: VERSIONS,v 1.51 2001-08-06 12:26:26 geuzaine Exp $ - -New in 1.23: Better display of displacement maps; boundary operator -generalization; new explode option for post-processing views; enhanced -link view behaviour (to update only the changed items); new default -plugins: Skin, Transform, Smooth; various other bug fixes, additions -and clean-ups; +$Id: VERSIONS,v 1.52 2001-08-11 23:28:34 geuzaine Exp $ + +New in 1.23: Fixed duplicate elements generation with Extrude; Better +display of displacement maps; boundary operator generalization; new +explode option for post-processing views; enhanced link view behaviour +(to update only the changed items); new default plugins: Skin, +Transform, Smooth; various other bug fixes and clean-ups (mostly in +the post-processing module); New in 1.22: Fixed (yet another) bug for 2D mesh in the mean plane; fixed surface coherence bug in extruded meshes; new double logarithmic