From ad04a12b26eaea28524566df34f3acf5a133192e Mon Sep 17 00:00:00 2001 From: Afeef Date: Tue, 22 Jun 2021 16:14:07 +0200 Subject: [PATCH] Porting to Gmsh Version 4.8.4 : "_compound" is renamed to "compound" - "GeomType" CompoundCurve, CompoundSurface, and CompoundVolume are determined by "!haveParametrization()". --- src/GMSHPlugin/GMSHPlugin_Mesher.cxx | 37 +++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/GMSHPlugin/GMSHPlugin_Mesher.cxx b/src/GMSHPlugin/GMSHPlugin_Mesher.cxx index 9d21d3d..1b7984d 100644 --- a/src/GMSHPlugin/GMSHPlugin_Mesher.cxx +++ b/src/GMSHPlugin/GMSHPlugin_Mesher.cxx @@ -84,11 +84,20 @@ namespace { topoEdges.clear(); #if GMSH_MAJOR_VERSION >=4 +#if GMSH_MINOR_VERSION >=3 + for ( size_t i = 0; i < gEdge->compound.size(); ++i ) + { + GEdge* gE = static_cast< GEdge* >( gEdge->compound[ i ]); + topoEdges.push_back( ShapeBounds{ gE->bounds(), *((TopoDS_Edge*)gE->getNativePtr()) }); + } +#endif +#if GMSH_MINOR_VERSION <3 for ( size_t i = 0; i < gEdge->_compound.size(); ++i ) { GEdge* gE = static_cast< GEdge* >( gEdge->_compound[ i ]); topoEdges.push_back( ShapeBounds{ gE->bounds(), *((TopoDS_Edge*)gE->getNativePtr()) }); } +#endif #else if ( gEdge->geomType() == GEntity::CompoundCurve ) { @@ -114,11 +123,20 @@ namespace { topoFaces.clear(); #if GMSH_MAJOR_VERSION >=4 +#if GMSH_MINOR_VERSION >=3 + for ( size_t i = 0; i < gFace->compound.size(); ++i ) + { + GFace* gF = static_cast< GFace* >( gFace->compound[ i ]); + topoFaces.push_back( ShapeBounds{ gF->bounds(), *((TopoDS_Face*)gF->getNativePtr()) }); + } +#endif +#if GMSH_MINOR_VERSION <3 for ( size_t i = 0; i < gFace->_compound.size(); ++i ) { GFace* gF = static_cast< GFace* >( gFace->_compound[ i ]); topoFaces.push_back( ShapeBounds{ gF->bounds(), *((TopoDS_Face*)gF->getNativePtr()) }); } +#endif #else if ( gFace->geomType() == GEntity::CompoundSurface ) { @@ -446,8 +464,13 @@ void GMSHPlugin_Mesher::FillSMesh() // GET topoEdge CORRESPONDING TO gEdge TopoDS_Edge topoEdge; std::vector< ShapeBounds > topoEdges; - +#if GMSH_MAJOR_VERSION >=4 +#if GMSH_MINOR_VERSION >=3 + if(gEdge->haveParametrization()) +#endif +#else if ( gEdge->geomType() != GEntity::CompoundCurve ) +#endif { topoEdge = *((TopoDS_Edge*)gEdge->getNativePtr()); if (gEdge->getVisibility() == 0) // belongs to a compound @@ -539,7 +562,13 @@ void GMSHPlugin_Mesher::FillSMesh() TopoDS_Face topoFace; std::vector< ShapeBounds > topoFaces; +#if GMSH_MAJOR_VERSION >=4 +#if GMSH_MINOR_VERSION >=3 + if(gFace->haveParametrization()) +#endif +#else if ( gFace->geomType() != GEntity::CompoundSurface ) +#endif { topoFace = *((TopoDS_Face*)gFace->getNativePtr()); if (gFace->getVisibility() == 0) // belongs to a compound @@ -572,7 +601,13 @@ void GMSHPlugin_Mesher::FillSMesh() { GFace *gFace = *it; +#if GMSH_MAJOR_VERSION >=4 +#if GMSH_MINOR_VERSION >=3 + bool isCompound = (!gFace->haveParametrization()); +#endif +#else bool isCompound = ( gFace->geomType() == GEntity::CompoundSurface ); +#endif if ( !isCompound && gFace->getVisibility() == 0 ) continue; // belongs to a compound -- 2.39.2