X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_CartesianParameters3D.cxx;h=5717f0a2c07ea7d7f0edfdd113d97ccbe1246a96;hb=4039f267f1074db87ed73e03bd51ac77b66611e0;hp=6d8135590881ee261260d7d6b46cbcf9074255db;hpb=7a65c9fad427b1ccba6b9ccae612296e5092a324;p=modules%2Fsmesh.git diff --git a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx index 6d8135590..5717f0a2c 100644 --- a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx +++ b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 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 @@ -61,11 +61,13 @@ 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 ) + _toAddEdges( false ), + _toConsiderInternalFaces( false ), + _toUseThresholdForInternalFaces( false ), + _toCreateFaces( false ) { _name = "CartesianParameters3D"; // used by "Cartesian_3D" _param_algo_dim = 3; // 3D @@ -740,6 +742,48 @@ bool StdMeshers_CartesianParameters3D::GetToAddEdges() const return _toAddEdges; } +//======================================================================= +//function : SetToConsiderInternalFaces +//purpose : Enables treatment of geom faces either shared by solids or internal +//======================================================================= + +void StdMeshers_CartesianParameters3D::SetToConsiderInternalFaces(bool toTreat) +{ + if ( _toConsiderInternalFaces != toTreat ) + { + _toConsiderInternalFaces = toTreat; + NotifySubMeshesHypothesisModification(); + } +} + +//======================================================================= +//function : SetToUseThresholdForInternalFaces +//purpose : Enables applying size threshold to grid cells cut by internal geom faces. +//======================================================================= + +void StdMeshers_CartesianParameters3D::SetToUseThresholdForInternalFaces(bool toUse) +{ + if ( _toUseThresholdForInternalFaces != toUse ) + { + _toUseThresholdForInternalFaces = toUse; + NotifySubMeshesHypothesisModification(); + } +} + +//======================================================================= +//function : SetToCreateFaces +//purpose : Enables creation of mesh faces. +//======================================================================= + +void StdMeshers_CartesianParameters3D::SetToCreateFaces(bool toCreate) +{ + if ( _toCreateFaces != toCreate ) + { + _toCreateFaces = toCreate; + NotifySubMeshesHypothesisModification(); + } +} + //======================================================================= //function : IsDefined //purpose : Return true if parameters are well defined @@ -787,63 +831,73 @@ std::ostream & StdMeshers_CartesianParameters3D::SaveTo(std::ostream & save) for ( int i = 0; i < 3; ++i ) save << _fixedPoint[i] << " "; + save << " " << _toConsiderInternalFaces + << " " << _toUseThresholdForInternalFaces + << " " << _toCreateFaces; + return 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]); + + if ( load >> _toConsiderInternalFaces ) + { + load >> _toUseThresholdForInternalFaces; + load >> _toCreateFaces; + } return load; }