X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_Hexa_3D.cxx;h=0271fc41ce80197d965c1425b2d1ef587339a42d;hb=26d8315709a200999b0ee826e14799fa8985a4f5;hp=f6dcd1518ecc8f24d801c66a41acd863ee09706e;hpb=b0a908c0d20341651771d0249fb10882f54b2aad;p=modules%2Fsmesh.git diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.cxx b/src/StdMeshers/StdMeshers_Hexa_3D.cxx index f6dcd1518..0271fc41c 100644 --- a/src/StdMeshers/StdMeshers_Hexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_Hexa_3D.cxx @@ -287,9 +287,9 @@ namespace //============================================================================= /*! * Generates hexahedron mesh on hexaedron like form using algorithm from - * "Application de l'interpolation transfinie à la création de maillages + * "Application de l'interpolation transfinie � la cr�ation de maillages * C0 ou G1 continus sur des triangles, quadrangles, tetraedres, pentaedres - * et hexaedres déformés." + * et hexaedres d�form�s." * Alain PERONNET - 8 janvier 1999 */ //============================================================================= @@ -741,6 +741,39 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper return error( algo->GetComputeError()); } +//================================================================================ +/*! + * \brief Return true if the algorithm can mesh this shape + * \param [in] aShape - shape to check + * \param [in] toCheckAll - if true, this check returns OK if all shapes are OK, + * else, returns OK if at least one shape is OK + */ +//================================================================================ + +bool StdMeshers_Hexa_3D::IsApplicable( const TopoDS_Shape & aShape, bool toCheckAll ) +{ + TopExp_Explorer exp0( aShape, TopAbs_SOLID ); + if ( !exp0.More() ) return false; + + for ( ; exp0.More(); exp0.Next() ) + { + int nbFoundShells = 0; + TopExp_Explorer exp1( exp0.Current(), TopAbs_SHELL ); + for ( ; exp1.More(); exp1.Next(), ++nbFoundShells) + if ( nbFoundShells == 2 ) break; + if ( nbFoundShells != 1 ) { + if ( toCheckAll ) return false; + continue; + } + exp1.Init( exp0.Current(), TopAbs_FACE ); + int nbEdges = SMESH_MesherHelper::Count( exp1.Current(), TopAbs_EDGE, /*ignoreSame=*/true ); + bool ok = ( nbEdges > 3 ); + if ( toCheckAll && !ok ) return false; + if ( !toCheckAll && ok ) return true; + } + return toCheckAll; +}; + //======================================================================= //function : ComputePentahedralMesh //purpose :