From: eap Date: Wed, 6 Feb 2013 13:04:40 +0000 (+0000) Subject: 0022091: [CEA 760] Regression on test test check_mesh_stability.py X-Git-Tag: pluginMGCleaner~134 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9016043d99071982060b9fbc5d2d67eeefcf9e9f;p=modules%2Fsmesh.git 0022091: [CEA 760] Regression on test test check_mesh_stability.py + void SetIgnoreMediumNodes(bool toIgnore); --- diff --git a/src/StdMeshers/StdMeshers_FaceSide.cxx b/src/StdMeshers/StdMeshers_FaceSide.cxx index 8cad4eae1..37bc6c346 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.cxx +++ b/src/StdMeshers/StdMeshers_FaceSide.cxx @@ -611,6 +611,33 @@ void StdMeshers_FaceSide::Reverse() } } +//======================================================================= +//function : SetIgnoreMediumNodes +//purpose : Make ignore medium nodes +//======================================================================= + +void StdMeshers_FaceSide::SetIgnoreMediumNodes(bool toIgnore) +{ + if ( myIgnoreMediumNodes != toIgnore ) + { + myIgnoreMediumNodes = toIgnore; + + if ( !myPoints.empty() ) + { + UVPtStructVec newPoints; + newPoints.reserve( myPoints.size()/2 + 1 ); + for ( size_t i = 0; i < myPoints.size(); i += 2 ) + newPoints.push_back( myPoints[i] ); + + myPoints.swap( newPoints ); + } + else + { + NbPoints( /*update=*/true ); + } + } +} + //======================================================================= //function : NbPoints //purpose : Return nb nodes on edges and vertices (+1 to be == GetUVPtStruct().size() ) @@ -648,7 +675,8 @@ int StdMeshers_FaceSide::NbPoints(const bool update) const if ( elemIt->more() && elemIt->next()->IsQuadratic() ) nbN -= sm->NbElements(); } - me->myNbPonits += nbN; + me->myNbPonits += nbN; + me->myNbSegments += sm->NbElements(); } } TopoDS_Vertex v1 = SMESH_MesherHelper::IthVertex( 1, Edge( NbEdges()-1 )); @@ -669,7 +697,7 @@ int StdMeshers_FaceSide::NbPoints(const bool update) const int StdMeshers_FaceSide::NbSegments(const bool update) const { - return Max( 0, NbPoints( update ) - 1 ); + return NbPoints( update ), myNbSegments; } //================================================================================ diff --git a/src/StdMeshers/StdMeshers_FaceSide.hxx b/src/StdMeshers/StdMeshers_FaceSide.hxx index 6f367226c..b4ab06966 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.hxx +++ b/src/StdMeshers/StdMeshers_FaceSide.hxx @@ -101,6 +101,11 @@ public: * \brief Change orientation of side geometry */ void Reverse(); + /*! + * \brief Make ignore medium nodes + */ + void SetIgnoreMediumNodes(bool toIgnore); + /*! * \brief Return nb nodes on edges and vertices (+1 to be == GetUVPtStruct().size() ). * Call it with update == true if mesh of this side can be recomputed @@ -121,6 +126,7 @@ public: * \brief Return true if there are vertices without nodes */ bool MissVertexNode() const { return myMissingVertexNodes; } + /*! * \brief Return detailed data on nodes * \param isXConst - true if normalized parameter X is constant @@ -143,6 +149,7 @@ public: * For a closed side, the 1st point repeats at end */ std::vector GetOrderedNodes() const; + /*! * \brief Return edge and parameter on edge by normalized parameter */