diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp index 66932a54cbb9565b3c86a0647610937e1d2fc4c3..3916e43021d81b817d0f0c74069b1984e03c7c39 100644 --- a/Geo/Geo.cpp +++ b/Geo/Geo.cpp @@ -1,4 +1,4 @@ -// $Id: Geo.cpp,v 1.73 2007-01-31 14:33:05 remacle Exp $ +// $Id: Geo.cpp,v 1.74 2007-02-01 21:05:52 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -466,32 +466,21 @@ void End_Curve(Curve * c) } } -void End_Surface(Surface * s, int reset_orientations) +void End_Surface(Surface * s) { - - ///----------------------------------------------------------------- - // this is something new : if all generatrices of a surface - // are on the same geometry, then the surface is also on the geometry + // if all the generatrices of a surface are on the same geometry, + // then the surface is also on the geometry Curve *c; int NN = List_Nbr(s->Generatrices); List_Read (s->Generatrices, 0, &c); s->geometry = c->geometry; - for (int i=1;i<NN;i++) - { - List_Read (s->Generatrices, i, &c); - if (c->geometry != s->geometry) - { - s->geometry = 0; - break; - } - } - printf("Surface %d's geoetry is %p\n",s->Num,s->geometry); - // thats'it JFR - ///----------------------------------------------------------------- - - - if(reset_orientations) - List_Reset(s->Orientations); + for(int i = 1; i < NN; i++){ + List_Read (s->Generatrices, i, &c); + if(c->geometry != s->geometry){ + s->geometry = 0; + break; + } + } } Curve *Create_Curve(int Num, int Typ, int Order, List_T * Liste, @@ -639,7 +628,6 @@ Surface *Create_Surface(int Num, int Typ) pS->RecombineAngle = 75; pS->TrsfPoints = List_Create(4, 4, sizeof(Vertex *)); pS->Contours = List_Create(1, 1, sizeof(List_T *)); - pS->Orientations = List_Create(20, 2, sizeof(Vertex)); pS->Control_Points = List_Create(1, 10, sizeof(Vertex *)); pS->Generatrices = NULL; pS->EmbeddedPoints = NULL; @@ -655,7 +643,6 @@ void Free_Surface(void *a, void *b) if(pS) { List_Delete(pS->TrsfPoints); List_Delete(pS->Contours); - List_Delete(pS->Orientations); List_Delete(pS->Control_Points); List_Delete(pS->Generatrices); List_Delete(pS->EmbeddedCurves); diff --git a/Geo/Geo.h b/Geo/Geo.h index 972bb8e0589f57fa9bfa26d84469734dfbe609f2..f6f11268165c732313f5ba1d4ee2617a650b2f73 100644 --- a/Geo/Geo.h +++ b/Geo/Geo.h @@ -156,7 +156,6 @@ typedef struct{ double plan[3][3]; double invplan[3][3]; double a, b, c, d; - List_T *Orientations; List_T *Contours; ExtrudeParams *Extrude; DrawingColor Color; @@ -239,7 +238,7 @@ SurfaceLoop *Create_SurfaceLoop(int Num, List_T * intlist); PhysicalGroup *Create_PhysicalGroup(int Num, int typ, List_T * intlist); void End_Curve(Curve * c); -void End_Surface(Surface * s, int reset_orientations=1); +void End_Surface(Surface * s); void Free_Vertex (void *a, void *b); void Free_Curve(void *a, void *b); diff --git a/Geo/GeoInterpolation.cpp b/Geo/GeoInterpolation.cpp index 5a2e143e3647c2d4ab7b336a752b7b4e8ee3bec2..a321ee97fb11a16bfadff643aa1e7fdd2ff6897a 100644 --- a/Geo/GeoInterpolation.cpp +++ b/Geo/GeoInterpolation.cpp @@ -1,4 +1,4 @@ -// $Id: GeoInterpolation.cpp,v 1.16 2007-01-31 14:33:05 remacle Exp $ +// $Id: GeoInterpolation.cpp,v 1.17 2007-02-01 21:05:53 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -236,22 +236,20 @@ Vertex InterpolateCurve(Curve * c, double u, int derivee) t = (u - t1) / (t2 - t1); List_Read(c->Control_Points, i, &v[1]); List_Read(c->Control_Points, i + 1, &v[2]); - if (!c->geometry) - { - V.Pos.X = v[1]->Pos.X + t * (v[2]->Pos.X - v[1]->Pos.X); - V.Pos.Y = v[1]->Pos.Y + t * (v[2]->Pos.Y - v[1]->Pos.Y); - V.Pos.Z = v[1]->Pos.Z + t * (v[2]->Pos.Z - v[1]->Pos.Z); - V.w = (1. - t) * v[1]->w + t * v[2]->w; - V.lc = (1. - t) * v[1]->lc + t * v[2]->lc; - } - else - { - SPoint2 p = v[1] -> pntOnGeometry + (v[2] -> pntOnGeometry - v[1] -> pntOnGeometry) * t; - SPoint3 pp = c->geometry->point ( p ); - V.Pos.X = pp.x(); - V.Pos.Y = pp.y(); - V.Pos.Z = pp.z(); - } + if(!c->geometry){ + V.Pos.X = v[1]->Pos.X + t * (v[2]->Pos.X - v[1]->Pos.X); + V.Pos.Y = v[1]->Pos.Y + t * (v[2]->Pos.Y - v[1]->Pos.Y); + V.Pos.Z = v[1]->Pos.Z + t * (v[2]->Pos.Z - v[1]->Pos.Z); + V.w = (1. - t) * v[1]->w + t * v[2]->w; + V.lc = (1. - t) * v[1]->lc + t * v[2]->lc; + } + else{ + SPoint2 p = v[1]->pntOnGeometry + (v[2]->pntOnGeometry - v[1]->pntOnGeometry) * t; + SPoint3 pp = c->geometry->point(p); + V.Pos.X = pp.x(); + V.Pos.Y = pp.y(); + V.Pos.Z = pp.z(); + } return V; case MSH_SEGM_PARAMETRIC: @@ -519,15 +517,14 @@ Vertex InterpolateSurface(Surface * s, double u, double v, int derivee, int u_v) return T; } - if (s->geometry) - { - Vertex T; - SPoint3 p = s->geometry->point(u,v); - T.Pos.X = p.x(); - T.Pos.Y = p.y(); - T.Pos.Z = p.z(); - return T; - } + if(s->geometry){ + Vertex T; + SPoint3 p = s->geometry->point(u, v); + T.Pos.X = p.x(); + T.Pos.Y = p.y(); + T.Pos.Z = p.z(); + return T; + } // use the exact extrusion formula if the surface is extruded if(s->Extrude && s->Extrude->geo.Mode == EXTRUDED_ENTITY && diff --git a/Geo/Makefile b/Geo/Makefile index 1a247c6a2fea089e5733fb7d44a663bf75bf4829..efc34d09862cb551072abff4a68bfd07b9ea84b2 100644 --- a/Geo/Makefile +++ b/Geo/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.130 2007-02-01 15:09:43 geuzaine Exp $ +# $Id: Makefile,v 1.131 2007-02-01 21:05:53 geuzaine Exp $ # # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle # @@ -45,7 +45,6 @@ SRC = GEntity.cpp\ MVertex.cpp \ MElement.cpp \ SVector3.cpp\ - projectionFace.cpp\ SBoundingBox3d.cpp OBJ = ${SRC:.cpp=.o} @@ -264,9 +263,4 @@ MElement.o: MElement.cpp MElement.h ../Common/GmshDefines.h MVertex.h \ ../Numeric/Numeric.h ../Common/Context.h ../DataStr/List.h GEntity.h \ Range.h SBoundingBox3d.h ../Common/Message.h SVector3.o: SVector3.cpp SVector3.h SPoint3.h -projectionFace.o: projectionFace.cpp projectionFace.h GFace.h GPoint.h \ - GEntity.h Range.h SPoint3.h SBoundingBox3d.h ../Common/GmshDefines.h \ - GEdgeLoop.h GEdge.h GVertex.h MVertex.h SPoint2.h SVector3.h MElement.h \ - MEdge.h ../Common/Hash.h MFace.h ../Numeric/Numeric.h \ - ../Common/Context.h ../DataStr/List.h ExtrudeParams.h Pair.h SBoundingBox3d.o: SBoundingBox3d.cpp SBoundingBox3d.h SPoint3.h diff --git a/Geo/gmshSurface.cpp b/Geo/gmshSurface.cpp index ceb563dbe79b796f4de0c67af382786fd0adbd6f..706da655e1fa80c2775c8c8ee432fdda80fac4ca 100644 --- a/Geo/gmshSurface.cpp +++ b/Geo/gmshSurface.cpp @@ -1,3 +1,24 @@ +// $Id: gmshSurface.cpp,v 1.2 2007-02-01 21:05:53 geuzaine Exp $ +// +// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// +// Please report all bugs and problems to <gmsh@geuz.org>. + #include "gmshSurface.h" #include "Message.h" diff --git a/Geo/gmshSurface.h b/Geo/gmshSurface.h index 9447524a5b52e599bcba7acebf80a1fce21d3e13..452c379832287e52acae2e78238c9cf3ce4bd5b5 100644 --- a/Geo/gmshSurface.h +++ b/Geo/gmshSurface.h @@ -1,6 +1,25 @@ #ifndef _GMSH_SURFACE_H_ #define _GMSH_SURFACE_H_ +// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// +// Please report all bugs and problems to <gmsh@geuz.org>. + #include <cmath> #include <map> #include "Pair.h" diff --git a/configure b/configure index 68f3749c727fbbae3a0977b5f1e1a6ef69d1901e..051e61477f1fb6d7add69accf81606e21c70fbe5 100755 --- a/configure +++ b/configure @@ -3030,7 +3030,14 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then + +case "$UNAME" in + Darwin*) + RANLIB=true + AR="libtool -o" + ;; + *) + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -3110,8 +3117,7 @@ else RANLIB="$ac_cv_prog_RANLIB" fi - -# Extract the first word of "ar", so it can be a program name with args. + # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -3150,12 +3156,14 @@ else echo "${ECHO_T}no" >&6 fi -if test "x${AR}" = "x:"; then - { { echo "$as_me:$LINENO: error: Could not find the library archiver, aborting." >&5 + if test "x${AR}" = "x:"; then + { { echo "$as_me:$LINENO: error: Could not find the library archiver, aborting." >&5 echo "$as_me: error: Could not find the library archiver, aborting." >&2;} { (exit 1); exit 1; }; } -fi -AR="${AR} ruvs" + fi + AR="${AR} ruvs" + ;; +esac @@ -4669,9 +4677,8 @@ fi GMSH_LIBS="${GMSH_LIBS} ${OCC_LIBS}" FLAGS="${FLAGS} -DHAVE_OCC" else - GMSH_LIBS="${GMSH_LIBS} -L${OCC_PREFIX}/lib -I${OCC_PREFIX}/${UNAME}/lib ${OCC_LIBS}" - FLAGS="${FLAGS} -DHAVE_OCC -I${OCC_PREFIX}/include -I${OCC_PREFIX}/inc" - FLAGS="${FLAGS} -I${OCC_PREFIX}/${UNAME}/include -I${OCC_PREFIX}/${UNAME}/inc" + GMSH_LIBS="${GMSH_LIBS} -L${OCC_PREFIX}/lib ${OCC_LIBS}" + FLAGS="${FLAGS} -DHAVE_OCC -I${OCC_PREFIX}/inc" fi fi fi diff --git a/configure.in b/configure.in index f471caffef1fc0ec0a8070597b610a6dbf5b2102..bbbadee4ddeeac60e9791903072862b5d01a1d82 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -dnl $Id: configure.in,v 1.119 2007-01-29 17:16:01 geuzaine Exp $ +dnl $Id: configure.in,v 1.120 2007-02-01 21:05:52 geuzaine Exp $ dnl dnl Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle dnl @@ -156,14 +156,22 @@ OPTIM="${CXXFLAGS}" dnl Check for various programs AC_PROG_CPP -AC_PROG_RANLIB dnl How to build static libraries? -AC_PATH_PROG(AR, ar) -if test "x${AR}" = "x:"; then - AC_MSG_ERROR([Could not find the library archiver, aborting.]) -fi -AR="${AR} ruvs" +case "$UNAME" in + Darwin*) + RANLIB=true + AR="libtool -o" + ;; + *) + AC_PROG_RANLIB + AC_PATH_PROG(AR, ar) + if test "x${AR}" = "x:"; then + AC_MSG_ERROR([Could not find the library archiver, aborting.]) + fi + AR="${AR} ruvs" + ;; +esac dnl See if we need a .exe extension on executables AC_EXEEXT @@ -577,9 +585,8 @@ if test "x$enable_occ" = "xyes"; then GMSH_LIBS="${GMSH_LIBS} ${OCC_LIBS}" FLAGS="${FLAGS} -DHAVE_OCC" else - GMSH_LIBS="${GMSH_LIBS} -L${OCC_PREFIX}/lib -I${OCC_PREFIX}/${UNAME}/lib ${OCC_LIBS}" - FLAGS="${FLAGS} -DHAVE_OCC -I${OCC_PREFIX}/include -I${OCC_PREFIX}/inc" - FLAGS="${FLAGS} -I${OCC_PREFIX}/${UNAME}/include -I${OCC_PREFIX}/${UNAME}/inc" + GMSH_LIBS="${GMSH_LIBS} -L${OCC_PREFIX}/lib ${OCC_LIBS}" + FLAGS="${FLAGS} -DHAVE_OCC -I${OCC_PREFIX}/inc" fi fi fi