oaPointArray
模块: oapy._oa._base
导入: from oapy._oa import _base
概览
oaPointArray 在 oapy 中可用,可通过 _base 模块访问。
本页汇总 oaPointArray 当前在 oapy 中可用的 Python 接口。
详细说明
The oaPointArray class represents an array of two-dimensional integer points。 These are used in the API to specify a number of figures such as oaPolygons and oaPaths。 See oaPolygon::create for an example。 PointArrays can be used either to indicate a closed figure, such as a polygon, or an open set of points such as a line。 When used to describe a closed figure, the connection between the first and last point is always implicit。 In such usage it is an error to have the first and last point be the same。 Some member functions of oaPointArray have an isClosed flag to indicate whether the array is intended to describe a closed figure or an open line。 Many functions that use PointArrays only apply to closed figures, and a flag is not needed for these functions。 PointArrays used as arguments to member functions of oaFig classes should always be well-formed such that they do not contain duplicate or collinear points。 oaPointArray::compress() can be used to remove such points from the array。 Like all oaArray classes, oaPointArrays have separate counts for their allocated size and for the number of elements currently in use。 For good performance be sure to avoid small incremental allocations as elements are added to an array。
构造函数
_base.oaPointArray(sizeIn=0)
obj = _base.oaPointArray(sizeIn=0)
_base.oaPointArray(pointsIn)
obj = _base.oaPointArray(pointsIn)
_base.oaPointArray(pointsIn, xform)
obj = _base.oaPointArray(pointsIn, xform)
_base.oaPointArray(pointsIn, offset)
obj = _base.oaPointArray(pointsIn, offset)
_base.oaPointArray(pointsIn[], numPointsIn)
obj = _base.oaPointArray(pointsIn[], numPointsIn)
_base.oaPointArray(rectIn)
obj = _base.oaPointArray(rectIn)
方法总览
| 状态 | Python 调用 |
|---|---|
| ✅ | obj.isSelfIntersecting(isClosed=true) |
| ✅ | obj.isOrthogonal(isClosed=true) |
| ✅ | obj.isRectangle() |
| ✅ | obj.onEdge(point, isClosed=true) |
| ✅ | obj.contains(point, includeEdges=true) |
| ✅ | obj.contains(box) |
| ✅ | obj.overlaps(box, closed=true) |
| ✅ | obj.distanceFrom2(point) |
| ✅ | obj.getArea() |
| ✅ | obj.hasExtraPoints(isClosed=true) |
| ✅ | obj.compress(pointsOut, isClosed=true) |
| ✅ | obj.compress(isClosed=true) |
| ✅ | obj.transform(xform, result) |
| ✅ | obj.transform(xform) |
| ✅ | obj.transform(offset, result) |
| ✅ | obj.transform(offset) |
| ✅ | obj.transform(scale, angle, result) |
| ✅ | obj.transform(scale, angle) |
| ✅ | obj.getBBox(bBox) |
方法说明
obj.isSelfIntersecting(isClosed=true)
绑定状态: 已绑定
Python 调用: obj.isSelfIntersecting(isClosed=true)
This function returns a boolean value that indicates if this oaPointArray intersects itself。 This does not include self-touching oaPointArrays。
参数
isClosed: specify true if the first and last points in the array should be treated as connected (the figure described by the point array is closed); specify false if the first and last points should be treated as unconnected (the figure described by the point array is open)。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.isSelfIntersecting(isClosed=true)
obj.isOrthogonal(isClosed=true)
绑定状态: 已绑定
Python 调用: obj.isOrthogonal(isClosed=true)
This function returns a boolean value that indicates if all of the angles in this oaPointArray are multiples of 90 degrees。
参数
isClosed: specify true if the first and last points in the array should be treated as connected (the figure described by the point array is closed); specify false if the first and last points should be treated as unconnected (the figure described by the point array is open)。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.isOrthogonal(isClosed=true)
obj.isRectangle()
绑定状态: 已绑定
Python 调用: obj.isRectangle()
This function returns true if this oaPointArray describes a rectangle that could be created as an oaRect 。 Specifically, to return true the point array must have four points after collinear and coincident points have been removed, and those points must be the corners of a rectangle with horizontal and vertical sides。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.isRectangle()
obj.onEdge(point, isClosed=true)
绑定状态: 已绑定
Python 调用: obj.onEdge(point, isClosed=true)
This function returns a boolean value that indicates if the specified point is on this oaPointArray。
参数
point: the point to look for on this oaPointArray。isClosed: specify true if the first and last points in the array should be treated as connected (the figure described by the point array is closed); specify false if the first and last points should be treated as unconnected (the figure described by the point array is open)。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.onEdge(point, isClosed=true)
obj.contains(point, includeEdges=true)
绑定状态: 已绑定
Python 调用: obj.contains(point, includeEdges=true)
This function returns a boolean indicating whether or not this pointArray, which is assumed to be closed, contains the specified oaBox 。
参数
box: the oaBox to test against。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.contains(point, includeEdges=true)
obj.contains(box)
绑定状态: 已绑定
Python 调用: obj.contains(box)
This function returns a boolean indicating whether or not the specified point is inside or on the edge of this pointArray。 Note: the point array is assumed to be closed--that is, the first and last points in the array are treated as connected。
参数
point: the point to test。includeEdges: boolean that specifies whether or not points on the edge of the point array are assumed to be contained。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.contains(box)
obj.overlaps(box, closed=true)
绑定状态: 已绑定
Python 调用: obj.overlaps(box, closed=true)
This function returns a boolean value that indicates if the specified box overlaps or touches this oaPointArray。 Note: overlaps() assumes that the points in the array are specified in clockwise order。
参数
box: the oaBox to test against。closed: indicates whether the pointArray is closed。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.overlaps(box, closed=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 this oaPointArray。 Note: the point array is assumed to be closed--that is, the first and last points in the array are treated as connected。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.distanceFrom2(point)
obj.getArea()
绑定状态: 已绑定
Python 调用: obj.getArea()
This function returns the area in DBUU contained by the oaPointArray。 The PointArray is assumed to be closed。 Note: The points in the array can either be a clockwise or a counter-clockwise enclosure。 However they must not be self-intersecting。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.getArea()
obj.hasExtraPoints(isClosed=true)
绑定状态: 已绑定
Python 调用: obj.hasExtraPoints(isClosed=true)
This function returns true if this pointArray has any collinear or coincident points。 Also returns true if isClosed = true (see below) and the last and first points of the array specify the same point。
参数
isClosed: specify true if the first and last points in the array should be treated as connected (the figure described by the point array is closed); specify false if the first and last points should be treated as unconnected (the figure described by the point array is open)。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.hasExtraPoints(isClosed=true)
obj.compress(pointsOut, isClosed=true)
绑定状态: 已绑定
Python 调用: obj.compress(pointsOut, isClosed=true)
This function removes all collinear and coincident points from this oaPointArray。 An oaPointArray contains coincident points if two adjacent points are identical。 An oaPointArray contains collinear points if three adjacent points lie on the same line。 For closed oaPointArrays (isClosed = true), the first and last point are considered adjacent。 The result of this function is not valid for oaPointArrays containing two adjacent edges that overlap。 Such oaPointArrays are considered illegal for use in figures。 Note: compress() will produce incorrect results if the edges connected by the points in the point array cross。
参数
isClosed: Specify true if the first and last points in the array should be treated as connected (the figure described by the point array is closed); specify false if the first and last points should be treated as unconnected (the figure described by the point array is open)。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.compress(pointsOut, isClosed=true)
obj.compress(isClosed=true)
绑定状态: 已绑定
Python 调用: obj.compress(isClosed=true)
This function returns in pointsOut the point array that is created by removing all collinear and coincident points from this oaPointArray。 The result of this function is not valid for oaPointArrays containing two adjacent edges that overlap。 Such oaPointArrays are considered illegal for use in figures。 Note: compress() will produce incorrect results if the edges connected by the points in the point array cross。
参数
pointsOut: a reference to the compressed oaPointArray produced by this function。isClosed: specify true if the first and last points in the array should be treated as connected (the figure described by the point array is closed); specify false if the first and last points should be treated as unconnected (the figure described by the point array is open)。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.compress(isClosed=true)
obj.transform(xform, result)
绑定状态: 已绑定
Python 调用: obj.transform(xform, result)
This function transforms this oaPointArray by the specified scale factor and rotation angle。 The points are rotated about the origin。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.transform(xform, result)
obj.transform(xform)
绑定状态: 已绑定
Python 调用: obj.transform(xform)
This function transforms this oaPointArray by the specified scale factor and rotation angle。 The points are rotated about the origin。 The result is stored in result, which can be the same point。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.transform(xform)
obj.transform(offset, result)
绑定状态: 已绑定
Python 调用: obj.transform(offset, result)
This function transforms this oaPointArray with the specified offset。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.transform(offset, result)
obj.transform(offset)
绑定状态: 已绑定
Python 调用: obj.transform(offset)
This function transforms this oaPointArray with the specified offset and stores the result in result, which can be the same oaPointArray。 The result is assumed the same size as the pointArray。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.transform(offset)
obj.transform(scale, angle, result)
绑定状态: 已绑定
Python 调用: obj.transform(scale, angle, result)
This function transforms this oaPointArray with the specified transform。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.transform(scale, angle, result)
obj.transform(scale, angle)
绑定状态: 已绑定
Python 调用: obj.transform(scale, angle)
This function transforms this oaPointArray with the specified transform and stores the result in result, which can be the same oaPointArray。 The result is assumed the same size as the oaPointArray。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.transform(scale, angle)
obj.getBBox(bBox)
绑定状态: 已绑定
Python 调用: obj.getBBox(bBox)
This function calculates the bounding box of the points in this oaPointArray。
Python 示例
from oapy._oa import _base
# assume obj is a oaPointArray
obj.getBBox(bBox)