Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 from SMESH_test1 import *
00025
00026
00027 def CheckBelongToGeomFilterOld(theMeshGen, theMesh, theShape, theSubShape, theElemType):
00028 import geompy
00029 if theShape != theSubShape:
00030 aName = str(theSubShape)
00031 geompy.addToStudyInFather(theShape,theSubShape,aName)
00032
00033 theMeshGen.Compute(theMesh,theShape)
00034
00035 aFilterMgr = theMeshGen.CreateFilterManager()
00036 aFilter = aFilterMgr.CreateFilter()
00037
00038 aBelongToGeom = aFilterMgr.CreateBelongToGeom()
00039 aBelongToGeom.SetGeom(theSubShape)
00040 aBelongToGeom.SetElementType(theElemType)
00041
00042 aFilter.SetPredicate(aBelongToGeom)
00043 aFilterMgr.UnRegister()
00044 return aFilter.GetElementsId(theMesh)
00045
00046
00047 def CheckBelongToGeomFilter(theMesh, theShape, theSubShape, theElemType):
00048 import geompy
00049 import smesh
00050 if theShape != theSubShape:
00051 aName = str(theSubShape)
00052 geompy.addToStudyInFather(theShape,theSubShape,aName)
00053
00054 theMesh.Compute()
00055 aFilter = smesh.GetFilter(theElemType, smesh.FT_BelongToGeom, theSubShape)
00056 return aFilter.GetElementsId(theMesh.GetMesh())
00057
00058
00059 anElemType = smesh.FACE;
00060 print "anElemType =", anElemType
00061
00062 anIds = CheckBelongToGeomFilter(mesh,box,box,anElemType)
00063 print "Number of ids = ", len(anIds)
00064 print "anIds = ", anIds
00065
00066
00067
00068
00069 salome.sg.updateObjBrowser(1);