mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-08 06:17:29 +05:00
PAL9969: update geompy.py to new functions
This commit is contained in:
parent
168917eddd
commit
a334fbe62f
@ -46,19 +46,19 @@ CurvesOp = None
|
|||||||
PrimOp = None
|
PrimOp = None
|
||||||
ShapesOp = None
|
ShapesOp = None
|
||||||
HealOp = None
|
HealOp = None
|
||||||
InsertOp = None
|
InsertOp = None
|
||||||
BoolOp = None
|
BoolOp = None
|
||||||
TrsfOp = None
|
TrsfOp = None
|
||||||
LocalOp = None
|
LocalOp = None
|
||||||
MeasuOp = None
|
MeasuOp = None
|
||||||
BlocksOp = None
|
BlocksOp = None
|
||||||
GroupOp = None
|
GroupOp = None
|
||||||
|
|
||||||
def init_geom(theStudy):
|
def init_geom(theStudy):
|
||||||
|
|
||||||
global myStudy, myBuilder, myStudyId, BasicOp, CurvesOp, PrimOp, ShapesOp, HealOp
|
global myStudy, myBuilder, myStudyId, BasicOp, CurvesOp, PrimOp, ShapesOp, HealOp
|
||||||
global InsertOp, BoolOp, TrsfOp, LocalOp, MeasuOp, BlocksOp, GroupOp, father
|
global InsertOp, BoolOp, TrsfOp, LocalOp, MeasuOp, BlocksOp, GroupOp, father
|
||||||
|
|
||||||
myStudy = theStudy
|
myStudy = theStudy
|
||||||
myStudyId = myStudy._get_StudyId()
|
myStudyId = myStudy._get_StudyId()
|
||||||
myBuilder = myStudy.NewBuilder()
|
myBuilder = myStudy.NewBuilder()
|
||||||
@ -73,7 +73,7 @@ def init_geom(theStudy):
|
|||||||
aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
|
aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
|
||||||
myBuilder.DefineComponentInstance(father,geom)
|
myBuilder.DefineComponentInstance(father,geom)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Assign Operations Interfaces
|
# Assign Operations Interfaces
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
@ -89,7 +89,7 @@ def init_geom(theStudy):
|
|||||||
LocalOp = geom.GetILocalOperations (myStudyId)
|
LocalOp = geom.GetILocalOperations (myStudyId)
|
||||||
MeasuOp = geom.GetIMeasureOperations (myStudyId)
|
MeasuOp = geom.GetIMeasureOperations (myStudyId)
|
||||||
BlocksOp = geom.GetIBlocksOperations (myStudyId)
|
BlocksOp = geom.GetIBlocksOperations (myStudyId)
|
||||||
GroupOp = geom.GetIGroupOperations (myStudyId)
|
GroupOp = geom.GetIGroupOperations (myStudyId)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
init_geom(myStudy)
|
init_geom(myStudy)
|
||||||
@ -478,18 +478,36 @@ def GetShapesOnPlane(theShape, theShapeType, theAx1, theState):
|
|||||||
print "GetShapesOnPlane : ", ShapesOp.GetErrorCode()
|
print "GetShapesOnPlane : ", ShapesOp.GetErrorCode()
|
||||||
return aList
|
return aList
|
||||||
|
|
||||||
|
def GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState):
|
||||||
|
aList = ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
|
||||||
|
if ShapesOp.IsDone() == 0:
|
||||||
|
print "GetShapesOnPlaneIDs : ", ShapesOp.GetErrorCode()
|
||||||
|
return aList
|
||||||
|
|
||||||
def GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState):
|
def GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState):
|
||||||
aList = ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
|
aList = ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
|
||||||
if ShapesOp.IsDone() == 0:
|
if ShapesOp.IsDone() == 0:
|
||||||
print "GetShapesOnCylinder : ", ShapesOp.GetErrorCode()
|
print "GetShapesOnCylinder : ", ShapesOp.GetErrorCode()
|
||||||
return aList
|
return aList
|
||||||
|
|
||||||
|
def GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState):
|
||||||
|
aList = ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
|
||||||
|
if ShapesOp.IsDone() == 0:
|
||||||
|
print "GetShapesOnCylinderIDs : ", ShapesOp.GetErrorCode()
|
||||||
|
return aList
|
||||||
|
|
||||||
def GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState):
|
def GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState):
|
||||||
aList = ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
|
aList = ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
|
||||||
if ShapesOp.IsDone() == 0:
|
if ShapesOp.IsDone() == 0:
|
||||||
print "GetShapesOnSphere : ", ShapesOp.GetErrorCode()
|
print "GetShapesOnSphere : ", ShapesOp.GetErrorCode()
|
||||||
return aList
|
return aList
|
||||||
|
|
||||||
|
def GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState):
|
||||||
|
aList = ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
|
||||||
|
if ShapesOp.IsDone() == 0:
|
||||||
|
print "GetShapesOnSphereIDs : ", ShapesOp.GetErrorCode()
|
||||||
|
return aList
|
||||||
|
|
||||||
def GetInPlace(theShapeWhere, theShapeWhat):
|
def GetInPlace(theShapeWhere, theShapeWhat):
|
||||||
anObj = ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
|
anObj = ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
|
||||||
if ShapesOp.IsDone() == 0:
|
if ShapesOp.IsDone() == 0:
|
||||||
@ -1105,11 +1123,21 @@ def UnionList (theGroup, theSubShapes):
|
|||||||
if GroupOp.IsDone() == 0:
|
if GroupOp.IsDone() == 0:
|
||||||
print "UnionList : ", GroupOp.GetErrorCode()
|
print "UnionList : ", GroupOp.GetErrorCode()
|
||||||
|
|
||||||
|
def UnionIDs(theGroup, theSubShapes):
|
||||||
|
GroupOp.UnionIDs(theGroup, theSubShapes)
|
||||||
|
if GroupOp.IsDone() == 0:
|
||||||
|
print "UnionIDs : ", GroupOp.GetErrorCode()
|
||||||
|
|
||||||
def DifferenceList (theGroup, theSubShapes):
|
def DifferenceList (theGroup, theSubShapes):
|
||||||
GroupOp.DifferenceList(theGroup, theSubShapes)
|
GroupOp.DifferenceList(theGroup, theSubShapes)
|
||||||
if GroupOp.IsDone() == 0:
|
if GroupOp.IsDone() == 0:
|
||||||
print "DifferenceList : ", GroupOp.GetErrorCode()
|
print "DifferenceList : ", GroupOp.GetErrorCode()
|
||||||
|
|
||||||
|
def DifferenceIDs(theGroup, theSubShapes):
|
||||||
|
GroupOp.DifferenceIDs(theGroup, theSubShapes)
|
||||||
|
if GroupOp.IsDone() == 0:
|
||||||
|
print "DifferenceIDs : ", GroupOp.GetErrorCode()
|
||||||
|
|
||||||
def GetObjectIDs(Group):
|
def GetObjectIDs(Group):
|
||||||
ListIDs = GroupOp.GetObjects(Group)
|
ListIDs = GroupOp.GetObjects(Group)
|
||||||
if GroupOp.IsDone() == 0:
|
if GroupOp.IsDone() == 0:
|
||||||
|
@ -36,7 +36,7 @@ import GEOM
|
|||||||
|
|
||||||
g = lcc.FindOrLoadComponent("FactoryServer", "GEOM")
|
g = lcc.FindOrLoadComponent("FactoryServer", "GEOM")
|
||||||
geom = g._narrow( GEOM.GEOM_Gen )
|
geom = g._narrow( GEOM.GEOM_Gen )
|
||||||
gg = ImportComponentGUI("GEOM")
|
gg = ImportComponentGUI("GEOM")
|
||||||
gg.initGeomGen()
|
gg.initGeomGen()
|
||||||
|
|
||||||
#SRN: modified on Mar 18, 2005
|
#SRN: modified on Mar 18, 2005
|
||||||
@ -50,19 +50,19 @@ CurvesOp = None
|
|||||||
PrimOp = None
|
PrimOp = None
|
||||||
ShapesOp = None
|
ShapesOp = None
|
||||||
HealOp = None
|
HealOp = None
|
||||||
InsertOp = None
|
InsertOp = None
|
||||||
BoolOp = None
|
BoolOp = None
|
||||||
TrsfOp = None
|
TrsfOp = None
|
||||||
LocalOp = None
|
LocalOp = None
|
||||||
MeasuOp = None
|
MeasuOp = None
|
||||||
BlocksOp = None
|
BlocksOp = None
|
||||||
GroupOp = None
|
GroupOp = None
|
||||||
|
|
||||||
def init_geom(theStudy):
|
def init_geom(theStudy):
|
||||||
|
|
||||||
global myStudy, myBuilder, myStudyId, BasicOp, CurvesOp, PrimOp, ShapesOp, HealOp
|
global myStudy, myBuilder, myStudyId, BasicOp, CurvesOp, PrimOp, ShapesOp, HealOp
|
||||||
global InsertOp, BoolOp, TrsfOp, LocalOp, MeasuOp, BlocksOp, GroupOp, father
|
global InsertOp, BoolOp, TrsfOp, LocalOp, MeasuOp, BlocksOp, GroupOp, father
|
||||||
|
|
||||||
myStudy = theStudy
|
myStudy = theStudy
|
||||||
myStudyId = myStudy._get_StudyId()
|
myStudyId = myStudy._get_StudyId()
|
||||||
myBuilder = myStudy.NewBuilder()
|
myBuilder = myStudy.NewBuilder()
|
||||||
@ -77,7 +77,7 @@ def init_geom(theStudy):
|
|||||||
aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
|
aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
|
||||||
myBuilder.DefineComponentInstance(father,geom)
|
myBuilder.DefineComponentInstance(father,geom)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Assign Operations Interfaces
|
# Assign Operations Interfaces
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
@ -93,7 +93,7 @@ def init_geom(theStudy):
|
|||||||
LocalOp = geom.GetILocalOperations (myStudyId)
|
LocalOp = geom.GetILocalOperations (myStudyId)
|
||||||
MeasuOp = geom.GetIMeasureOperations (myStudyId)
|
MeasuOp = geom.GetIMeasureOperations (myStudyId)
|
||||||
BlocksOp = geom.GetIBlocksOperations (myStudyId)
|
BlocksOp = geom.GetIBlocksOperations (myStudyId)
|
||||||
GroupOp = geom.GetIGroupOperations (myStudyId)
|
GroupOp = geom.GetIGroupOperations (myStudyId)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
init_geom(myStudy)
|
init_geom(myStudy)
|
||||||
@ -951,6 +951,15 @@ def GetShapesOnPlane(theShape, theShapeType, theAx1, theState):
|
|||||||
print "GetShapesOnPlane : ", ShapesOp.GetErrorCode()
|
print "GetShapesOnPlane : ", ShapesOp.GetErrorCode()
|
||||||
return aList
|
return aList
|
||||||
|
|
||||||
|
def GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState):
|
||||||
|
"""
|
||||||
|
* Works like the above method, but returns list of sub-shapes indices
|
||||||
|
"""
|
||||||
|
aList = ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
|
||||||
|
if ShapesOp.IsDone() == 0:
|
||||||
|
print "GetShapesOnPlaneIDs : ", ShapesOp.GetErrorCode()
|
||||||
|
return aList
|
||||||
|
|
||||||
def GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState):
|
def GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState):
|
||||||
"""
|
"""
|
||||||
* Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
|
* Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
|
||||||
@ -971,6 +980,15 @@ def GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState):
|
|||||||
print "GetShapesOnCylinder : ", ShapesOp.GetErrorCode()
|
print "GetShapesOnCylinder : ", ShapesOp.GetErrorCode()
|
||||||
return aList
|
return aList
|
||||||
|
|
||||||
|
def GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState):
|
||||||
|
"""
|
||||||
|
* Works like the above method, but returns list of sub-shapes indices
|
||||||
|
"""
|
||||||
|
aList = ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
|
||||||
|
if ShapesOp.IsDone() == 0:
|
||||||
|
print "GetShapesOnCylinderIDs : ", ShapesOp.GetErrorCode()
|
||||||
|
return aList
|
||||||
|
|
||||||
def GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState):
|
def GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState):
|
||||||
"""
|
"""
|
||||||
* Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
|
* Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
|
||||||
@ -990,6 +1008,15 @@ def GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState):
|
|||||||
print "GetShapesOnSphere : ", ShapesOp.GetErrorCode()
|
print "GetShapesOnSphere : ", ShapesOp.GetErrorCode()
|
||||||
return aList
|
return aList
|
||||||
|
|
||||||
|
def GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState):
|
||||||
|
"""
|
||||||
|
* Works like the above method, but returns list of sub-shapes indices
|
||||||
|
"""
|
||||||
|
aList = ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
|
||||||
|
if ShapesOp.IsDone() == 0:
|
||||||
|
print "GetShapesOnSphereIDs : ", ShapesOp.GetErrorCode()
|
||||||
|
return aList
|
||||||
|
|
||||||
def GetInPlace(theShapeWhere, theShapeWhat):
|
def GetInPlace(theShapeWhere, theShapeWhat):
|
||||||
"""
|
"""
|
||||||
* Get sub-shape(s) of theShapeWhere, which are
|
* Get sub-shape(s) of theShapeWhere, which are
|
||||||
@ -2414,6 +2441,15 @@ def UnionList (theGroup, theSubShapes):
|
|||||||
if GroupOp.IsDone() == 0:
|
if GroupOp.IsDone() == 0:
|
||||||
print "UnionList : ", GroupOp.GetErrorCode()
|
print "UnionList : ", GroupOp.GetErrorCode()
|
||||||
|
|
||||||
|
def UnionIDs(theGroup, theSubShapes):
|
||||||
|
"""
|
||||||
|
* Works like the above method, but argument
|
||||||
|
* theSubShapes here is a list of sub-shapes indices
|
||||||
|
"""
|
||||||
|
GroupOp.UnionIDs(theGroup, theSubShapes)
|
||||||
|
if GroupOp.IsDone() == 0:
|
||||||
|
print "UnionIDs : ", GroupOp.GetErrorCode()
|
||||||
|
|
||||||
def DifferenceList (theGroup, theSubShapes):
|
def DifferenceList (theGroup, theSubShapes):
|
||||||
"""
|
"""
|
||||||
* Removes from the group all the given shapes. No errors, if some shapes are not included.
|
* Removes from the group all the given shapes. No errors, if some shapes are not included.
|
||||||
@ -2426,6 +2462,15 @@ def DifferenceList (theGroup, theSubShapes):
|
|||||||
if GroupOp.IsDone() == 0:
|
if GroupOp.IsDone() == 0:
|
||||||
print "DifferenceList : ", GroupOp.GetErrorCode()
|
print "DifferenceList : ", GroupOp.GetErrorCode()
|
||||||
|
|
||||||
|
def DifferenceIDs(theGroup, theSubShapes):
|
||||||
|
"""
|
||||||
|
* Works like the above method, but argument
|
||||||
|
* theSubShapes here is a list of sub-shapes indices
|
||||||
|
"""
|
||||||
|
GroupOp.DifferenceIDs(theGroup, theSubShapes)
|
||||||
|
if GroupOp.IsDone() == 0:
|
||||||
|
print "DifferenceIDs : ", GroupOp.GetErrorCode()
|
||||||
|
|
||||||
def GetObjectIDs(theGroup):
|
def GetObjectIDs(theGroup):
|
||||||
"""
|
"""
|
||||||
* Returns a list of sub objects ID stored in the group
|
* Returns a list of sub objects ID stored in the group
|
||||||
|
Loading…
x
Reference in New Issue
Block a user