diff --git a/Geo/GModelIO.cpp b/Geo/GModelIO.cpp index e2c32e730ae1bcc4cfd081f839d128208e013847..217f96934ef056ed3909f39356d4ef17c29ef058 100644 --- a/Geo/GModelIO.cpp +++ b/Geo/GModelIO.cpp @@ -1,4 +1,4 @@ -// $Id: GModelIO.cpp,v 1.51 2006-09-10 03:25:11 geuzaine Exp $ +// $Id: GModelIO.cpp,v 1.52 2006-09-11 20:18:23 remacle Exp $ // // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // @@ -330,7 +330,7 @@ int GModel::readMSH(const std::string &name) if(fread(&num, sizeof(int), 1, fp) != 1) return 0; if(swap) swapBytes((char*)&num, sizeof(int), 1); if(fread(xyz, sizeof(double), 3, fp) != 3) return 0; - if(swap) swapBytes((char*)&xyz, sizeof(double), 3); + if(swap) swapBytes((char*)xyz, sizeof(double), 3); } minVertex = std::min(minVertex, num); maxVertex = std::max(maxVertex, num); @@ -409,7 +409,7 @@ int GModel::readMSH(const std::string &name) while(numElementsPartial < numElements){ int header[3]; if(fread(header, sizeof(int), 3, fp) != 3) return 0; - if(swap) swapBytes((char*)&header, sizeof(int), 3); + if(swap) swapBytes((char*)header, sizeof(int), 3); int type = header[0]; int numElms = header[1]; int numTags = header[2]; @@ -418,7 +418,7 @@ int GModel::readMSH(const std::string &name) int *data = new int[n]; for(int i = 0; i < numElms; i++) { if(fread(data, sizeof(int), n, fp) != n) return 0; - if(swap) swapBytes((char*)&data, sizeof(int), n); + if(swap) swapBytes((char*)data, sizeof(int), n); int num = data[0]; int physical = (numTags > 0) ? data[4 - numTags] : 0; int elementary = (numTags > 1) ? data[4 - numTags + 1] : 0; diff --git a/Mesh/2D_DivAndConq.cpp b/Mesh/2D_DivAndConq.cpp index 59a302b2f6178347805af9a7b1a04d4360f2f6fd..94ed2fad211fc63db82887f7dc58c04dff4233af 100644 --- a/Mesh/2D_DivAndConq.cpp +++ b/Mesh/2D_DivAndConq.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_DivAndConq.cpp,v 1.23 2006-09-11 17:58:19 geuzaine Exp $ +// $Id: 2D_DivAndConq.cpp,v 1.24 2006-09-11 20:18:23 remacle Exp $ // // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // @@ -394,6 +394,8 @@ int CircumCircle(double x1, double y1, double x2, double y2, double x3, return (1); } +// we should use robust predicates here, let's give it at try... + int Is_right_of(PointNumero x, PointNumero y, PointNumero check) { @@ -402,6 +404,15 @@ int Is_right_of(PointNumero x, PointNumero y, PointNumero check) int Is_left_of(PointNumero x, PointNumero y, PointNumero check) { + + // double pa[2] = {(double)pPointArray[x].where.h, (double)pPointArray[x].where.v}; + // double pb[2] = {(double)pPointArray[y].where.h, (double)pPointArray[y].where.v}; + // double pc[2] = {(double)pPointArray[check].where.h, (double)pPointArray[check].where.v}; + + // double result gmsh::orient2d(pa, pb, pc); + + // return result > 0; + static double xx, yy, alpha, beta; yy = (double)(pPointArray[y].where.v - pPointArray[x].where.v);