From 830c88cc3a76f364165f19cdfad6f8ae0a39b361 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 12 Nov 2018 16:42:33 +0300 Subject: [PATCH 01/10] 54462: Hexa(ijk) fails on a composite block with a degenerated edge --- src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx index ec02f71e1..a023ae623 100644 --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx @@ -893,6 +893,8 @@ bool _QuadFaceGrid::Init(const TopoDS_Face& f, SMESH_Mesh& mesh) while ( !edges.empty()) { sideEdges.clear(); sideEdges.splice( sideEdges.end(), edges, edges.begin());// edges.front()->sideEdges.back() + if ( SMESH_Algo::isDegenerated( sideEdges.back() )) + continue; while ( !edges.empty() ) { if ( SMESH_Algo::IsContinuous( sideEdges.back(), edges.front() )) { sideEdges.splice( sideEdges.end(), edges, edges.begin()); From 4be45a651bfe5cb6f5f82d678257d6da63f532a2 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 13 Nov 2018 19:28:05 +0300 Subject: [PATCH 02/10] 54462: Hexa(ijk) fails on a composite block with a degenerated edge (note 0509712) --- .../StdMeshers_CompositeHexa_3D.cxx | 41 +++++++++++++++---- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx index a023ae623..3d3a28d6a 100644 --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx @@ -312,13 +312,15 @@ namespace if ( !TopExp::CommonVertex( E1, E2, V )) return false; const SMDS_MeshNode* n = SMESH_Algo::VertexNode( V, mesh.GetMeshDS() ); - if ( !n ) return false; + if ( !n ) return SMESH_Algo::IsContinuous( E1, E2 ); // meshed by "composite segment" SMESHDS_SubMesh* sm = mesh.GetSubMeshContaining( F )->GetSubMeshDS(); if ( !sm ) return false; int nbQuads = 0; SMDS_ElemIteratorPtr fIt = n->GetInverseElementIterator(SMDSAbs_Face); + if ( !fIt->more() ) + return SMESH_Algo::IsContinuous( E1, E2 ); // meshed by "composite segment" while ( fIt->more() ) { const SMDS_MeshElement* f = fIt->next(); @@ -332,6 +334,28 @@ namespace return nbQuads == 2; } + //================================================================================ + /*! + * \brief Return true if a vertex holds a node and this node is used by some quadrangle + */ + //================================================================================ + + // bool isMeshedVertex( TopoDS_Vertex& V, + // const SMESH_Mesh& mesh ) + // { + // const SMDS_MeshNode* n = SMESH_Algo::VertexNode( V, mesh.GetMeshDS() ); + // if ( !n ) return false; + + // SMDS_ElemIteratorPtr fIt = n->GetInverseElementIterator(SMDSAbs_Face); + // while ( fIt->more() ) + // { + // const SMDS_MeshElement* f = fIt->next(); + // if ( f->NbCornerNodes() == 4 ) + // return true; + // } + // return false; + // } + //================================================================================ /*! * \brief Finds VERTEXes located at block corners @@ -896,13 +920,7 @@ bool _QuadFaceGrid::Init(const TopoDS_Face& f, SMESH_Mesh& mesh) if ( SMESH_Algo::isDegenerated( sideEdges.back() )) continue; while ( !edges.empty() ) { - if ( SMESH_Algo::IsContinuous( sideEdges.back(), edges.front() )) { - sideEdges.splice( sideEdges.end(), edges, edges.begin()); - } - else if ( SMESH_Algo::IsContinuous( sideEdges.front(), edges.back() )) { - sideEdges.splice( sideEdges.begin(), edges, --edges.end()); - } - else if ( isContinuousMesh( sideEdges.back(), edges.front(), f, mesh )) { + if ( isContinuousMesh( sideEdges.back(), edges.front(), f, mesh )) { sideEdges.splice( sideEdges.end(), edges, edges.begin()); } else if ( isContinuousMesh( sideEdges.front(), edges.back(), f, mesh )) { @@ -1946,6 +1964,13 @@ bool _FaceSide::StoreNodes(SMESH_Mesh& mesh, nodes); if ( !ok ) return false; + // skip nodes on VERTEXes not included in faces + if ( !nodes.begin()->second->GetInverseElementIterator(SMDSAbs_Face)->more() ) + nodes.erase( nodes.begin() ); + if ( !nodes.empty() && + !nodes.rbegin()->second->GetInverseElementIterator(SMDSAbs_Face)->more() ) + nodes.erase( --nodes.end() ); + bool forward = ( edge->Orientation() == TopAbs_FORWARD ); if ( reverse ) forward = !forward; if ( forward ) From 5ec2574399111a48b08c6e765466efc7fa175587 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 14 Nov 2018 16:41:52 +0300 Subject: [PATCH 03/10] Crash after pre-viewing mesh translation --- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 7 +++---- src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx | 2 +- src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx | 4 ++-- src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx | 8 ++++---- src/SMESHGUI/SMESHGUI_MeshEditPreview.h | 2 +- src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_PreviewDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx | 4 ++-- src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx | 2 +- 12 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index e5ad4a878..a40bac0d4 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -1339,7 +1339,7 @@ void SMESHGUI_BaseComputeOp::onShowBadMesh() prop->SetPointSize( aPointSize * 3 ); prop->SetColor( 250, 0, 250 ); myBadMeshDisplayer->GetActor()->SetProperty( prop ); - myBadMeshDisplayer->SetData( aMeshData._retn() ); + myBadMeshDisplayer->SetData( aMeshData.in() ); prop->Delete(); } } @@ -1979,11 +1979,10 @@ void SMESHGUI_PrecomputeOp::onPreview() SMESH::MeshPreviewStruct_var previewData = gen->Precompute(myMesh, myMainShape, (SMESH::Dimension)dim, aShapesId); - SMESH::MeshPreviewStruct* previewRes = previewData._retn(); - if ( previewRes && previewRes->nodesXYZ.length() > 0 ) + if ( & previewData.in() && previewData->nodesXYZ.length() > 0 ) { computeFailed = false; - myPreviewDisplayer->SetData( previewRes ); + myPreviewDisplayer->SetData( previewData ); // append shape indices with computed mesh entities for ( int i = 0, n = aShapesId->length(); i < n; i++ ) myMapShapeId[ aShapesId[ i ] ] = 0; diff --git a/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx b/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx index 3b038c5ff..ad0c20a81 100644 --- a/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx +++ b/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx @@ -265,7 +265,7 @@ bool SMESHGUI_ConvToQuadOp::onApply() prop->Delete(); SMESH::MeshPreviewStruct_var previewData = aEditor->GetPreviewData(); - myBadElemsPreview->SetData( previewData._retn() ); + myBadElemsPreview->SetData( previewData.in() ); myBadElemsPreview->SetVisibility(true); SUIT_MessageBox* mb = new SUIT_MessageBox(SUIT_MessageBox::Warning, diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx index cae3a0589..0ad8681df 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx @@ -1112,7 +1112,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::onDisplaySimulation( bool toDisplayPreview if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK ) { SMESH::MeshPreviewStruct_var aMeshPreviewStruct = meshEditor->GetPreviewData(); - mySimulation->SetData( aMeshPreviewStruct._retn() ); + mySimulation->SetData( aMeshPreviewStruct.in() ); } else { hidePreview(); diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx index b1e89e012..d17be56aa 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx @@ -1573,7 +1573,7 @@ void SMESHGUI_ExtrusionDlg::onDisplaySimulation( bool toDisplayPreview ) makeGroups ); } SMESH::MeshPreviewStruct_var aMeshPreviewStruct = meshEditor->GetPreviewData(); - mySimulation->SetData(aMeshPreviewStruct._retn()); + mySimulation->SetData(aMeshPreviewStruct); } catch (...) { hidePreview(); diff --git a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx index 701fef8e4..719b8ebb9 100644 --- a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx @@ -536,7 +536,7 @@ void SMESHGUI_FindElemByPointOp::redisplayPreview() myPreview->nodesXYZ[0].z = myDlg->myZ->GetValue(); if (!mySimulation) mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI )); - mySimulation->SetData( myPreview._retn()); + mySimulation->SetData( myPreview.in()); } //================================================================================ diff --git a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx index 3c131f2b1..f1b55af95 100644 --- a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx @@ -811,9 +811,9 @@ void SMESHGUI_MakeNodeAtPointOp::redisplayPreview() if (!mySimulation) mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI )); // display data - if ( aMeshPreviewStruct.operator->() ) + if ( & aMeshPreviewStruct.in() ) { - mySimulation->SetData(aMeshPreviewStruct._retn()); + mySimulation->SetData( aMeshPreviewStruct.in() ); } else { diff --git a/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx b/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx index 1e58474dd..0ebdfe5fd 100644 --- a/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx @@ -167,10 +167,10 @@ vtkIdType getCellType( const SMDSAbs_ElementType theType, */ //================================================================================ -void SMESHGUI_MeshEditPreview::SetData (const SMESH::MeshPreviewStruct_var previewData) +void SMESHGUI_MeshEditPreview::SetData (const SMESH::MeshPreviewStruct& previewData) { // Create points - const SMESH::nodes_array& aNodesXYZ = previewData->nodesXYZ; + const SMESH::nodes_array& aNodesXYZ = previewData.nodesXYZ; vtkPoints* aPoints = vtkPoints::New(); aPoints->SetNumberOfPoints(aNodesXYZ.length()); @@ -182,8 +182,8 @@ void SMESHGUI_MeshEditPreview::SetData (const SMESH::MeshPreviewStruct_var previ aPoints->Delete(); // Create cells - const SMESH::long_array& anElemConnectivity = previewData->elementConnectivities; - const SMESH::types_array& anElemTypes = previewData->elementTypes; + const SMESH::long_array& anElemConnectivity = previewData.elementConnectivities; + const SMESH::types_array& anElemTypes = previewData.elementTypes; vtkIdType aCellsSize = anElemConnectivity.length() + anElemTypes.length(); vtkIdType aNbCells = anElemTypes.length(); diff --git a/src/SMESHGUI/SMESHGUI_MeshEditPreview.h b/src/SMESHGUI/SMESHGUI_MeshEditPreview.h index 6d58999ad..f7873298e 100644 --- a/src/SMESHGUI/SMESHGUI_MeshEditPreview.h +++ b/src/SMESHGUI/SMESHGUI_MeshEditPreview.h @@ -57,7 +57,7 @@ public: SMESHGUI_MeshEditPreview( SVTK_ViewWindow* ); ~SMESHGUI_MeshEditPreview(); - void SetData( const SMESH::MeshPreviewStruct_var ); + void SetData( const SMESH::MeshPreviewStruct& ); void SetVisibility( bool ); void SetColor( double, double, double ); diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index a1d1f3e6b..19a08d1b9 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -1242,7 +1242,7 @@ void SMESHGUI_UnionOfTrianglesDlg::onDisplaySimulation( bool toDisplayPreview ) mySimulation->GetActor()->SetProperty( aProp ); aProp->Delete(); - mySimulation->SetData( aMeshPreviewStruct._retn() ); + mySimulation->SetData( aMeshPreviewStruct.in() ); } catch ( ... ) { hidePreview(); } diff --git a/src/SMESHGUI/SMESHGUI_PreviewDlg.cxx b/src/SMESHGUI/SMESHGUI_PreviewDlg.cxx index f1f1a1f11..99158f806 100644 --- a/src/SMESHGUI/SMESHGUI_PreviewDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_PreviewDlg.cxx @@ -248,7 +248,7 @@ void SMESHGUI_MultiPreviewDlg::setSimulationPreview( QListSetData( theMeshPreviewStruct[i].operator->() ); + mySimulationList[i]->SetData( theMeshPreviewStruct[i].in() ); } } diff --git a/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx b/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx index 51c993fd5..a83e66bee 100644 --- a/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx @@ -933,9 +933,9 @@ void SMESHGUI_ReorientFacesOp::redisplayPreview() // } // // display data -// if ( aMeshPreviewStruct.operator->() ) +// if ( & aMeshPreviewStruct.in() ) // { -// myVectorPreview->SetData(aMeshPreviewStruct._retn()); +// myVectorPreview->SetData(aMeshPreviewStruct.in()); // } // else // { diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index 30be2c543..11aae4d21 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -796,7 +796,7 @@ void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview) anAxis, anAngle, aNbSteps, aTolerance, makeGroups ); SMESH::MeshPreviewStruct_var aMeshPreviewStruct = meshEditor->GetPreviewData(); - mySimulation->SetData( aMeshPreviewStruct._retn() ); + mySimulation->SetData( aMeshPreviewStruct.in() ); } catch (...) {} } From d733cdc04dd1214a0cea64ff31ad5e4d6578f84c Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 14 Nov 2018 20:08:15 +0300 Subject: [PATCH 04/10] 0054463: Refactor salome_test.py --- bin/CMakeLists.txt | 1 + bin/smesh_test.py | 122 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 bin/smesh_test.py diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index a60ce61e1..2dc1bac7e 100755 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -24,6 +24,7 @@ SALOME_CONFIGURE_FILE(VERSION.in VERSION INSTALL ${SALOME_INSTALL_BINS}) # scripts / static SET(_bin_SCRIPTS smesh_setenv.py + smesh_test.py ) # --- rules --- diff --git a/bin/smesh_test.py b/bin/smesh_test.py new file mode 100644 index 000000000..3fb5ad93b --- /dev/null +++ b/bin/smesh_test.py @@ -0,0 +1,122 @@ +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2018 CEA/DEN, EDF R&D, OPEN CASCADE +# +# 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, 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 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +import unittest + +class TestMesh(unittest.TestCase): + + def setUp(self): + import salome + salome.salome_init() + + def processGuiEvents(self): + import salome + if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser(); + import SalomePyQt + SalomePyQt.SalomePyQt().processEvents() + + def test_mesh(self): + """Quick test for Mesh module""" + + print() + print('Testing Mesh module') + + # ==== Geometry part ==== + + from salome.geom import geomBuilder + geompy = geomBuilder.New() + + # ---- create box + print('... Create box') + box = geompy.MakeBox(0., 0., 0., 100., 200., 300) + self.assertIsNotNone(box) + self.processGuiEvents() + + # ==== Mesh part ==== + + import SMESH + from salome.smesh import smeshBuilder + smesh = smeshBuilder.New() + lib = 'StdMeshersEngine' + self.processGuiEvents() + + # ---- create hypotheses + print('... Create hypotheses') + + # **** create local length + print('...... Local Length') + local_length = smesh.CreateHypothesis('LocalLength', lib) + self.assertIsNotNone(local_length) + local_length.SetLength(100) + self.assertEqual(local_length.GetName(), 'LocalLength') + self.assertEqual(local_length.GetLength(), 100) + self.processGuiEvents() + + # **** create number of segments + print('...... Number Of Segments') + nb_segments= smesh.CreateHypothesis('NumberOfSegments', lib) + self.assertIsNotNone(nb_segments) + nb_segments.SetNumberOfSegments(7) + self.assertEqual(nb_segments.GetName(), 'NumberOfSegments') + self.assertEqual(nb_segments.GetNumberOfSegments(), 7) + self.processGuiEvents() + + # **** create max element area + print('...... Max Element Area') + max_area = smesh.CreateHypothesis('MaxElementArea', lib) + max_area.SetMaxElementArea(2500) + self.assertEqual(max_area.GetName(), 'MaxElementArea') + self.assertEqual(max_area.GetMaxElementArea(), 2500) + self.processGuiEvents() + + # ---- create algorithms + print('... Create algorithms') + + # **** create regular 1d + print('...... Regular 1D') + regular = smesh.CreateHypothesis('Regular_1D', lib) + listHyp = regular.GetCompatibleHypothesis() + self.assertEqual(regular.GetName(), 'Regular_1D') + self.processGuiEvents() + + # **** create mefisto 2d + print('...... Mefisto 2D') + mefisto = smesh.CreateHypothesis( 'MEFISTO_2D', lib ) + listHyp = mefisto.GetCompatibleHypothesis() + self.assertEqual(mefisto.GetName(), 'MEFISTO_2D') + self.processGuiEvents() + + # ---- create mesh on box + print('... Create mesh on box') + mesh = smesh.CreateMesh(box) + self.assertEqual(mesh.AddHypothesis(box, regular)[0], SMESH.HYP_OK) + self.assertEqual(mesh.AddHypothesis(box, mefisto)[0], SMESH.HYP_OK) + self.assertEqual(mesh.AddHypothesis(box, nb_segments)[0], SMESH.HYP_OK) + self.assertEqual(mesh.AddHypothesis(box, max_area)[0], SMESH.HYP_OK) + self.processGuiEvents() + + # ---- compute mesh + print('... Compute mesh') + self.assertEqual(smesh.Compute(mesh, box), True) + self.processGuiEvents() + +if __name__ == '__main__': + unittest.main() From e15a3a87cc738a5e3da00b3e09e7c8e17d733dc7 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 16 Nov 2018 11:14:59 +0300 Subject: [PATCH 05/10] Increment version: 9.2.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 700120124..8b29146d6 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,7 @@ ENDIF(WIN32) STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) SET(${PROJECT_NAME_UC}_MAJOR_VERSION 9) -SET(${PROJECT_NAME_UC}_MINOR_VERSION 1) +SET(${PROJECT_NAME_UC}_MINOR_VERSION 2) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) From 2aed859fcd4a79ddeaf25370c39b2ee713fc873c Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 20 Nov 2018 09:29:28 +0300 Subject: [PATCH 06/10] Windows support: move test scripts to lib/python/site-packages/salome folder to avoid conflict with other files in bin/salome folder. --- src/SMESH_SWIG/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SMESH_SWIG/CMakeLists.txt b/src/SMESH_SWIG/CMakeLists.txt index 88bc8d336..10d1aa0f0 100644 --- a/src/SMESH_SWIG/CMakeLists.txt +++ b/src/SMESH_SWIG/CMakeLists.txt @@ -100,7 +100,7 @@ SET(StdMeshers_SCRIPTS StdMeshersBuilder.py ) # --- rules --- -SALOME_INSTALL_SCRIPTS("${_bin_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON} DEF_PERMS) +SALOME_INSTALL_SCRIPTS("${_bin_SCRIPTS}" ${SALOME_INSTALL_PYTHON} DEF_PERMS) SALOME_INSTALL_SCRIPTS("${smesh_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/smesh DEF_PERMS) SALOME_INSTALL_SCRIPTS("${StdMeshers_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/StdMeshers DEF_PERMS) SALOME_INSTALL_SCRIPTS(SMESH_shared_modules.py ${SALOME_INSTALL_PYTHON}/shared_modules DEF_PERMS) From 96726c1eae9968fd792f9bbe2f03e57a79c13728 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Tue, 27 Nov 2018 17:46:51 +0100 Subject: [PATCH 07/10] fix several bugs in SMESH Python plugins (MeshCut, MGSurfOpt, MgCleaner, BlocFissure) --- .../MGCleanerPlug/MGCleanerMonPlugDialog.py | 23 +- .../MGCleanerPlug/MGCleanerPlugDialog.ui | 401 ++++++++---------- src/Tools/MeshCut/meshcut_plugin.py | 2 +- src/Tools/YamsPlug/monYamsPlugDialog.py | 4 +- src/Tools/blocFissure/gmu/prolongeWire.py | 4 +- 5 files changed, 193 insertions(+), 241 deletions(-) diff --git a/src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py b/src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py index 21216e96e..19d1c41ef 100644 --- a/src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py +++ b/src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py @@ -339,12 +339,9 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget): def getResumeData(self, separator="\n"): text="" if self.RB_Fix1.isChecked(): - CheckOrFix="fix1pass" + CheckOrFix="mode_fix" else: - if self.RB_Fix2.isChecked(): - CheckOrFix="fix2pass" - else: - CheckOrFix="check" + CheckOrFix="mode_check" text+="CheckOrFix="+CheckOrFix+separator text+="PreserveTopology="+str(self.CB_PreserveTopology.isChecked())+separator text+="FillHoles="+str(self.CB_FillHoles.isChecked())+separator @@ -377,11 +374,9 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget): tit,value=lig.split("=") if tit=="CheckOrFix": self.RB_Fix1.setChecked(False) - self.RB_Fix2.setChecked(False) self.RB_Check.setChecked(False) - if value=="fix1pass": self.RB_Fix1.setChecked(True) - if value=="fix2pass": self.RB_Fix2.setChecked(True) - if value=="check": self.RB_Check.setChecked(True) + if value=="mode_fix": self.RB_Fix1.setChecked(True) + if value=="mode_check": self.RB_Check.setChecked(True) if tit=="PreserveTopology": self.CB_PreserveTopology.setChecked(value=="True") if tit=="FillHoles": self.CB_FillHoles.setChecked(value=="True") if tit=="MinHoleSize": self.SP_MinHoleSize.setProperty("text", value) @@ -563,12 +558,9 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget): self.fichierOut=deb[0] + "_fix.mesh" self.commande+=" --out "+self.fichierOut if self.RB_Fix1.isChecked(): - self.commande+=" --fix1pass" + self.commande+=" --mode fix" else: - if self.RB_Fix2.isChecked(): - self.commande+=" --fix2pass" - else: - self.commande+=" --check" + self.commande+=" --mode check" if self.CB_PreserveTopology.isChecked(): self.commande+=" --topology respect" else: @@ -590,8 +582,7 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget): def clean(self): self.RB_Check.setChecked(False) - self.RB_Fix1.setChecked(False) - self.RB_Fix2.setChecked(True) + self.RB_Fix1.setChecked(True) self.CB_PreserveTopology.setChecked(False) self.CB_FillHoles.setChecked(False) self.CB_RemeshPlanes.setChecked(False) diff --git a/src/Tools/MGCleanerPlug/MGCleanerPlugDialog.ui b/src/Tools/MGCleanerPlug/MGCleanerPlugDialog.ui index 5e3ddbfba..569cc53d9 100644 --- a/src/Tools/MGCleanerPlug/MGCleanerPlugDialog.ui +++ b/src/Tools/MGCleanerPlug/MGCleanerPlugDialog.ui @@ -19,7 +19,7 @@ - + Qt::Horizontal @@ -34,7 +34,7 @@ - + @@ -67,12 +67,12 @@ Save - - - 18 - 18 - - + + + 18 + 18 + + @@ -80,12 +80,12 @@ Load - - - 18 - 18 - - + + + 18 + 18 + + @@ -120,7 +120,7 @@ - + Qt::Horizontal @@ -135,7 +135,7 @@ - + @@ -164,126 +164,102 @@ Options - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 30 - 20 - - - - - - - - - - - Performs checks only (no fixing). + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 30 + 20 + + + + + + + + + + Performs checks only (no fixing). Writes diagnostics into the output file. Default is to fix with two passes. - - - Only checking - - - false - - - - - - - Analyses and fixes mesh with only the first stage of the cleaning procedure. + + + Only checking + + + false + + + + + + + Analyses and fixes mesh with only the first stage of the cleaning procedure. Does not write diagnostics into the output file. Default is to fix with two passes. - - - Fix problems with one pass - - - false - - - - - - - Analyses and fixes mesh with the two stage cleaning procedure. -Does not write diagnostics into the output file. -Default is to fix with two passes. - - - Fix problems with two passes - - - true - - - - - - - - Disables fixing operations which induce topology modifications. + + + Fix problems + + + false + + + + + + + Disables fixing operations which induce topology modifications. Default is enable topology modifications. (argument --topology) - - - Preserve topology - - - false - - - - - - - Default is not to fill holes. + + + Preserve topology + + + false + + + + + + + Default is not to fill holes. if set: see 'surface size threshold of holes' in 'Advanced remeshing options'. - - - Fill holes - - - false - - - - - - - - Inserts vertices on planes to improve mesh quality . + + + Fill holes + + + false + + + + + + + Inserts vertices on planes to improve mesh quality . May be useful for poor quality triangulations (eg .STL or .DXF triangulations). Default is not to mesh planes. - - - Remesh planes - - - false - + + + Remesh planes + + + false + - - + - - - - - + + @@ -411,8 +387,10 @@ Default is not to mesh planes. You can control -#1 + + false + 20 @@ -421,9 +399,6 @@ Default is not to mesh planes. 25 - - false - @@ -442,8 +417,10 @@ Set 'Fill holes' in 'Simple Remeshing Options'. Surface size threshold of holes to fill (--min_hole_size) -#2 + + false + 20 @@ -452,9 +429,6 @@ Set 'Fill holes' in 'Simple Remeshing Options'. 25 - - false - @@ -475,8 +449,7 @@ Unused in collision resolution . (--tolerance_displacement) - - + 650 @@ -485,19 +458,20 @@ Unused in collision resolution . 30 - - If set default value is computed from model. - - - Computed - - - true - - - -#3 + + If set default value is computed from model. + + + Computed + + + true + + + + false + 20 @@ -506,9 +480,6 @@ Unused in collision resolution . 25 - - false - @@ -528,7 +499,7 @@ Default is computed from model. Distance threshold for two points distinct (--resolution_length) - + 650 @@ -537,17 +508,16 @@ Default is computed from model. 30 - - If set default value is computed from model. - - - Computed - - - true - - -#4 + + If set default value is computed from model. + + + Computed + + + true + + @@ -557,17 +527,17 @@ Default is computed from model. 25 - - 90 - - 0 + 0.000000000000000 + + + 90.000000000000000 - 1 + 1.000000000000000 - 15 + 15.000000000000000 @@ -589,8 +559,10 @@ Default is 15 degrees. Angle threshold for two connected triangles overlapping (--folding_angle) -#5 + + false + 20 @@ -599,9 +571,6 @@ Default is 15 degrees. 25 - - false - @@ -622,7 +591,7 @@ Default is computed from model. (--overlap_distance) - + 650 @@ -631,17 +600,16 @@ Default is computed from model. 30 - - If set default value is computed from model. - - - Computed - - - true - - -#6 + + If set default value is computed from model. + + + Computed + + + true + + @@ -651,17 +619,17 @@ Default is computed from model. 25 - - 90 - - 0 + 0.000000000000000 + + + 90.000000000000000 - 1 + 1.000000000000000 - 15 + 15.000000000000000 @@ -700,8 +668,7 @@ Default is 15 degrees. MGCleaner Generic Options - - + 20 @@ -710,15 +677,14 @@ Default is 15 degrees. 25 - - 10 - - - 3 - - - - + + 10 + + + 3 + + + 130 @@ -732,12 +698,10 @@ Default is 15 degrees. From 0 (no detail) to 10 (very detailed). Default is 3. - - Verbosity level - - - - + + Verbosity level + + @@ -787,8 +751,7 @@ Default is 3. - - + 20 @@ -797,18 +760,17 @@ Default is 3. 31 - - Save - + + Save + 18 18 - - - + + 120 @@ -817,17 +779,16 @@ Default is 3. 31 - - Load - + + Load + 18 18 - - + diff --git a/src/Tools/MeshCut/meshcut_plugin.py b/src/Tools/MeshCut/meshcut_plugin.py index 9af5a3377..65ba70410 100644 --- a/src/Tools/MeshCut/meshcut_plugin.py +++ b/src/Tools/MeshCut/meshcut_plugin.py @@ -50,7 +50,7 @@ def MeshCut(context): infile = fd.selectedFiles()[0] self.ui.le_origMeshFile.setText(infile) insplit = os.path.splitext(str(infile).encode()) - outfile = insplit[0] + '_cut' + insplit[1] + outfile = insplit[0] + '_cut'.encode() + insplit[1] self.ui.le_cutMeshFile.setText(outfile) pass diff --git a/src/Tools/YamsPlug/monYamsPlugDialog.py b/src/Tools/YamsPlug/monYamsPlugDialog.py index 4aac5cf7c..a28ca5129 100644 --- a/src/Tools/YamsPlug/monYamsPlugDialog.py +++ b/src/Tools/YamsPlug/monYamsPlugDialog.py @@ -522,7 +522,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget): self.commande+= " -O G" # This option has not been updated to the new option style yet deb=os.path.splitext(self.fichierIn) - self.fichierOut=deb[0] + "_output.mesh" + self.fichierOut=deb[0].decode() + "_output.mesh" tolerance=self.SP_toStr(self.SP_Tolerance) if not self.RB_Absolute.isChecked(): @@ -540,7 +540,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget): if self.SP_Memory.value() != 0 : self.commande+=" --max_memory %d" %self.SP_Memory.value() if self.SP_Verbosity.value() != 3 : self.commande+=" --verbose %d" %self.SP_Verbosity.value() - self.commande+=" --in " + self.fichierIn + self.commande+=" --in " + self.fichierIn.decode() self.commande+=" --out " + self.fichierOut print(self.commande) diff --git a/src/Tools/blocFissure/gmu/prolongeWire.py b/src/Tools/blocFissure/gmu/prolongeWire.py index 75cbb518a..989b87c59 100644 --- a/src/Tools/blocFissure/gmu/prolongeWire.py +++ b/src/Tools/blocFissure/gmu/prolongeWire.py @@ -10,7 +10,7 @@ from .orderEdgesFromWire import orderEdgesFromWire # ----------------------------------------------------------------------------- # --- prolongation d'un wire par deux segments tangents -def prolongeWire(aWire, extrem, norms, long): +def prolongeWire(aWire, extrem, norms, lg): """ """ logging.info("start") @@ -22,7 +22,7 @@ def prolongeWire(aWire, extrem, norms, long): uneSeuleEdge = True edgesBout = [] for i, v1 in enumerate(extrem): - exts = [geompy.MakeTranslationVectorDistance(v1, norms[i], l) for l in (-int, int)] + exts = [geompy.MakeTranslationVectorDistance(v1, norms[i], l) for l in (-lg, lg)] dists = [(geompy.MinDistance(v, aWire), i , v) for i, v in enumerate(exts)] dists.sort() v2 = dists[-1][-1] From 19ea87e9c21929af64f0e91bb146f92c4aa1a23f Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 22 Nov 2018 15:58:01 +0300 Subject: [PATCH 08/10] 0023636: EDF 18217 - Problem wen suppressing CAD - Avoid crash on activating SMESH module after source geometry removal --- src/SMESH_I/SMESH_Gen_i_1.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index 69a8f73b0..02d1ad001 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -237,7 +237,8 @@ GEOM::GEOM_Object_ptr SMESH_Gen_i::ShapeToGeomObject (const TopoDS_Shape& theSha if ( aClient && aClient->Find( theShape, IOR )) { CORBA::Object_var obj = GetORB()->string_to_object( IOR.ToCString() ); - aShapeObj = GEOM::GEOM_Object::_narrow ( obj ); + if ( !obj->_non_existent() ) + aShapeObj = GEOM::GEOM_Object::_narrow ( obj ); } } return aShapeObj._retn(); @@ -251,7 +252,7 @@ GEOM::GEOM_Object_ptr SMESH_Gen_i::ShapeToGeomObject (const TopoDS_Shape& theSha TopoDS_Shape SMESH_Gen_i::GeomObjectToShape(GEOM::GEOM_Object_ptr theGeomObject) { TopoDS_Shape S; - if ( !theGeomObject->_is_nil() ) { + if ( !theGeomObject->_is_nil() && !theGeomObject->_non_existent() ) { GEOM_Client* aClient = GetShapeReader(); GEOM::GEOM_Gen_ptr aGeomEngine = GetGeomEngine(); if ( aClient && !aGeomEngine->_is_nil () ) From 4f62bd06834539d8d81339ead532cbceef3646d8 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 30 Nov 2018 14:35:24 +0300 Subject: [PATCH 09/10] IPAL54486 - TC9.2.0: SMESH: Volumes aspect ratio plot is not shown in Mesh Info dialog --- src/SMESHGUI/SMESHGUI_MeshInfo.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx index 34c737faf..9c1fb8810 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx @@ -3484,9 +3484,9 @@ SMESHGUI_CtrlInfo::SMESHGUI_CtrlInfo( QWidget* parent ) myMainLayout->setColumnStretch( 0, 0 ); myMainLayout->setColumnStretch( 1, 5 ); - myMainLayout->setRowStretch ( 11, 5 ); - myMainLayout->setRowStretch ( 16, 5 ); - myMainLayout->setRowStretch ( 17, 1 ); + myMainLayout->setRowStretch ( 12, 5 ); + myMainLayout->setRowStretch ( 17, 5 ); + myMainLayout->setRowStretch ( 18, 1 ); clearInternal(); } @@ -3628,13 +3628,11 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj ) myButtons[6]->setEnabled( true ); } #ifdef DISABLE_PLOT2DVIEWER - myMainLayout->setRowStretch(12,0); for( int i=25; i<=27; i++) myMainLayout->itemAt(i)->widget()->setVisible( false ); #endif } else { - myMainLayout->setRowStretch(12,0); for( int i=18; i<=27; i++) myMainLayout->itemAt(i)->widget()->setVisible( false ); } @@ -3655,13 +3653,11 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj ) myButtons[9]->setEnabled( true ); } #ifdef DISABLE_PLOT2DVIEWER - myMainLayout->setRowStretch(17,0); for( int i=35; i<=37; i++) myMainLayout->itemAt(i)->widget()->setVisible( false ); #endif } else { - myMainLayout->setRowStretch(17,0); for( int i=28; i<=37; i++) myMainLayout->itemAt(i)->widget()->setVisible( false ); } @@ -3799,7 +3795,7 @@ void SMESHGUI_CtrlInfo::computeAspectRatio3D() */ void SMESHGUI_CtrlInfo::clearInternal() { - for( int i=0; i<=35; i++) + for( int i=0; i<=37; i++) myMainLayout->itemAt(i)->widget()->setVisible( true ); for( int i=0; i<=9; i++) myButtons[i]->setEnabled( false ); @@ -3810,8 +3806,6 @@ void SMESHGUI_CtrlInfo::clearInternal() myWidgets[0]->setText( QString() ); for ( int i = 1; i < myWidgets.count(); i++ ) myWidgets[i]->setText( "" ); - myMainLayout->setRowStretch(11,5); - myMainLayout->setRowStretch(16,5); } void SMESHGUI_CtrlInfo::setTolerance( double theTolerance ) From 39f40f2fb8c2c2462898460a9e91f6942e6022d7 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Wed, 5 Dec 2018 18:05:57 +0100 Subject: [PATCH 10/10] french translation missing --- src/SMESHGUI/SMESH_msg_fr.ts | 106 +++++++++++++++++++++++++++++++++-- 1 file changed, 100 insertions(+), 6 deletions(-) diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 52b164b81..b8e73dc1f 100755 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -27,6 +27,10 @@ TEXT_FILES_FILTER Fichiers TXT + + MED_VX_FILES_FILTER + fichiers MED %1 + STL_FILES_FILTER Fichiers STL @@ -103,6 +107,10 @@ MIN_DIAG_ELEMENTS Diagonale minimum + + MIN_ELEM_EDGE + Longueur arête Minimum + ASPECTRATIO_3D_ELEMENTS Rapport de forme 3D @@ -224,6 +232,10 @@ LENGTH2D_EDGES Longueur 2D + + DEFLECTION2D_FACES + Deflection 2D + LENGTH_EDGES Longueur @@ -238,7 +250,11 @@ MAX_ELEMENT_LENGTH_3D - Diamètre d'éléments 3D + Diamètre Element 3D + + + DEFLECTION_2D + Deflection 2D MEN_ADD @@ -692,6 +708,10 @@ MEN_LENGTH_2D Longueur 2D + + MEN_DEFLECTION_2D + Deflection 2D + MEN_MAP Projection de motif @@ -1074,7 +1094,11 @@ MEN_SCALE - Transformation d'échelle + Changement d'échelle + + + MEN_OFFSET + Offset MEN_DUPLICATE_NODES @@ -1914,6 +1938,14 @@ les données exportées ? SMESH_HYPOTHESES Hypothèses + + SMESH_HYPOTHESIS + Hypothese + + + SMESH_ALGORITHM + Algorithme + SMESH_HYP_1 Il manque une hypothèse à l'algorithme @@ -3272,6 +3304,10 @@ Utilisez le menu "Visualiser une entité" pour les afficher. STB_LENGTH_2D Longueur 2D + + STB_DEFLECTION_2D + Deflection 2D + STB_MAP Projection de motif @@ -3526,7 +3562,11 @@ Utilisez le menu "Visualiser une entité" pour les afficher. STB_SCALE - Mise à l'échelle + Mise à l'échelle + + + STB_OFFSET + Décalage STB_DUPLICATE_NODES @@ -3952,6 +3992,10 @@ Utilisez le menu "Visualiser une entité" pour les afficher. TOP_LENGTH_2D Longueur 2D + + TOP_DEFLECTION_2D + Deflection 2D + TOP_MAP Projection de motif @@ -4202,7 +4246,11 @@ Utilisez le menu "Visualiser une entité" pour les afficher. TOP_SCALE - Mise à l'échelle + Mise à l'échelle + + + TOP_OFFSET + Offset TOP_DUPLICATE_NODES @@ -4479,6 +4527,21 @@ Il ne peut pas être supprimé. Exporter les champs + + SMESHGUI_OffsetDlg + + SMESH_OFFSET_TITLE + Offset + + + SMESH_OFFSET + Offset + + + OFFSET_VALUE + Offset Value + + SMESHGUI_AddMeshElementDlg @@ -5869,6 +5932,10 @@ Entrez une valeur correcte et essayez de nouveau LENGTH2D Longueur 2D + + DEFLECTION2D + Deflection 2D + LESS_THAN Inférieur à ... @@ -7210,7 +7277,11 @@ Il y a trop peu de points dans le fichier ON_ALL_BOUNDARIES - Sur toutes les frontières + sur toutes les frontières + + + GENERATE_GROUPS + Génerer @@ -8008,7 +8079,30 @@ en raison de leurs types incompatibles: NEW_NAME - Nom du nouveau maillage + New Mesh Name + + + NEW_GEOM + New Geometry + + + REUSE_HYPOTHESES + Reuse Hypotheses + + + COPY_ELEMENTS + Copy Mesh Elements + + + OPERATION_FAILED + Not all mesh sub-objects have been copied + + + SUBSHAPES_NOT_FOUND_MSG + +Some sub-shapes not found in the new geometry. They are listed +below along with dependent mesh objects that are marked with +with red in the Object Browser.