+ //================================================================================
+ /*!
+ * \brief Checks if the two arrays of node IDs describe nodes with equal coordinates
+ */
+ //================================================================================
+
+ bool isEqualNodes( const int* nIds1, const int* nIds2, int nbNodes, SMESHDS_Mesh* mesh )
+ {
+ if ( nbNodes > 0 )
+ {
+ SMESH_TNodeXYZ nn1[2], nn2[2];
+ nn1[0] = mesh->FindNode( nIds1[0] );
+ nn2[0] = mesh->FindNode( nIds2[0] );
+ if ( !nn1[0]._node || !nn2[0]._node )
+ return false;
+ double dist1 = ( nn1[0] - nn2[0] ).Modulus();
+ double dist2 = 0, tol = 1e-7;
+ if ( nbNodes > 1 )
+ {
+ nn1[1] = mesh->FindNode( nIds1[1] );
+ nn2[1] = mesh->FindNode( nIds2[1] );
+ if ( !nn1[1]._node || !nn2[1]._node )
+ return false;
+ dist2 = ( nn1[1] - nn2[1] ).Modulus();
+ tol = 1e-5 * ( nn1[0] - nn1[1] ).Modulus();
+ }
+ return ( dist1 < tol && dist2 < tol );
+ }
+ return false;
+ }
+