22361: EDF SMESH: Quadrangle (mapping) algorithm: faces with more than 4 edges

Fix "int WrapIndex(const int ind, const int nbNodes)" for ind=-4 and nbNodes=4
This commit is contained in:
eap 2013-11-22 12:34:45 +00:00
parent 3ad5d5a2d3
commit 0280d2e6a7

View File

@ -140,10 +140,8 @@ class SMESH_EXPORT SMESH_MesherHelper
* \param nbNodes - total nb of nodes
* \retval int - valid node index
*/
static int WrapIndex(const int ind, const int nbNodes) {
if ( ind < 0 ) return nbNodes + ind % nbNodes;
if ( ind >= nbNodes ) return ind % nbNodes;
return ind;
static inline int WrapIndex(int ind, const int nbNodes) {
return (( ind %= nbNodes ) < 0 ) ? ind + nbNodes : ind;
}
/*!