oaOccTraverser
模块: oapy._oa._design
导入: from oapy._oa import _design
概览
oaOccTraverser 在 oapy 中可用,可通过 _design 模块访问。
本页汇总 oaOccTraverser 当前在 oapy 中可用的 Python 接口。
详细说明
The oaOccTraverser class implements a hierarchical traversal for connectivity objects in the occurrence domain。 oaOccTraverser is not an abstract class, however applications may choose to derive from it in order to perform specific actions on the objects being traversed。 The traverse() function initiates the traversal, which can be controlled by a set of flags bits accessed by the flags() function。 During the traversal, the virtual functions process*() are called for each kind of connectivity object。 To control the expansion of the occurrence hierarchy, the application must override the virtual function startInst() , which is called just before the contents of an instance in the hierarchy are produced。
构造函数
_design.oaOccTraverser(topOcc)
obj = _design.oaOccTraverser(topOcc)
方法总览
| 状态 | Python 调用 |
|---|---|
| ✅ | obj.flags() |
| ✅ | obj.getTopOccurrence() |
| ✅ | obj.traverse() |
| ✅ | obj.abort() |
| ✅ | obj.startInst(inst) |
| ✅ | obj.endInst(inst) |
| ✅ | obj.startOccurrence(occ) |
| ✅ | obj.endOccurrence(occ) |
方法说明
obj.flags()
绑定状态: 已绑定
Python 调用: obj.flags()
This function gives read/write access to a set of flags that control the traversal。 These flags are: oavOccTraversePostOrder use a postorder traversal rather than preorder oavOccTraverseDesigns descend into occurrences of other designs oavOccTraverseImplicit allows processing of implicit objects。
Python 示例
from oapy._oa import _design
# assume obj is a oaOccTraverser
obj.flags()
obj.getTopOccurrence()
绑定状态: 已绑定
Python 调用: obj.getTopOccurrence()
This function returns the root of the occurrence subtree to be traversed。
Python 示例
from oapy._oa import _design
# assume obj is a oaOccTraverser
obj.getTopOccurrence()
obj.traverse()
绑定状态: 已绑定
Python 调用: obj.traverse()
This function causes this traverser object to start generating connectivity objects in the specified occurrence hierarchy。
Python 示例
from oapy._oa import _design
# assume obj is a oaOccTraverser
obj.traverse()
obj.abort()
绑定状态: 已绑定
Python 调用: obj.abort()
This function aborts the current traversal as soon as possible, returning control to the caller。
Python 示例
from oapy._oa import _design
# assume obj is a oaOccTraverser
obj.abort()
obj.startInst(inst)
绑定状态: 已绑定
Python 调用: obj.startInst(inst)
This virtual function is called just before the contents of an instance in the hierarchy is produced。 The caller can override this function and return a boolean indicating whether or not the traversal should descend into the instance's master。 The default implementation returns true, which means the transversal should descend into the instance's master。
参数
inst: The instance being visited。
Python 示例
from oapy._oa import _design
# assume obj is a oaOccTraverser
obj.startInst(inst)
obj.endInst(inst)
绑定状态: 已绑定
Python 调用: obj.endInst(inst)
This virtual function is called just after the contents of an instance's master in the hierarchy have been produced。
参数
inst: The instance has been visited。
Python 示例
from oapy._oa import _design
# assume obj is a oaOccTraverser
obj.endInst(inst)
obj.startOccurrence(occ)
绑定状态: 已绑定
Python 调用: obj.startOccurrence(occ)
This virtual function is called just before the contents of an occurrence in the hierarchy is produced。 The caller can override this function and return a boolean indicating whether or not the contents of this particular occurrence will be produced or not。
参数
occ: The occurrence being visited。
Python 示例
from oapy._oa import _design
# assume obj is a oaOccTraverser
obj.startOccurrence(occ)
obj.endOccurrence(occ)
绑定状态: 已绑定
Python 调用: obj.endOccurrence(occ)
This virtual function is called just after the contents of an occurrence in the hierarchy have been produced。
参数
occ: The occurrence has been visited。
Python 示例
from oapy._oa import _design
# assume obj is a oaOccTraverser
obj.endOccurrence(occ)