X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_SWIG%2FStdMeshersBuilder.py;h=1496202ffeaaf9884fddc74c4e92c65807e2caac;hb=b0647ff5ab38e3d44a7d6aaa8cdb1b12e12a5959;hp=46032989c8b2d0bf15359e45e3673f187561915b;hpb=cc9e7d544292b687b0cc729bc455c147bd65ac54;p=modules%2Fsmesh.git diff --git a/src/SMESH_SWIG/StdMeshersBuilder.py b/src/SMESH_SWIG/StdMeshersBuilder.py index 46032989c..1496202ff 100644 --- a/src/SMESH_SWIG/StdMeshersBuilder.py +++ b/src/SMESH_SWIG/StdMeshersBuilder.py @@ -1,9 +1,9 @@ -# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2014 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. +# 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 @@ -385,7 +385,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm): algo = self.mesh.smeshpyD.CreateHypothesis("SegmentAroundVertex_0D", "libStdMeshersEngine.so") pass status = self.mesh.mesh.AddHypothesis(self.geom, algo) - TreatHypoStatus(status, "SegmentAroundVertex_0D", name, True) + TreatHypoStatus(status, "SegmentAroundVertex_0D", name, True, self.mesh) # from salome.smesh.smeshBuilder import IsEqual comFun = lambda hyp, args: IsEqual(hyp.GetLength(), args[0]) @@ -830,12 +830,13 @@ class StdMeshersBuilder_Projection2D(Mesh_Algorithm): from salome.smesh.smeshBuilder import AssureGeomPublished AssureGeomPublished( self.mesh, geom ) hyp = self.Hypothesis("ProjectionSource2D", [face,mesh,srcV1,tgtV1,srcV2,tgtV2], - UseExisting=0) + UseExisting=0, toAdd=False) # it does not seem to be useful to reuse the existing "SourceFace" hypothesis #UseExisting=UseExisting, CompareMethod=self.CompareSourceFace) hyp.SetSourceFace( face ) hyp.SetSourceMesh( mesh ) hyp.SetVertexAssociation( srcV1, srcV2, tgtV1, tgtV2 ) + self.mesh.AddHypothesis(hyp, self.geom) return hyp pass # end of StdMeshersBuilder_Projection2D class @@ -1400,18 +1401,17 @@ class StdMeshersBuilder_Cartesian_3D(Mesh_Algorithm): # Examples: # - "10.5" - defines a grid with a constant spacing # - [["1", "1+10*t", "11"] [0.1, 0.6]] - defines different spacing in 3 ranges. - # @param yGridDef defines the grid along the Y asix the same way as \a xGridDef does - # @param zGridDef defines the grid along the Z asix the same way as \a xGridDef does + # @param yGridDef defines the grid along the Y asix the same way as \a xGridDef does. + # @param zGridDef defines the grid along the Z asix the same way as \a xGridDef does. # @param sizeThreshold (> 1.0) defines a minimal size of a polyhedron so that - # a polyhedron of size less than hexSize/sizeThreshold is not created - # @param UseExisting if ==true - searches for the existing hypothesis created with - # the same parameters, else (default) - creates a new one - def SetGrid(self, xGridDef, yGridDef, zGridDef, sizeThreshold=4.0, UseExisting=False): + # a polyhedron of size less than hexSize/sizeThreshold is not created. + # @param implEdges enables implementation of geometrical edges into the mesh. + def SetGrid(self, xGridDef, yGridDef, zGridDef, sizeThreshold=4.0, implEdges=False): if not self.hyp: compFun = lambda hyp, args: False self.hyp = self.Hypothesis("CartesianParameters3D", [xGridDef, yGridDef, zGridDef, sizeThreshold], - UseExisting=UseExisting, CompareMethod=compFun) + UseExisting=False, CompareMethod=compFun) if not self.mesh.IsUsedHypothesis( self.hyp, self.geom ): self.mesh.AddHypothesis( self.hyp, self.geom ) @@ -1427,6 +1427,7 @@ class StdMeshersBuilder_Cartesian_3D(Mesh_Algorithm): else: self.hyp.SetGridSpacing( gridDef[0], gridDef[1], axis ) self.hyp.SetSizeThreshold( sizeThreshold ) + self.hyp.SetToAddEdges( implEdges ) return self.hyp ## Defines custom directions of axes of the grid