From b8917880e4fa9abc35a42386a76dd222c6ff7ad6 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 9 Apr 2019 19:11:56 +0300 Subject: [PATCH] Quality Info: tolerance change does not influence on Nb double nodes --- src/Controls/SMESH_Controls.cxx | 13 +++++++++++++ src/Controls/SMESH_ControlsDef.hxx | 4 ++-- src/SMESHGUI/SMESHGUI_MeshInfo.cxx | 12 +++++++++--- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index c40f590a4..06c40dae2 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -2436,6 +2436,15 @@ SMDSAbs_ElementType CoincidentNodes::GetType() const return SMDSAbs_Node; } +void CoincidentNodes::SetTolerance( const double theToler ) +{ + if ( myToler != theToler ) + { + SetMesh(0); + myToler = theToler; + } +} + void CoincidentNodes::SetMesh( const SMDS_Mesh* theMesh ) { myMeshModifTracer.SetMesh( theMesh ); @@ -4897,6 +4906,8 @@ void BelongToGeom::SetMesh( const SMDS_Mesh* theMesh ) myMeshDS = dynamic_cast(theMesh); init(); } + if ( myElementsOnShapePtr ) + myElementsOnShapePtr->SetMesh( myMeshDS ); } void BelongToGeom::SetGeom( const TopoDS_Shape& theShape ) @@ -5073,6 +5084,8 @@ void LyingOnGeom::SetMesh( const SMDS_Mesh* theMesh ) myMeshDS = dynamic_cast(theMesh); init(); } + if ( myElementsOnShapePtr ) + myElementsOnShapePtr->SetMesh( myMeshDS ); } void LyingOnGeom::SetGeom( const TopoDS_Shape& theShape ) diff --git a/src/Controls/SMESH_ControlsDef.hxx b/src/Controls/SMESH_ControlsDef.hxx index 1d412b4ba..907157598 100644 --- a/src/Controls/SMESH_ControlsDef.hxx +++ b/src/Controls/SMESH_ControlsDef.hxx @@ -419,7 +419,7 @@ namespace SMESH{ virtual bool IsSatisfy( long theElementId ); virtual SMDSAbs_ElementType GetType() const; - void SetTolerance (const double theToler) { myToler = theToler; } + void SetTolerance (const double theToler); double GetTolerance () const { return myToler; } private: @@ -819,7 +819,7 @@ namespace SMESH{ ~ManifoldPart(); //virtual Predicate* clone() const { return new ManifoldPart( *this ); } virtual void SetMesh( const SMDS_Mesh* theMesh ); - // inoke when all parameters already set + // invoke when all parameters already set virtual bool IsSatisfy( long theElementId ); virtual SMDSAbs_ElementType GetType() const; diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx index 57b1c9343..fc5ac8b73 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx @@ -3911,9 +3911,15 @@ void SMESHGUI_CtrlInfo::clearInternal() void SMESHGUI_CtrlInfo::setTolerance( double theTolerance ) { - //SMESH::long_array_var anElems = getElementsByType( SMESH::NODE ); - myButtons[1]->setEnabled( true ); - myWidgets[2]->setText(""); + myButtons[2]->setEnabled( true ); + myWidgets[3]->setText(""); + for ( int i = 0; i < myPredicates.count(); ++i ) + if ( myPredicates[i]->GetFunctorType() == SMESH::FT_EqualNodes ) + { + SMESH::EqualNodes_var functor = SMESH::EqualNodes::_narrow( myPredicates[i] ); + if ( !functor->_is_nil() ) + functor->SetTolerance( theTolerance ); + } } #ifndef DISABLE_PLOT2DVIEWER -- 2.30.2