OCCT Exception in "Cutting of quadrangles" dialog

This commit is contained in:
eap 2016-01-22 20:29:39 +03:00
parent dbf226547f
commit f0e2178ff8

View File

@ -2939,12 +2939,11 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems,
SMESH_MesherHelper helper( *GetMesh() ); SMESH_MesherHelper helper( *GetMesh() );
TIDSortedElemSet::iterator itElem; TIDSortedElemSet::iterator itElem;
for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) { for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ )
{
const SMDS_MeshElement* elem = *itElem; const SMDS_MeshElement* elem = *itElem;
if ( !elem || elem->GetType() != SMDSAbs_Face ) if ( !elem || elem->GetGeomType() != SMDSGeom_QUADRANGLE )
continue; continue;
bool isquad = elem->NbNodes()==4 || elem->NbNodes()==8;
if(!isquad) continue;
if ( elem->NbNodes() == 4 ) { if ( elem->NbNodes() == 4 ) {
// retrieve element nodes // retrieve element nodes
@ -2980,8 +2979,8 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems,
// Quadratic quadrangle // Quadratic quadrangle
if( elem->NbNodes()==8 && elem->IsQuadratic() ) { else if ( elem->NbNodes() == 8 )
{
// get surface elem is on // get surface elem is on
int aShapeId = FindShape( elem ); int aShapeId = FindShape( elem );
if ( aShapeId != helper.GetSubShapeID() ) { if ( aShapeId != helper.GetSubShapeID() ) {
@ -3001,10 +3000,10 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems,
const SMDS_MeshNode* inFaceNode = 0; const SMDS_MeshNode* inFaceNode = 0;
SMDS_ElemIteratorPtr itN = elem->nodesIterator(); SMDS_ElemIteratorPtr itN = elem->nodesIterator();
int i = 0; int i = 0;
while ( itN->more() ) { if ( helper.GetNodeUVneedInFaceNode() )
while ( itN->more() && !inFaceNode ) {
aNodes[ i++ ] = static_cast<const SMDS_MeshNode*>( itN->next() ); aNodes[ i++ ] = static_cast<const SMDS_MeshNode*>( itN->next() );
if ( !inFaceNode && helper.GetNodeUVneedInFaceNode() && if ( aNodes[ i-1 ]->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE )
aNodes[ i-1 ]->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE )
{ {
inFaceNode = aNodes[ i-1 ]; inFaceNode = aNodes[ i-1 ];
} }