X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_Cartesian_3D.cxx;h=62e590b62e4293f6ba6a621be5db9fb3a33b2b05;hp=139257213412620166fa323e5e133f4dc9e4e9cd;hb=80637e48ef0a19bb89acdf00c98959ab08b5dcc8;hpb=251f8c052dd12dd29922210dc901b295fe999a0e diff --git a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx index 139257213..62e590b62 100644 --- a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx +++ b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -25,6 +25,7 @@ #include "StdMeshers_Cartesian_3D.hxx" #include "SMDS_MeshNode.hxx" +#include "SMESHDS_Mesh.hxx" #include "SMESH_Block.hxx" #include "SMESH_Comment.hxx" #include "SMESH_Mesh.hxx" @@ -35,7 +36,6 @@ #include #include -#include #include @@ -73,6 +73,7 @@ #include #include #include +#include #include #include #include @@ -696,17 +697,17 @@ namespace int& di, double tol ) { //val += values[0]; // input \a val is measured from 0. - if ( i > values.size()-2 ) + if ( i > (int) values.size()-2 ) i = values.size()-2; else - while ( i+2 < values.size() && val > values[ i+1 ]) + while ( i+2 < (int) values.size() && val > values[ i+1 ]) ++i; while ( i > 0 && val < values[ i ]) --i; if ( i > 0 && val - values[ i ] < tol ) di = -1; - else if ( i+2 < values.size() && values[ i+1 ] - val < tol ) + else if ( i+2 < (int) values.size() && values[ i+1 ] - val < tol ) di = 1; else di = 0; @@ -1369,7 +1370,7 @@ namespace } if ( surf->IsKind( STANDARD_TYPE(Geom_BSplineSurface )) || surf->IsKind( STANDARD_TYPE(Geom_BezierSurface ))) - if ( !noSafeTShapes.insert((const Standard_Transient*) _face.TShape() ).second ) + if ( !noSafeTShapes.insert( _face.TShape().get() ).second ) isSafe = false; double f, l; @@ -1409,7 +1410,7 @@ namespace edgeIsSafe = false; } } - if ( !edgeIsSafe && !noSafeTShapes.insert((const Standard_Transient*) e.TShape() ).second ) + if ( !edgeIsSafe && !noSafeTShapes.insert( e.TShape().get() ).second ) isSafe = false; } return isSafe; @@ -1776,7 +1777,7 @@ namespace if ( quad._eIntNodes[ iP ]->IsUsedInFace( polygon )) quad._eIntNodes[ iP ]->_usedInFace = 0; #endif - int nbUsedEdgeNodes = 0; + size_t nbUsedEdgeNodes = 0; _Face* prevPolyg = 0; // polygon previously created from this quad while ( nbSplits > 0 ) @@ -1839,7 +1840,7 @@ namespace else { _OrientedLink foundSplit; - for ( int i = iS; i < splits.size() && !foundSplit; ++i ) + for ( size_t i = iS; i < splits.size() && !foundSplit; ++i ) if (( foundSplit = splits[ i ]) && ( n2->IsLinked( foundSplit.FirstNode()->_intPoint ))) { @@ -2100,7 +2101,7 @@ namespace { sortVertexNodes( chainNodes, curNode, curFace ); } - for ( int i = 0; i < chainNodes.size(); ++i ) + for ( size_t i = 0; i < chainNodes.size(); ++i ) { polygon.AddPolyLink( chainNodes[ i ], curNode ); curNode = chainNodes[ i ]; @@ -2322,9 +2323,9 @@ namespace i = int(lineInd.I()) + dInd[iL][0]; j = int(lineInd.J()) + dInd[iL][1]; k = int(lineInd.K()) + dInd[iL][2]; - if ( i < 0 || i >= nbCells[0] || - j < 0 || j >= nbCells[1] || - k < 0 || k >= nbCells[2] ) continue; + if ( i < 0 || i >= (int) nbCells[0] || + j < 0 || j >= (int) nbCells[1] || + k < 0 || k >= (int) nbCells[2] ) continue; const size_t hexIndex = _grid->CellIndex( i,j,k ); Hexahedron *& hex = allHexa[ hexIndex ]; @@ -2436,7 +2437,7 @@ namespace planes._zProjs [0] = 0; const double zFactor = _grid->_axes[ iDirZ ] * planes._zNorm; const vector< double > & u = _grid->_coords[ iDirZ ]; - for ( int i = 1; i < planes._zProjs.size(); ++i ) + for ( size_t i = 1; i < planes._zProjs.size(); ++i ) { planes._zProjs [i] = zFactor * ( u[i] - u[0] ); } @@ -2459,7 +2460,7 @@ namespace ip._faceIDs = e2fIt->second; ip._shapeID = edgeID; - // discretize the EGDE + // discretize the EDGE GCPnts_UniformDeflection discret( curve, deflection, true ); if ( !discret.IsDone() || discret.NbPoints() < 2 ) continue; @@ -2731,7 +2732,7 @@ namespace chn.back()->IsLinked( quad._eIntNodes[ iP ]->_intPoint )) { chn.push_back( quad._eIntNodes[ iP ]); - found = quad._eIntNodes[ iP ]->_usedInFace = &quad; + found = ( quad._eIntNodes[ iP ]->_usedInFace = &quad ); break; } } while ( found && ! chn.back()->IsLinked( n2->_intPoint ) ); @@ -2823,7 +2824,7 @@ namespace ( !avoidFace || quad._eIntNodes[ iP ]->IsOnFace( avoidFace ))) { chn.push_back( quad._eIntNodes[ iP ]); - found = quad._eIntNodes[ iP ]->_usedInFace = &quad; + found = ( quad._eIntNodes[ iP ]->_usedInFace = &quad ); break; } } while ( found ); @@ -2870,7 +2871,7 @@ namespace { bool isOut = false; - const bool moreIntPoints = ( iP+1 < link._fIntPoints.size() ); + const bool moreIntPoints = ( iP+1 < (int) link._fIntPoints.size() ); // get 2 _Node's _Node* n1 = link._fIntNodes[ iP ]; @@ -2914,7 +2915,7 @@ namespace proj.Perform( testPnt ); if ( proj.IsDone() && proj.NbPoints() > 0 ) { - Quantity_Parameter u,v; + Standard_Real u,v; proj.LowerDistanceParameters( u,v ); if ( proj.LowerDistance() <= 0.1 * _grid->_tol ) @@ -3046,24 +3047,24 @@ namespace else if ( eMidOut != edges.end() ) edges.splice( edges.end(), edges, edges.begin(), eMidOut ); - // sort nodes accoring to the order of edges + // sort nodes according to the order of edges _Node* orderNodes [20]; - TGeomID orderShapeIDs[20]; - int nbN = 0; - TGeomID id, *pID; + //TGeomID orderShapeIDs[20]; + size_t nbN = 0; + TGeomID id, *pID = 0; for ( e = edges.begin(); e != edges.end(); ++e ) { if (( id = _grid->_shapes.FindIndex( SMESH_MesherHelper::IthVertex( 0, *e ))) && (( pID = std::find( &nShapeIds[0], nShapeIdsEnd, id )) != nShapeIdsEnd )) { - orderShapeIDs[ nbN ] = id; + //orderShapeIDs[ nbN ] = id; orderNodes [ nbN++ ] = nodes[ pID - &nShapeIds[0] ]; *pID = -1; } if (( id = _grid->_shapes.FindIndex( *e )) && (( pID = std::find( &nShapeIds[0], nShapeIdsEnd, id )) != nShapeIdsEnd )) { - orderShapeIDs[ nbN ] = id; + //orderShapeIDs[ nbN ] = id; orderNodes [ nbN++ ] = nodes[ pID - &nShapeIds[0] ]; *pID = -1; } @@ -3135,7 +3136,7 @@ namespace if ( !_vIntNodes.empty() ) return false; - const int ijk[3] = { _i, _j, _k }; + const size_t ijk[3] = { _i, _j, _k }; F_IntersectPoint curIntPnt; // consider a cell to be in a hole if all links in any direction @@ -3157,7 +3158,7 @@ namespace const F_IntersectPoint* firstIntPnt = 0; if ( link._nodes[0]->Node() ) // 1st node is a hexa corner { - curIntPnt._paramOnLine = coords[ ijk[ iDir ]] - coords[0]; + curIntPnt._paramOnLine = coords[ ijk[ iDir ]] - coords[0] + _grid->_tol; const GridLine& line = _grid->_lines[ iDir ][ lineIndex[ iL ]]; multiset< F_IntersectPoint >::const_iterator ip = line._intPoints.upper_bound( curIntPnt ); @@ -3387,7 +3388,7 @@ namespace } //================================================================================ /*! - * \brief Classify a point by grid paremeters + * \brief Classify a point by grid parameters */ bool Hexahedron::isOutParam(const double uvw[3]) const { @@ -3536,7 +3537,7 @@ bool StdMeshers_Cartesian_3D::Compute(SMESH_Mesh & theMesh, map< TGeomID, vector< TGeomID > > edge2faceIDsMap; TopExp_Explorer eExp; Bnd_Box shapeBox; - for ( int i = 0; i < faceVec.size(); ++i ) + for ( size_t i = 0; i < faceVec.size(); ++i ) { facesItersectors[i]._face = TopoDS::Face ( faceVec[i] ); facesItersectors[i]._faceID = grid._shapes.Add( faceVec[i] ); @@ -3587,7 +3588,7 @@ bool StdMeshers_Cartesian_3D::Compute(SMESH_Mesh & theMesh, facesItersectors[i].Intersect(); #endif - // put interesection points onto the GridLine's; this is done after intersection + // put intersection points onto the GridLine's; this is done after intersection // to avoid contention of facesItersectors for writing into the same GridLine // in case of parallel work of facesItersectors for ( size_t i = 0; i < facesItersectors.size(); ++i )