From ca135511fb6f62d1a6082a77fc76d6b62cb1508f Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 22 Dec 2004 11:28:54 +0000 Subject: [PATCH] Initial version of files for OCC developers --- src/SMESHGUI/SMESHGUI_GroupDlg.cxx | 4 ++++ src/SMESH_SWIG/meshpy.py | 21 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index ed7295a11..4d7445df3 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -498,6 +498,10 @@ void SMESHGUI_GroupDlg::onGrpTypeChanged(int id) //================================================================================= void SMESHGUI_GroupDlg::setSelectionMode(int theMode) { + // PAL7314 + if (myMesh->_is_nil()) + return; + if (mySelectionMode != theMode) { mySelection->ClearIObjects(); mySelection->ClearFilters(); diff --git a/src/SMESH_SWIG/meshpy.py b/src/SMESH_SWIG/meshpy.py index effc62d1d..7af956296 100644 --- a/src/SMESH_SWIG/meshpy.py +++ b/src/SMESH_SWIG/meshpy.py @@ -37,7 +37,7 @@ class MeshHexaImpl: # - hypothesis "NumberOfSegments" with number of segments # -------------------- - def Mesh1D(self, shape, n): + def Mesh1D(self, shape, n, propagate=0): hyp1D=smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") smeshgui.SetName(salome.ObjectToID(hyp1D), self.name+"/WireDiscretisation/"+str(self.cpt)) self.mesh.AddHypothesis(shape, hyp1D) @@ -47,6 +47,11 @@ class MeshHexaImpl: smeshgui.SetName(salome.ObjectToID(hyp), self.name+"/Segments_"+str(n)+"/"+str(self.cpt)) self.mesh.AddHypothesis(shape, hyp) + if propagate: + hypPro=smesh.CreateHypothesis("Propagation", "libStdMeshersEngine.so") + smeshgui.SetName(salome.ObjectToID(hypPro), self.name+"/Propagation/"+str(self.cpt)) + self.mesh.AddHypothesis(shape, hypPro) + self.cpt=self.cpt+1 # Constructor @@ -93,6 +98,20 @@ class MeshHexaImpl: submesh = self.mesh.GetSubMesh(edge, self.name+"/SubMeshEdge/"+str(self.cpt)) self.Mesh1D(edge, n) + # Creates sub-mesh of the mesh, created by constructor. + # This sub-mesh will be created on edge and propagate the hypothesis on all correspondant edges. + # Set algorithm and hypothesis for 1D discretization of the and all other propagate edges: + # - algorithm "Regular_1D" + # - hypothesis "NumberOfSegments" with number of segments + # - hypothesis "Propagation" with number of segments + # Note: the will be automatically published in study under the shape, given in constructor. + # -------------------- + + def Propagate(self, edge, n): + geompy.addToStudyInFather(self.piece, edge, geompy.SubShapeName(edge, self.piece)) + submesh = self.mesh.GetSubMesh(edge, self.name+"/SubMeshEdge/"+str(self.cpt)) + self.Mesh1D(edge, n, 1) + # Computes mesh, created by constructor. # -------------------- -- 2.39.2