diff --git a/Fltk/GmshServer.h b/Fltk/GmshServer.h index ba15a631d1e65b2362cfd7ef7f78e0cf623c7158..878b40e29c35fe2341e4d48f973a2e087ac4f60d 100644 --- a/Fltk/GmshServer.h +++ b/Fltk/GmshServer.h @@ -56,7 +56,7 @@ int WaitForData(int socket, int num, double waitint); #endif -int myselect(int socket, int seconds) +static int myselect(int socket, int seconds) { struct timeval tv; tv.tv_sec = seconds; diff --git a/Geo/GModelIO_OCC.cpp b/Geo/GModelIO_OCC.cpp index 7e47d384af4fe465e287910e91931d6bfd313730..42bb8877665722a679a7ef12e26f6898367ee7a6 100644 --- a/Geo/GModelIO_OCC.cpp +++ b/Geo/GModelIO_OCC.cpp @@ -1,4 +1,4 @@ -// $Id: GModelIO_OCC.cpp,v 1.34 2008-06-03 07:25:07 geuzaine Exp $ +// $Id: GModelIO_OCC.cpp,v 1.35 2008-06-30 17:42:49 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -27,6 +27,11 @@ #include "OCCFace.h" #include "OCCRegion.h" +#if defined(HAVE_OCC_MESH_CONSTRAINTS) +#include "MeshGmsh_Constrain.hxx" +#include "MeshGmsh_EdgeConstrain.hxx" +#endif + extern Context_T CTX; #if defined(HAVE_OCC) @@ -476,13 +481,33 @@ int GModel::readOCCSTEP(const std::string &fn) int GModel::importOCCShape(const void *shape, const void *options) { + extern void SetBoundingBox(); + _occ_internals = new OCC_Internals; _occ_internals->loadShape((TopoDS_Shape*)shape); _occ_internals->buildGModel(this); snapVertices(); - // FIXME remove this when CL API is done - extern void SetBoundingBox(); SetBoundingBox(); + if(!options) return 1; + +#if defined(HAVE_OCC_MESH_CONSTRAINTS) + MeshGmsh_Constrain *c = (MeshGmsh_Constrain*)options; + MeshGmsh_DataMapOfShapeOfEdgeConstrain ecmap; + c->GetEdgeConstrain(ecmap); + + // iterate on all the edges of the model and set constraints (if + // any) + for(eiter it = firstEdge(); it != lastEdge(); ++it){ + TopoDS_Edge *edge = (*it)->getNativePtr(); + try { + MeshGmsh_EdgeConstrain &ec = ecmap.Find(*edge); + printf("got edge constraints\n"); + } + catch(...){ + } + } +#endif + return 1; } diff --git a/configure b/configure index ac626dbe691a308d3033e1a5f4fbd87918a9eab3..33e1a4bce3a817b3e962c97e495d83e5018e459f 100755 --- a/configure +++ b/configure @@ -1303,6 +1303,9 @@ Optional Packages: prefix where OSMesa is installed --with-cgns-prefix=PFX prefix where CGNS is installed --with-occ-prefix=PFX prefix where OpenCascade is installed + --occ-mesh-constraints-prefix=PFX + prefix where OCC mesh contraints source code is + located --with-hdf5-prefix=PFX prefix where OpenCascade is installed --with-med-prefix=PFX prefix where OpenCascade is installed --with-fftw3-prefix=PFX prefix where FFTW3 is installed @@ -1797,6 +1800,12 @@ if test "${with_occ_prefix+set}" = set; then fi +# Check whether --with-occ-mesh-constraints-prefix was given. +if test "${with_occ_mesh_constraints_prefix+set}" = set; then + withval=$with_occ_mesh_constraints_prefix; OCC_MESH_CONTRAINTS_PREFIX=$withval +fi + + # Check whether --with-hdf5-prefix was given. if test "${with_hdf5_prefix+set}" = set; then withval=$with_hdf5_prefix; HDF5_PREFIX=$withval @@ -5074,6 +5083,39 @@ fi fi fi +if test "x${OCC}" = "xyes"; then + if test "x${OCC_MESH_CONTRAINTS_PREFIX}" != "x"; then + as_ac_File=`echo "ac_cv_file_${OCC_MESH_CONTRAINTS_PREFIX}/MeshGmsh_Constrain.hxx" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for ${OCC_MESH_CONTRAINTS_PREFIX}/MeshGmsh_Constrain.hxx" >&5 +echo $ECHO_N "checking for ${OCC_MESH_CONTRAINTS_PREFIX}/MeshGmsh_Constrain.hxx... $ECHO_C" >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + test "$cross_compiling" = yes && + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } +if test -r "${OCC_MESH_CONTRAINTS_PREFIX}/MeshGmsh_Constrain.hxx"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +ac_res=`eval echo '${'$as_ac_File'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_File'}'` = yes; then + OMC="yes" +else + OMC="no" +fi + + if test "x${OMC}" = "xyes"; then + FLAGS="${FLAGS} -DHAVE_OCC_MESH_CONSTRAINTS -I${OCC_MESH_CONTRAINTS_PREFIX}" + fi + fi +fi + ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' diff --git a/configure.in b/configure.in index f69d2230bab0649132acd597d05ef096e57d9ae2..7cdb464da7d0f5e14723306d582d32c9ab251cce 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -dnl $Id: configure.in,v 1.158 2008-06-27 18:00:51 geuzaine Exp $ +dnl $Id: configure.in,v 1.159 2008-06-30 17:42:49 geuzaine Exp $ dnl dnl Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle dnl @@ -61,6 +61,10 @@ AC_ARG_WITH(occ-prefix, AC_HELP_STRING([--with-occ-prefix=PFX], [prefix where OpenCascade is installed]), [OCC_PREFIX=$withval]) +AC_ARG_WITH(occ-mesh-constraints-prefix, + AC_HELP_STRING([--occ-mesh-constraints-prefix=PFX], + [prefix where OCC mesh contraints source code is located]), + [OCC_MESH_CONTRAINTS_PREFIX=$withval]) AC_ARG_WITH(hdf5-prefix, AC_HELP_STRING([--with-hdf5-prefix=PFX], [prefix where OpenCascade is installed]), @@ -617,6 +621,16 @@ if test "x$enable_occ" = "xyes"; then fi fi +dnl Check for OpenCascade mesh constraints +if test "x${OCC}" = "xyes"; then + if test "x${OCC_MESH_CONTRAINTS_PREFIX}" != "x"; then + AC_CHECK_FILE(${OCC_MESH_CONTRAINTS_PREFIX}/MeshGmsh_Constrain.hxx, OMC="yes", OMC="no") + if test "x${OMC}" = "xyes"; then + FLAGS="${FLAGS} -DHAVE_OCC_MESH_CONSTRAINTS -I${OCC_MESH_CONTRAINTS_PREFIX}" + fi + fi +fi + dnl Check for blas and lapack (used by FourierModel) AC_LANG_PUSH(Fortran 77) if test "x${BLAS_LAPACK_PREFIX}" != "x"; then diff --git a/utils/misc/Info.plist b/utils/misc/Info.plist index a038c28bbb8a8de37a47c66a444b709b21abe168..7ad7b88d10c06afdaa070f81ff2f8b9b1a39e8e9 100644 --- a/utils/misc/Info.plist +++ b/utils/misc/Info.plist @@ -28,6 +28,7 @@ <key>CFBundleTypeExtensions</key><array> <string>msh</string> <string>unv</string> + <string>stl</string> <string>vrml</string><string>wrl</string><string>iv</string> <string>bdf</string><string>nas</string> <string>mesh</string>