首页 / base / oaBox

oaBox

模块: oapy._oa._base 导入: from oapy._oa import _base

概览

oaBoxoapy 中可用,可通过 _base 模块访问。

本页汇总 oaBox 当前在 oapy 中可用的 Python 接口。

详细说明

The oaBox utility class implements a two-dimensional rectangular region with integer coordinates。 This class is used throughout the database to represent the bounding boxes of objects。 If coordinates are stored in a bounding box such that the left value is greater than the right value, or the bottom value is greater than the top value, then the bounding box is referred to as inverted。 Inverted bounding boxes are used to indicate that no valid bounding coordinates are present。 The coordinates are in integer data base units (DBUs) which get mapped to defined distances by settings in the technology data base。 See oaTech::getDBUPerUU for more。 When the data base units are set to 1000 per micron, the coordinate range for OpenAccess is +/-2.147 meters。

构造函数

_base.oaBox()

obj = _base.oaBox()

_base.oaBox(leftIn, bottomIn, rightIn, topIn)

obj = _base.oaBox(leftIn, bottomIn, rightIn, topIn)

_base.oaBox(lowerLeftIn, upperRightIn)

obj = _base.oaBox(lowerLeftIn, upperRightIn)

_base.oaBox(center, size)

obj = _base.oaBox(center, size)

_base.oaBox(box, xform)

obj = _base.oaBox(box, xform)

方法总览

状态 Python 调用
obj.lowerLeft()
obj.upperRight()
obj.left()
obj.bottom()
obj.right()
obj.top()
obj.lowerLeft()
obj.upperRight()
obj.left()
obj.bottom()
obj.right()
obj.top()
obj.set(leftIn=INT_MAX, bottomIn=INT_MAX, rightIn=INT_MIN, topIn=INT_MIN)
obj.set(lowerLeftIn, upperRightIn)
obj.set(center, size)
obj.set(box, xform)
obj.getWidth()
obj.getHeight()
obj.getCenter(result)
obj.getLowerRight(result)
obj.getUpperLeft(result)
obj.hasNoArea()
obj.isInverted()
obj.overlaps(box, incEdges=true)
obj.overlaps(seg, incEdges=true)
obj.contains(box, incEdges=true)
obj.contains(point, incEdges=true)
obj.distanceFrom2(point)
obj.fix(result)
obj.fix()
obj.transform(xform, result)
obj.transform(xform)
obj.transform(offset, result)
obj.transform(offset)
obj.transform(scale, angle, result)
obj.transform(scale, angle)
obj.scale(scale)
obj.merge(box, result)
obj.merge(box)
obj.merge(point, result)
obj.merge(point)
obj.intersection(box, result)
obj.intersection(box)
obj.makeZero()
obj.makeInvertedZero()
obj.init()
obj.toPoints(points)
obj.operator==(bBox)
obj.operator!=(bBox)

方法说明

obj.lowerLeft()

绑定状态: 已绑定

Python 调用: obj.lowerLeft()

This function returns the value of the lower-left point of this box。 This is an accessor function, and you cannot modify the attributes。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.lowerLeft()

obj.upperRight()

绑定状态: 已绑定

Python 调用: obj.upperRight()

This function returns the value of the upper-right point of this box。 This is an accessor function, and you cannot modify the attributes。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.upperRight()

obj.left()

绑定状态: 已绑定

Python 调用: obj.left()

This function returns the value of the left coordinate attribute of this box。 This is an accessor function, and you cannot modify the attribute。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.left()

obj.bottom()

绑定状态: 已绑定

Python 调用: obj.bottom()

This function returns the value of the bottom coordinate attribute of this box。 This is an accessor function, and you cannot modify the attribute。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.bottom()

obj.right()

绑定状态: 已绑定

Python 调用: obj.right()

This function returns the value of the right coordinate attribute of this box。 This is an accessor function, and you cannot modify the attribute。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.right()

obj.top()

绑定状态: 已绑定

Python 调用: obj.top()

This function returns the value of the top coordinate attribute of this box。 This is an accessor function, and you cannot modify the attribute。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.top()

obj.lowerLeft()

绑定状态: 已绑定

Python 调用: obj.lowerLeft()

This function returns a reference to the lower-left point of this box。 You can change the value of the left and bottom attributes。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.lowerLeft()

obj.upperRight()

绑定状态: 已绑定

Python 调用: obj.upperRight()

This function returns a reference to the upper-right point of this box。 You can change the value of the attributes right and top 。 friend class oaChecker < oaBox > [friend]。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.upperRight()

obj.left()

绑定状态: 已绑定

Python 调用: obj.left()

This function returns a reference to the left coordinate attribute of this box。 You can change the value of the attribute left 。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.left()

obj.bottom()

绑定状态: 已绑定

Python 调用: obj.bottom()

This function returns a reference to the bottom coordinate attribute of this box。 You can change the value of the attribute bottom 。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.bottom()

obj.right()

绑定状态: 已绑定

Python 调用: obj.right()

This function returns a reference to the right coordinate attribute of this box。 You can change the value of the attribute right 。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.right()

obj.top()

绑定状态: 已绑定

Python 调用: obj.top()

This function returns a reference to the top coordinate attribute of this box。 You can change the value of the attribute top 。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.top()

obj.set(leftIn=INT_MAX, bottomIn=INT_MAX, rightIn=INT_MIN, topIn=INT_MIN)

绑定状态: 已绑定

Python 调用: obj.set(leftIn=INT_MAX, bottomIn=INT_MAX, rightIn=INT_MIN, topIn=INT_MIN)

This function sets this box to a transformed copy of the specified box。

参数

  • box: The box to copy。
  • xform: The transform to apply to the specified box。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.set(leftIn=INT_MAX, bottomIn=INT_MAX, rightIn=INT_MIN, topIn=INT_MIN)

obj.set(lowerLeftIn, upperRightIn)

绑定状态: 已绑定

Python 调用: obj.set(lowerLeftIn, upperRightIn)

This function sets this box to a square that is centered about the specified oaPoint with each side set to the specified size from the center。

参数

  • center: The oaPoint at which the box is centered。
  • size: The spacing from each side to the center of the box。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.set(lowerLeftIn, upperRightIn)

obj.set(center, size)

绑定状态: 已绑定

Python 调用: obj.set(center, size)

This function sets this box to the specified lower-left and upper-right points。

参数

  • lowerLeftIn: The new lower-left point。
  • upperRightIn: The new upper-right point。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.set(center, size)

obj.set(box, xform)

绑定状态: 已绑定

Python 调用: obj.set(box, xform)

This function sets this box to the specified coordinates。 The coordinates specify the left, bottom, right, and top sides of the box。 All coordinates have default values that set the left and bottom coordinates to the most extreme positive values, and the right and top coordinates to the most extreme negative values。 This is known as an inverted box and can be used to indicate a box that is uninitialized。 Note: The isInverted() function returns true after calling set() without any arguments。

参数

  • leftIn: The new left side coordinate。
  • bottomIn: The new bottom side coordinate。
  • rightIn: The new right side coordinate。
  • topIn: The new top side coordinate。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.set(box, xform)

obj.getWidth()

绑定状态: 已绑定

Python 调用: obj.getWidth()

This function returns the width of this oaBox。 Note: The result of this function is meaningful only for non-inverted boxes。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.getWidth()

obj.getHeight()

绑定状态: 已绑定

Python 调用: obj.getHeight()

This function returns the height of this oaBox。 Note: The result of this function is meaningful only for non-inverted boxes。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.getHeight()

obj.getCenter(result)

绑定状态: 已绑定

Python 调用: obj.getCenter(result)

This function calculates the center of this box and stores the resulting point in the specified location。

参数

  • result: The storage location of the oaPoint that represents the center of this box。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.getCenter(result)

obj.getLowerRight(result)

绑定状态: 已绑定

Python 调用: obj.getLowerRight(result)

This function calculates the lower right corner of this box and stores the resulting point in the specified location。

参数

  • result: The storage location of the oaPoint that represents the lower-right corner of this box。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.getLowerRight(result)

obj.getUpperLeft(result)

绑定状态: 已绑定

Python 调用: obj.getUpperLeft(result)

This function calculates the upper-left corner of this box and stores the resulting point in the specified location。

参数

  • result: The storage location of the oaPoint that represents the upper-left corner of this box。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.getUpperLeft(result)

obj.hasNoArea()

绑定状态: 已绑定

Python 调用: obj.hasNoArea()

This function returns a boolean value indicating whether this box has a zero area。 This value is true if either the left and right coordinates are equal, or the bottom and top coordinates are equal。

返回

  • true if this box has a zero area false if this box has a non-zero area。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.hasNoArea()

obj.isInverted()

绑定状态: 已绑定

Python 调用: obj.isInverted()

This function returns a boolean value indicating whether this box has an inverted height or width value。

返回

  • true if this box has either an inverted height or width value false if both the height and width values are not inverted。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.isInverted()

obj.overlaps(box, incEdges=true)

绑定状态: 已绑定

Python 调用: obj.overlaps(box, incEdges=true)

This function returns a boolean value indicating whether this box overlaps, touches, or contains the specified segment。 The argument 'incEdges' specifies whether the segment is considered to overlap this box if it touches the edge。

返回

  • true if this box overlaps the specified segment。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.overlaps(box, incEdges=true)

obj.overlaps(seg, incEdges=true)

绑定状态: 已绑定

Python 调用: obj.overlaps(seg, incEdges=true)

This function returns a boolean value indicating whether or not this box overlaps or touches the specified box。 The argument 'incEdges' specifies whether the box is considered to overlap this box if it touches the edge。

返回

  • true if this box overlaps the specified box。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.overlaps(seg, incEdges=true)

obj.contains(box, incEdges=true)

绑定状态: 已绑定

Python 调用: obj.contains(box, incEdges=true)

This function returns a boolean value indicating whether the specified point is within or touching the box。 The incEdges argument determines if the specified point is considered within this box if the point is on the edge of this box。

参数

  • point: The point to check。
  • incEdges: A boolean value that determines if the function returns true if the point touches the edge of this box。

返回

  • true if the point is within the box false if the point is not within the box; if incEdges is set to true, a value of true is also returned if the point is on the edge of the box。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.contains(box, incEdges=true)

obj.contains(point, incEdges=true)

绑定状态: 已绑定

Python 调用: obj.contains(point, incEdges=true)

This function returns a boolean value indicating whether this box completely overlaps the specified box。 The incEdges argument determines if the specified box is considered contained in this box if the edges are touching。

参数

  • box: The box to check。
  • incEdges: A boolean value that determines if the box is considered contained if the box is fully enclosed but touches the edge of this box。

返回

  • true if the boxes overlap false if the boxes do not overlap; if incEdges is set to true, a value of true is also returned if the box is fully enclosed but touches the edge of this box。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.contains(point, incEdges=true)

obj.distanceFrom2(point)

绑定状态: 已绑定

Python 调用: obj.distanceFrom2(point)

This function returns the square of the distance from the specified point to the closest point on the boundary of this box。 Note: The result of this function is meaningful only for non-inverted boxes。

参数

  • point: The point to check。

返回

  • The square of the distance from the specified point to the closest point on the boundary of this box。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.distanceFrom2(point)

obj.fix(result)

绑定状态: 已绑定

Python 调用: obj.fix(result)

This function verifies this box is not inverted by checking that the left coordinate is less than or equal to the right coordinate, and the bottom coordinate is less than or equal to the top coordinate。 If the box is inverted, the coordinates are swapped。 The original box is modified to reflect the new coordinates。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.fix(result)

obj.fix()

绑定状态: 已绑定

Python 调用: obj.fix()

This function verifies that this box is not inverted by checking that the left coordinate is less than or equal to the right coordinate, and that the bottom coordinate is less than or equal to the top coordinate。 If the box is inverted, the coordinates are swapped and the corrected box is stored in result, which must not be the original box。 The original box is not changed。

参数

  • result: The updated version of this box。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.fix()

obj.transform(xform, result)

绑定状态: 已绑定

Python 调用: obj.transform(xform, result)

This function transforms this box by the specified scale factor and rotation angle。 The angle can be an arbitrary angle, and the result of the transform will be exact if the angle specified is orthogonal。 If the angle is non-orthogonal, the resulting transform will be as precise as can possibly be presented by integer coordinates。 The original box is modified to reflect this transform。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.transform(xform, result)

obj.transform(xform)

绑定状态: 已绑定

Python 调用: obj.transform(xform)

This function transforms this box by the specified scale factor and rotation angle and stores the resulting transform in result, which may be the original box。 The angle can be an arbitrary angle, and the result of the transform will be exact if the angle specified is orthogonal。 If the angle is non-orthogonal, the resulting transform will be as precise as can possibly be presented by integer coordinates。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.transform(xform)

obj.transform(offset, result)

绑定状态: 已绑定

Python 调用: obj.transform(offset, result)

This function transforms this box by the specified offset。 The original box is modified to reflect this transform。

参数

  • offset: The offset to apply。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.transform(offset, result)

obj.transform(offset)

绑定状态: 已绑定

Python 调用: obj.transform(offset)

This function transforms this box by the specified offset and stores the result in the specified location, which may be the original box。

参数

  • offset: The offset to apply。
  • result: The storage location for the transformed box。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.transform(offset)

obj.transform(scale, angle, result)

绑定状态: 已绑定

Python 调用: obj.transform(scale, angle, result)

This function transforms this box by the specified transform。 The original box is modified to reflect this transform。

参数

  • xform: The transform to apply。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.transform(scale, angle, result)

obj.transform(scale, angle)

绑定状态: 已绑定

Python 调用: obj.transform(scale, angle)

This function transforms this box by the specified transform and stores the result in the specified location, which may be the original box。

参数

  • xform: The transform to apply。
  • result: The storage location for the transformed box。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.transform(scale, angle)

obj.scale(scale)

绑定状态: 已绑定

Python 调用: obj.scale(scale)

This function scales this box, keeping its center the same。 The resulting box will be scaled as precisely as it can be presented by integer coordinates。 The original box is modified to reflect this change。 Note: The result of this function is valid only for non-inverted boxes。

参数

  • scale: The scale factor by which the box dimensions are multiplied。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.scale(scale)

obj.merge(box, result)

绑定状态: 已绑定

Python 调用: obj.merge(box, result)

This function calculates the union of this box with the specified point and stores the result in the original box。

参数

  • point: The oaPoint to merge。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.merge(box, result)

obj.merge(box)

绑定状态: 已绑定

Python 调用: obj.merge(box)

This function calculates the union of this box with the specified point and stores the result in the specified location。

参数

  • point: The oaPoint to merge。
  • result: The storage location of the result。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.merge(box)

obj.merge(point, result)

绑定状态: 已绑定

Python 调用: obj.merge(point, result)

This function calculates the union of this box with the specified box and stores the result in place of the original box。

参数

  • box: The box to merge。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.merge(point, result)

obj.merge(point)

绑定状态: 已绑定

Python 调用: obj.merge(point)

This function calculates the union of this box with the specified box and stores the result in the specified location。

参数

  • box: The box to merge。
  • result: The storage location of the merge result。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.merge(point)

obj.intersection(box, result)

绑定状态: 已绑定

Python 调用: obj.intersection(box, result)

This function calculates the intersection between this box and the specified box。 The result is stored in place of the original。 If the boxes do not intersect, the result is an inverted box。 Note: The result of this function is meaningful only for non-inverted boxes。

参数

  • box: The box to check。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.intersection(box, result)

obj.intersection(box)

绑定状态: 已绑定

Python 调用: obj.intersection(box)

This function calculates the intersection between this box and the specified box。 The result is stored in the specified location。 If the boxes do not intersect, the result is an inverted value。 Note: The result of this function is meaningful only for non-inverted boxes。

参数

  • box: The box to check for an intersection。
  • result: The storage location for the resulting box。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.intersection(box)

obj.makeZero()

绑定状态: 已绑定

Python 调用: obj.makeZero()

This function sets all coordinates of this box to zero。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.makeZero()

obj.makeInvertedZero()

绑定状态: 已绑定

Python 调用: obj.makeInvertedZero()

This function sets all coordinates of this box to zero if the box was inverted。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.makeInvertedZero()

obj.init()

绑定状态: 已绑定

Python 调用: obj.init()

This function sets the left and bottom coordinates of this bounding box to the extreme positive values and the right and top coordinates to the extreme negative values。 This inverted value is useful as an initial condition when you want to merge several boxes。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.init()

obj.toPoints(points)

绑定状态: 已绑定

Python 调用: obj.toPoints(points)

This function fills out points with the four points that define this box。 It is assumed that points are already allocated and the points are at least four points in length。 The points are written in clockwise order starting from the lower left point。

参数

  • points: A pre-allocated array in which the points are stored。

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.toPoints(points)

obj.operator==(bBox)

绑定状态: 已绑定

Python 调用: obj.operator==(bBox)

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.operator==(bBox)

obj.operator!=(bBox)

绑定状态: 已绑定

Python 调用: obj.operator!=(bBox)

Python 示例

from oapy._oa import _base

# assume obj is a oaBox
obj.operator!=(bBox)