From: gdd Date: Wed, 17 Oct 2012 14:42:52 +0000 (+0000) Subject: Merge from BR_meshgems X-Git-Tag: V6_6_0a1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d0adc3b0afb42602de8e94ecdd9214ec15ead802;p=plugins%2Fhybridplugin.git Merge from BR_meshgems --- diff --git a/adm_local/unix/config_files/check_MESHGEMS_TETRA.m4 b/adm_local/unix/config_files/check_MESHGEMS_TETRA.m4 new file mode 100644 index 0000000..ab354e0 --- /dev/null +++ b/adm_local/unix/config_files/check_MESHGEMS_TETRA.m4 @@ -0,0 +1,37 @@ +dnl Copyright (C) 2004-2012 CEA/DEN, EDF R&D +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +dnl +dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +dnl + +AC_DEFUN([CHECK_MESHGEMS_TETRA],[ + +AC_CHECKING([for MeshGems-Tetra commercial product]) + +MeshGems_Tetra_ok=no + +AC_EXEEXT +AC_CHECK_PROG(MESHGEMS_TETRA, mg-tetra.exe$EXEEXT,found) + +if test "x$MESHGEMS_TETRA" == x ; then + AC_MSG_WARN(mg-tetra program not found in PATH variable) +else + MeshGems_Tetra_ok=yes +fi + +AC_MSG_RESULT(for MeshGems-Tetra: $MeshGems_Tetra_ok) + +])dnl diff --git a/configure.ac b/configure.ac index d39b98b..6c57482 100644 --- a/configure.ac +++ b/configure.ac @@ -349,18 +349,11 @@ CHECK_SMESH echo echo --------------------------------------------- -echo Testing GHS3D +echo Testing MeshGems-Tetra echo --------------------------------------------- echo -CHECK_GHS3D -if test "${GHS3D_ok}" = "yes"; then - if test "x$GHS3D_VERSION" = "x" - then - GHS3D_VERSION=`ghs3d -u |grep "TETMESH-GHS3D SOFTWARE"|awk '{print $3}'|awk -F- '{print $1}'|awk -F. '{print $1$2}'` - fi - AC_DEFINE_UNQUOTED(GHS3D_VERSION,${GHS3D_VERSION}) -fi +CHECK_MESHGEMS_TETRA echo echo --------------------------------------------- @@ -370,11 +363,11 @@ echo echo Configure if test "${gui_ok}" = "yes"; then - variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok gui_ok Geom_ok Med_ok SMesh_ok GHS3D_ok OpenGL_ok qt_ok vtk_ok" + variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok gui_ok Geom_ok Med_ok SMesh_ok MeshGems_Tetra_ok OpenGL_ok qt_ok vtk_ok" elif test "${SalomeGUI_need}" != "no"; then - variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok gui_ok Geom_ok Med_ok SMesh_ok GHS3D_ok vtk_ok" + variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok gui_ok Geom_ok Med_ok SMesh_ok MeshGems_Tetra_ok vtk_ok" else - variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok Geom_ok Med_ok SMesh_ok GHS3D_ok vtk_ok" + variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok Geom_ok Med_ok SMesh_ok MeshGems_Tetra_ok vtk_ok" fi for var in $variables diff --git a/idl/GHS3DPlugin_Algorithm.idl b/idl/GHS3DPlugin_Algorithm.idl index 6bb10d8..f930af5 100644 --- a/idl/GHS3DPlugin_Algorithm.idl +++ b/idl/GHS3DPlugin_Algorithm.idl @@ -178,6 +178,7 @@ module GHS3DPlugin GHS3DEnforcedMeshList GetEnforcedMeshes(); void ClearEnforcedMeshes(); + /*! * Set/get/unset an enforced vertex (private method for GUI) */ diff --git a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx index 68d805e..3e467d8 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx @@ -107,10 +107,6 @@ extern "C" #define HOLE_ID -1 -#ifndef GHS3D_VERSION -#define GHS3D_VERSION 41 -#endif - typedef const list TTriaList; static void removeFile( const TCollection_AsciiString& fileName ) @@ -479,11 +475,11 @@ static int findShapeID(SMESH_Mesh& mesh, return meshDS->ShapeToIndex( solids(2) ); } -//======================================================================= -//function : countShape -//purpose : -//======================================================================= - +// //======================================================================= +// //function : countShape +// //purpose : +// //======================================================================= +// // template < class Mesh, class Shape > // static int countShape( Mesh* mesh, Shape shape ) { // TopExp_Explorer expShape ( mesh->ShapeToMesh(), shape ); @@ -496,12 +492,12 @@ static int findShapeID(SMESH_Mesh& mesh, // } // return nbShape; // } - -//======================================================================= -//function : getShape -//purpose : -//======================================================================= - +// +// //======================================================================= +// //function : getShape +// //purpose : +// //======================================================================= +// // template < class Mesh, class Shape, class Tab > // void getShape(Mesh* mesh, Shape shape, Tab *t_Shape) { // TopExp_Explorer expShape ( mesh->ShapeToMesh(), shape ); @@ -514,11 +510,11 @@ static int findShapeID(SMESH_Mesh& mesh, // } // return; // } - -// //======================================================================= -// //function : findEdgeID -// //purpose : -// //======================================================================= +// +// // //======================================================================= +// // //function : findEdgeID +// // //purpose : +// // //======================================================================= // // static int findEdgeID(const SMDS_MeshNode* aNode, // const SMESHDS_Mesh* theMesh, @@ -552,16 +548,14 @@ static int findShapeID(SMESH_Mesh& mesh, // delete [] t_Dist; // return theMesh->ShapeToIndex( foundEdge ); // } - - -//======================================================================= -//function : readGMFFile -//purpose : read GMF file with geometry associated to mesh -// TODO -//======================================================================= - -// static bool readGMFFile( -// const int fileOpen, +// +// +// // ======================================================================= +// // function : readGMFFile +// // purpose : read GMF file with geometry associated to mesh +// // ======================================================================= +// +// static bool readGMFFile(const int fileOpen, // const char* theFileName, // SMESH_Mesh& theMesh, // const int nbShape, @@ -644,7 +638,7 @@ static int findShapeID(SMESH_Mesh& mesh, // // // // The keyword does not exist yet => to update when it is created -// // int nbTriangle = GmfStatKwd(InpMsh, GmfSubdomain); +// // int nbSubdomains = GmfStatKwd(InpMsh, GmfSubdomain); // // int id_tri[3]; // // @@ -828,11 +822,11 @@ static int findShapeID(SMESH_Mesh& mesh, // // case GmfHexahedra: // { // int nodeDim, shapeID, *nodeID; -// SMDS_MeshNode** node; +// const SMDS_MeshNode** node; // // std::vector< SMDS_MeshNode* > enfNode( nbRef ); // SMDS_MeshElement * aGMFElement; // -// node = new SMDS_MeshNode*[nbRef]; +// node = new const SMDS_MeshNode*[nbRef]; // nodeID = new int[ nbRef ]; // // for ( int iElem = 0; iElem < nbElem; iElem++ ) diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx index 4deccaa..cb402ee 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx @@ -1313,10 +1313,7 @@ std::string GHS3DPlugin_Hypothesis::CommandToRun(const GHS3DPlugin_Hypothesis* h const bool hasShapeToMesh) { TCollection_AsciiString cmd; - if (hasShapeToMesh) - cmd = "ghs3d-41"; // to use old mesh2 format - else - cmd = "ghs3d"; // to use new mesh format + cmd = "mg-tetra.exe"; // check if any option is overridden by hyp->myTextOption bool m = hyp ? ( hyp->myTextOption.find("-m") == std::string::npos ) : true; bool M = hyp ? ( hyp->myTextOption.find("-M") == std::string::npos ) : true; diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx index 9129727..b4bf07a 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx @@ -44,9 +44,6 @@ // #include // #include CORBA_SERVER_HEADER(SALOMEDS) -#ifndef GHS3D_VERSION -#define GHS3D_VERSION 41 -#endif //======================================================================= //function : GHS3DPlugin_Hypothesis_i //======================================================================= @@ -839,16 +836,16 @@ GHS3DPlugin::GHS3DEnforcedMeshList* GHS3DPlugin_Hypothesis_i::GetEnforcedMeshes( bool GHS3DPlugin_Hypothesis_i::SetEnforcedMeshWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType, const char* theGroupName) throw (SALOME::SALOME_Exception) { -#if GHS3D_VERSION >= 42 +// #if GHS3D_VERSION >= 42 return p_SetEnforcedMesh(theSource, theType, "", theGroupName); -#else - SALOME::ExceptionStruct ExDescription; - ExDescription.text = "Bad version of GHS3D. It must >= 4.2."; - ExDescription.type = SALOME::BAD_PARAM; - ExDescription.sourceFile = "GHS3DPlugin_Hypothesis_i.cxx"; - ExDescription.lineNumber = 719; - throw SALOME::SALOME_Exception(ExDescription); -#endif +// #else +// SALOME::ExceptionStruct ExDescription; +// ExDescription.text = "Bad version of GHS3D. It must >= 4.2."; +// ExDescription.type = SALOME::BAD_PARAM; +// ExDescription.sourceFile = "GHS3DPlugin_Hypothesis_i.cxx"; +// ExDescription.lineNumber = 719; +// throw SALOME::SALOME_Exception(ExDescription); +// #endif } /*! @@ -858,16 +855,16 @@ bool GHS3DPlugin_Hypothesis_i::SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSour throw (SALOME::SALOME_Exception) { // MESSAGE("GHS3DPlugin_Hypothesis_i::SetEnforcedMesh"); -#if GHS3D_VERSION >= 42 +// #if GHS3D_VERSION >= 42 return p_SetEnforcedMesh(theSource, theType); -#else - SALOME::ExceptionStruct ExDescription; - ExDescription.text = "Bad version of GHS3D. It must >= 4.2."; - ExDescription.type = SALOME::BAD_PARAM; - ExDescription.sourceFile = "GHS3DPlugin_Hypothesis_i.cxx"; - ExDescription.lineNumber = 750; - throw SALOME::SALOME_Exception(ExDescription); -#endif +// #else +// SALOME::ExceptionStruct ExDescription; +// ExDescription.text = "Bad version of GHS3D. It must >= 4.2."; +// ExDescription.type = SALOME::BAD_PARAM; +// ExDescription.sourceFile = "GHS3DPlugin_Hypothesis_i.cxx"; +// ExDescription.lineNumber = 750; +// throw SALOME::SALOME_Exception(ExDescription); +// #endif } /*! @@ -876,16 +873,16 @@ bool GHS3DPlugin_Hypothesis_i::SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSour bool GHS3DPlugin_Hypothesis_i::SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType, double theSize, const char* theGroupName) throw (SALOME::SALOME_Exception) { -#if GHS3D_VERSION >= 42 +// #if GHS3D_VERSION >= 42 return p_SetEnforcedMesh(theSource, theType, "", theGroupName); -#else - SALOME::ExceptionStruct ExDescription; - ExDescription.text = "Bad version of GHS3D. It must >= 4.2."; - ExDescription.type = SALOME::BAD_PARAM; - ExDescription.sourceFile = "GHS3DPlugin_Hypothesis_i.cxx"; - ExDescription.lineNumber = 750; - throw SALOME::SALOME_Exception(ExDescription); -#endif +// #else +// SALOME::ExceptionStruct ExDescription; +// ExDescription.text = "Bad version of GHS3D. It must >= 4.2."; +// ExDescription.type = SALOME::BAD_PARAM; +// ExDescription.sourceFile = "GHS3DPlugin_Hypothesis_i.cxx"; +// ExDescription.lineNumber = 750; +// throw SALOME::SALOME_Exception(ExDescription); +// #endif } /*! @@ -894,16 +891,16 @@ bool GHS3DPlugin_Hypothesis_i::SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSourc bool GHS3DPlugin_Hypothesis_i::SetEnforcedMeshSize(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType, double theSize) throw (SALOME::SALOME_Exception) { -#if GHS3D_VERSION >= 42 +// #if GHS3D_VERSION >= 42 return p_SetEnforcedMesh(theSource, theType); -#else - SALOME::ExceptionStruct ExDescription; - ExDescription.text = "Bad version of GHS3D. It must >= 4.2."; - ExDescription.type = SALOME::BAD_PARAM; - ExDescription.sourceFile = "GHS3DPlugin_Hypothesis_i.cxx"; - ExDescription.lineNumber = 750; - throw SALOME::SALOME_Exception(ExDescription); -#endif +// #else +// SALOME::ExceptionStruct ExDescription; +// ExDescription.text = "Bad version of GHS3D. It must >= 4.2."; +// ExDescription.type = SALOME::BAD_PARAM; +// ExDescription.sourceFile = "GHS3DPlugin_Hypothesis_i.cxx"; +// ExDescription.lineNumber = 750; +// throw SALOME::SALOME_Exception(ExDescription); +// #endif } bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType, const char* theName, const char* theGroupName) diff --git a/src/GHS3DPlugin/Makefile.am b/src/GHS3DPlugin/Makefile.am index 1d7fc51..182512d 100644 --- a/src/GHS3DPlugin/Makefile.am +++ b/src/GHS3DPlugin/Makefile.am @@ -44,16 +44,16 @@ dist_libGHS3DEngine_la_SOURCES = \ GHS3DPlugin_Hypothesis_i.cxx libGHS3DEngine_la_CPPFLAGS = \ - $(KERNEL_CXXFLAGS) \ - $(CAS_CPPFLAGS) \ - $(GEOM_CXXFLAGS) \ - $(MED_CXXFLAGS) \ - $(SMESH_CXXFLAGS) \ - $(VTK_INCLUDES) \ - $(BOOST_CPPFLAGS) \ - $(CORBA_CXXFLAGS) \ - $(CORBA_INCLUDES) \ - -I$(top_builddir)/idl + $(KERNEL_CXXFLAGS) \ + $(CAS_CPPFLAGS) \ + $(GEOM_CXXFLAGS) \ + $(MED_CXXFLAGS) \ + $(SMESH_CXXFLAGS) \ + $(VTK_INCLUDES) \ + $(BOOST_CPPFLAGS) \ + $(CORBA_CXXFLAGS) \ + $(CORBA_INCLUDES) \ + -I$(top_builddir)/idl libGHS3DEngine_la_LDFLAGS = \ ../../idl/libSalomeIDLGHS3DPLUGIN.la \