]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Initial version of files for OCC developers OCC_initial_01
authoradmin <salome-admin@opencascade.com>
Wed, 22 Dec 2004 11:28:54 +0000 (11:28 +0000)
committeradmin <salome-admin@opencascade.com>
Wed, 22 Dec 2004 11:28:54 +0000 (11:28 +0000)
src/SMESHGUI/SMESHGUI_GroupDlg.cxx
src/SMESH_SWIG/meshpy.py

index ed7295a118ce4c509100660c738021af0a52acfc..4d7445df36f047f324a43d2e40df1bc07de1c05c 100644 (file)
@@ -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();
index effc62d1db8d1503709f586734fe1006dfa72d67..7af956296002f6135d8141af4c172eb691a54b3e 100644 (file)
@@ -37,7 +37,7 @@ class MeshHexaImpl:
     #   - hypothesis "NumberOfSegments" with number of segments <n>
     # --------------------
 
-    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 <edge> and propagate the hypothesis on all correspondant edges.
+    # Set algorithm and hypothesis for 1D discretization of the <edge> and all other propagate edges:
+    #   - algorithm  "Regular_1D"
+    #   - hypothesis "NumberOfSegments" with number of segments <n>
+    #   - hypothesis "Propagation" with number of segments <n>
+    # Note: the <edge> 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.
     # --------------------