X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_CartesianParameters3D.cxx;h=21bc0bbb180e147ae57cd93170045406d5d8247e;hb=93781217abf598f9815e290739ef6b579007308a;hp=60b9532d414aa6fe433e8295de49960f9cd47a9a;hpb=cc9e7d544292b687b0cc729bc455c147bd65ac54;p=modules%2Fsmesh.git diff --git a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx index 60b9532d4..21bc0bbb1 100644 --- a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx +++ b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2019 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 @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -61,9 +61,8 @@ using namespace std; //======================================================================= StdMeshers_CartesianParameters3D::StdMeshers_CartesianParameters3D(int hypId, - int studyId, SMESH_Gen * gen) - : SMESH_Hypothesis(hypId, studyId, gen), + : SMESH_Hypothesis(hypId, gen), _sizeThreshold( 4.0 ), // default according to the customer specification _toAddEdges( false ) { @@ -240,6 +239,7 @@ bool StdMeshers_CartesianParameters3D::GetFixedPoint(double p[3]) const if ( Precision::IsInfinite( _fixedPoint[0] )) return false; std::copy( &_fixedPoint[0], &_fixedPoint[0]+3, &p[0] ); + return true; } @@ -329,7 +329,7 @@ void StdMeshers_CartesianParameters3D::ComputeCoordinates(const double x0, coords.clear(); for ( size_t i = 0; i < spaceFuns.size(); ++i ) { - FunctionExpr fun( spaceFuns[i].c_str(), /*convMode=*/-1 ); + StdMeshers::FunctionExpr fun( spaceFuns[i].c_str(), /*convMode=*/-1 ); const double p0 = x0 * ( 1. - points[i]) + x1 * points[i]; const double p1 = x0 * ( 1. - points[i+1]) + x1 * points[i+1]; @@ -371,7 +371,7 @@ void StdMeshers_CartesianParameters3D::ComputeCoordinates(const double x0, // correct coords if a forced point is too close to a neighbor node if ( forced ) { - int iF = 0; + size_t iF = 0; double minLen = ( x1 - x0 ); for ( size_t i = 1; i < coords.size(); ++i ) { @@ -522,9 +522,8 @@ ComputeOptimalAxesDirs(const TopoDS_Shape& shape, const TCooTriple* norm1 = 0; double sumArea = 0; vector< const TCooTriple* > norms; - for ( int iF = 1; norm2a != areasByNormal.end(); ++norm2a, ++iF ) + for ( size_t iF = 1; norm2a != areasByNormal.end(); ++norm2a, ++iF ) { - if ( !norm1 || !sameDir( *norm1, norm2a->first )) { if ( !norms.empty() ) @@ -792,58 +791,58 @@ std::ostream & StdMeshers_CartesianParameters3D::SaveTo(std::ostream & save) //======================================================================= //function : LoadFrom -//purpose : resore my parameters from a stream +//purpose : restore my parameters from a stream //======================================================================= std::istream & StdMeshers_CartesianParameters3D::LoadFrom(std::istream & load) { bool ok; - ok = ( load >> _sizeThreshold ); + ok = static_cast( load >> _sizeThreshold ); for ( int ax = 0; ax < 3; ++ax ) { if (ok) { size_t i = 0; - ok = (load >> i ); + ok = static_cast(load >> i ); if ( i > 0 && ok ) { _coords[ax].resize( i ); for ( i = 0; i < _coords[ax].size() && ok; ++i ) - ok = (load >> _coords[ax][i] ); + ok = static_cast(load >> _coords[ax][i] ); } } if (ok) { size_t i = 0; - ok = (load >> i ); + ok = static_cast(load >> i ); if ( i > 0 && ok ) { _internalPoints[ax].resize( i ); for ( i = 0; i < _internalPoints[ax].size() && ok; ++i ) - ok = (load >> _internalPoints[ax][i] ); + ok = static_cast(load >> _internalPoints[ax][i] ); } } if (ok) { size_t i = 0; - ok = (load >> i ); + ok = static_cast(load >> i ); if ( i > 0 && ok ) { _spaceFunctions[ax].resize( i ); for ( i = 0; i < _spaceFunctions[ax].size() && ok; ++i ) - ok = (load >> _spaceFunctions[ax][i] ); + ok = static_cast(load >> _spaceFunctions[ax][i] ); } } } - ok = ( load >> _toAddEdges ); + ok = static_cast( load >> _toAddEdges ); for ( int i = 0; i < 9 && ok; ++i ) - ok = ( load >> _axisDirs[i]); + ok = static_cast( load >> _axisDirs[i]); for ( int i = 0; i < 3 && ok ; ++i ) - ok = ( load >> _fixedPoint[i]); + ok = static_cast( load >> _fixedPoint[i]); return load; }