From: eap Date: Mon, 23 Mar 2009 08:00:51 +0000 (+0000) Subject: simply code X-Git-Tag: V5_1_2rc1~76 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=73a829efdfe513595f56fbb8184d0869acd5b2f0;p=modules%2Fsmesh.git simply code --- diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 38eca5bf8..3e51f4a93 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -2774,8 +2774,6 @@ void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement* elem, int iNode, nbSame = 0, iNotSameNode = 0, iSameNode = 0; vector sames(nbNodes); - - //bool issimple[nbNodes]; vector issimple(nbNodes); for ( iNode = 0; iNode < nbNodes; iNode++ ) { @@ -2785,12 +2783,7 @@ void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement* elem, if ( listNewNodes.empty() ) return; - if(listNewNodes.size()==nbSteps) { - issimple[iNode] = true; - } - else { - issimple[iNode] = false; - } + issimple[iNode] = (listNewNodes.size()==nbSteps); itNN[ iNode ] = listNewNodes.begin(); prevNod[ iNode ] = node; @@ -2835,11 +2828,8 @@ void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement* elem, //MESSAGE("Reversed elem " << elem ); i0 = 2; i2 = 0; - if ( nbSame > 0 ) { - int iAB = iAfterSame + iBeforeSame; - iBeforeSame = iAB - iBeforeSame; - iAfterSame = iAB - iAfterSame; - } + if ( nbSame > 0 ) + std::swap( iAfterSame, iAfterSame ); } // make new elements @@ -2858,8 +2848,7 @@ void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement* elem, nextNod[ iNode ] = *itNN[ iNode ]; itNN[ iNode ]++; } - else if(!elem->IsQuadratic() || - elem->IsQuadratic() && elem->IsMediumNode(prevNod[iNode]) ) { + else if(!elem->IsQuadratic() || elem->IsMediumNode(prevNod[iNode]) ) { // we have to use each second node itNN[ iNode ]++; nextNod[ iNode ] = *itNN[ iNode ];