1 # Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 from SMESH_test1 import *
24 def CheckBelongToGeomFilterOld(theMeshGen, theMesh, theShape, theSubShape, theElemType):
26 if theShape != theSubShape:
27 aName = str(theSubShape)
28 geompy.addToStudyInFather(theShape,theSubShape,aName)
30 theMeshGen.Compute(theMesh,theShape)
32 aFilterMgr = theMeshGen.CreateFilterManager()
33 aFilter = aFilterMgr.CreateFilter()
35 aBelongToGeom = aFilterMgr.CreateBelongToGeom()
36 aBelongToGeom.SetGeom(theSubShape)
37 aBelongToGeom.SetElementType(theElemType)
39 aFilter.SetPredicate(aBelongToGeom)
40 return aFilter.GetElementsId(theMesh)
43 def CheckBelongToGeomFilter(theMesh, theShape, theSubShape, theElemType):
45 if theShape != theSubShape:
46 aName = str(theSubShape)
47 geompy.addToStudyInFather(theShape,theSubShape,aName)
50 aFilter = theMesh.GetFilter(theElemType, smesh.FT_BelongToGeom, theSubShape)
51 return aFilter.GetElementsId(theMesh.GetMesh())
54 anElemType = smesh.FACE;
55 print "anElemType =", anElemType
56 #anIds = CheckBelongToGeomFilter(mesh,box,subShapeList[1],anElemType)
57 anIds = CheckBelongToGeomFilter(mesh,box,box,anElemType)
58 print "Number of ids = ", len(anIds)
59 print "anIds = ", anIds
61 #anIds = CheckBelongToGeomFilterOld(smesh.smesh,mesh.GetMesh(),box,box,anElemType)
62 #print "anIds = ", anIds
64 salome.sg.updateObjBrowser(1);