From: fkl Date: Thu, 15 Sep 2011 09:42:56 +0000 (+0000) Subject: Merge from correction done by HAMMI 500 / MANTIS 21358 X-Git-Tag: V6_4_0a1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5054ed64bf435ccbffb39e55208c3a0ecb21a577;p=plugins%2Fhexablockplugin.git Merge from correction done by HAMMI 500 / MANTIS 21358 Francis Kloss --- diff --git a/src/HEXABLOCKPlugin/HEXABLOCKPlugin_FromSkin_3D.cxx b/src/HEXABLOCKPlugin/HEXABLOCKPlugin_FromSkin_3D.cxx index 2c956e8..a22c2b7 100755 --- a/src/HEXABLOCKPlugin/HEXABLOCKPlugin_FromSkin_3D.cxx +++ b/src/HEXABLOCKPlugin/HEXABLOCKPlugin_FromSkin_3D.cxx @@ -90,37 +90,6 @@ namespace return true; } - //================================================================================ - /*! - * \brief Description of node used to detect corner nodes - */ - struct _NodeDescriptor - { - int nbInverseFaces, nbNodesInInverseFaces; - - _NodeDescriptor(const SMDS_MeshNode* n): nbInverseFaces(0), nbNodesInInverseFaces(0) - { - if ( n ) - { - set nodes; - SMDS_ElemIteratorPtr fIt = n->GetInverseElementIterator(SMDSAbs_Face ); - while ( fIt->more() ) - { - const SMDS_MeshElement* face = fIt->next(); - nodes.insert( face->begin_nodes(), face->end_nodes() ); - nbInverseFaces++; - } - nbNodesInInverseFaces = nodes.size(); - } - } - bool operator==(const _NodeDescriptor& other) const - { - return - nbInverseFaces == other.nbInverseFaces && - nbNodesInInverseFaces == other.nbNodesInInverseFaces; - } - }; - //================================================================================ /*! * \brief return true if a node is at block corner @@ -131,7 +100,19 @@ namespace bool isCornerNode( const SMDS_MeshNode* n ) { - return n && n->NbInverseElements( SMDSAbs_Face ) % 2; + int nbF = n ? n->NbInverseElements( SMDSAbs_Face ) : 1; + if ( nbF % 2 ) + return true; + + set nodesInInverseFaces; + SMDS_ElemIteratorPtr fIt = n->GetInverseElementIterator(SMDSAbs_Face ); + while ( fIt->more() ) + { + const SMDS_MeshElement* face = fIt->next(); + nodesInInverseFaces.insert( face->begin_nodes(), face->end_nodes() ); + } + + return nodesInInverseFaces.size() != ( 6 + (nbF/2-1)*3 ); } //================================================================================ @@ -854,14 +835,12 @@ namespace row2.push_back( n1 = oppositeNode( quad, i1 )); } - _NodeDescriptor nDesc( row1[1] ); - if ( nDesc == _NodeDescriptor( row1[0] )) - return true; // row of 2 nodes + if ( isCornerNode( row1[1] )) + return true; // Find the rest nodes TIDSortedElemSet emptySet, avoidSet; - //while ( !isCornerNode( n2 )) - while ( nDesc == _NodeDescriptor( n2 )) + while ( !isCornerNode( n2 ) ) { avoidSet.clear(); avoidSet.insert( quad ); quad = SMESH_MeshEditor::FindFaceInSet( n1, n2, emptySet, avoidSet, &i1, &i2 );