]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
1)
authoreap <eap@opencascade.com>
Wed, 17 Feb 2010 14:54:30 +0000 (14:54 +0000)
committereap <eap@opencascade.com>
Wed, 17 Feb 2010 14:54:30 +0000 (14:54 +0000)
+    ## Defines "QuadrangleParams" hypothesis
+    #  @param vertex: vertex of a trilateral geometrical face, around which triangles
+    #                 will be created while other elements will be quadrangles.
+    #                 Vertex can be either a GEOM_Object or a vertex ID within the
+    #                 shape to mesh
+    #
+    def TriangleVertex(self, vertex, UseExisting=0):

2) in FixedPoints1D(), convert geom reversed edges into IDs

src/SMESH_SWIG/smeshDC.py

index 66afda3a7cdce20a259c042ce2f0f7640510eced..24a76894c45f895a49fcbab1670b7c617f4cfd2b 100644 (file)
@@ -3943,10 +3943,13 @@ class Mesh_Segment(Mesh_Algorithm):
     def FixedPoints1D(self, points, nbSegs=[1], reversedEdges=[], UseExisting=0):
         if not isinstance(reversedEdges,list): #old version script, before adding reversedEdges
             reversedEdges, UseExisting = [], reversedEdges
+        if reversedEdges and isinstance( reversedEdges[0], geompyDC.GEOM._objref_GEOM_Object ):
+            for i in range( len( reversedEdges )):
+                reversedEdges[i] = self.mesh.geompyD.GetSubShapeID(self.mesh.geom, reversedEdges[i] )
         entry = self.MainShapeEntry()
         hyp = self.Hypothesis("FixedPoints1D", [points, nbSegs, reversedEdges, entry],
                               UseExisting=UseExisting,
-                              CompareMethod=self.CompareArithmetic1D)
+                              CompareMethod=self.CompareFixedPoints1D)
         hyp.SetPoints(points)
         hyp.SetNbSegments(nbSegs)
         hyp.SetReversedEdges(reversedEdges)
@@ -4459,6 +4462,23 @@ class Mesh_Quadrangle(Mesh_Algorithm):
                               CompareMethod=self.CompareEqualHyp)
         return hyp
 
+    ## Defines "QuadrangleParams" hypothesis
+    #  @param vertex: vertex of a trilateral geometrical face, around which triangles
+    #                 will be created while other elements will be quadrangles.
+    #                 Vertex can be either a GEOM_Object or a vertex ID within the
+    #                 shape to mesh
+    #
+    #  @ingroup l3_hypos_additi
+    def TriangleVertex(self, vertex, UseExisting=0):
+        vertexID = vertex
+        if isinstance( vertexID, geompyDC.GEOM._objref_GEOM_Object ):
+            vertexID = self.mesh.geompyD.GetSubShapeID( self.mesh.geom, vertex )
+        hyp = self.Hypothesis("QuadrangleParams", [vertexID], UseExisting = UseExisting,
+                              CompareMethod=lambda hyp,args: hyp.GetTriaVertex()==args[0])
+        hyp.SetTriaVertex( vertexID )
+        return hyp
+
+
 # Public class: Mesh_Tetrahedron
 # ------------------------------