X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_ViscousLayers.cxx;h=d4a595ec569aea31bc9945bf67e9e276250fd725;hb=4a87093dce659ebda0d59761cd1a0350c542ab5a;hp=61365b4d60b65a48368d621ea86c54826c0a9839;hpb=42491f3cb5447af200a225c414ff12be011afdfc;p=modules%2Fsmesh.git diff --git a/src/StdMeshers/StdMeshers_ViscousLayers.cxx b/src/StdMeshers/StdMeshers_ViscousLayers.cxx index 61365b4d6..d4a595ec5 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers.cxx @@ -567,20 +567,17 @@ virtual SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const // StdMeshers_ViscousLayers::StdMeshers_ViscousLayers(int hypId, int studyId, SMESH_Gen* gen) :SMESH_Hypothesis(hypId, studyId, gen), - _nbLayers(1), _thickness(1), _stretchFactor(1) + _isToIgnoreShapes(18), _nbLayers(1), _thickness(1), _stretchFactor(1) { _name = StdMeshers_ViscousLayers::GetHypType(); _param_algo_dim = -3; // auxiliary hyp used by 3D algos } // -------------------------------------------------------------------------------- -void StdMeshers_ViscousLayers::SetBndShapesToIgnore(const std::vector& faceIds) +void StdMeshers_ViscousLayers::SetBndShapes(const std::vector& faceIds, bool toIgnore) { - if ( faceIds != _ignoreBndShapeIds ) - _ignoreBndShapeIds = faceIds, NotifySubMeshesHypothesisModification(); -} // -------------------------------------------------------------------------------- -bool StdMeshers_ViscousLayers::IsIgnoredShape(const int shapeID) const -{ - return ( find( _ignoreBndShapeIds.begin(), _ignoreBndShapeIds.end(), shapeID ) - != _ignoreBndShapeIds.end() ); + if ( faceIds != _shapeIds ) + _shapeIds = faceIds, NotifySubMeshesHypothesisModification(); + if ( _isToIgnoreShapes != toIgnore ) + _isToIgnoreShapes = toIgnore, NotifySubMeshesHypothesisModification(); } // -------------------------------------------------------------------------------- void StdMeshers_ViscousLayers::SetTotalThickness(double thickness) { @@ -638,17 +635,22 @@ std::ostream & StdMeshers_ViscousLayers::SaveTo(std::ostream & save) save << " " << _nbLayers << " " << _thickness << " " << _stretchFactor - << " " << _ignoreBndShapeIds.size(); - for ( unsigned i = 0; i < _ignoreBndShapeIds.size(); ++i ) - save << " " << _ignoreBndShapeIds[i]; + << " " << _shapeIds.size(); + for ( unsigned i = 0; i < _shapeIds.size(); ++i ) + save << " " << _shapeIds[i]; + save << " " << !_isToIgnoreShapes; // negate to keep the behavior in old studies. return save; } // -------------------------------------------------------------------------------- std::istream & StdMeshers_ViscousLayers::LoadFrom(std::istream & load) { - int nbFaces, faceID; + int nbFaces, faceID, shapeToTreat; load >> _nbLayers >> _thickness >> _stretchFactor >> nbFaces; - while ( _ignoreBndShapeIds.size() < nbFaces && load >> faceID ) - _ignoreBndShapeIds.push_back( faceID ); + while ( _shapeIds.size() < nbFaces && load >> faceID ) + _shapeIds.push_back( faceID ); + if ( load >> shapeToTreat ) + _isToIgnoreShapes = !shapeToTreat; + else + _isToIgnoreShapes = true; // old behavior return load; } // -------------------------------------------------------------------------------- bool StdMeshers_ViscousLayers::SetParametersByMesh(const SMESH_Mesh* theMesh, @@ -1072,7 +1074,7 @@ bool _ViscousBuilder::findFacesWithLayers() vector ignoreFaces; for ( unsigned i = 0; i < _sdVec.size(); ++i ) { - vector ids = _sdVec[i]._hyp->GetBndShapesToIgnore(); + vector ids = _sdVec[i]._hyp->GetBndShapes(); for ( unsigned i = 0; i < ids.size(); ++i ) { const TopoDS_Shape& s = getMeshDS()->IndexToShape( ids[i] );