PyANGKernel.GKBBox¶
- class GKBBox¶
Synopsis¶
Methods¶
def
__init__()def
altitude()def
as2DPolygon()def
center()def
contains2D()def
contains3D()def
expand()def
expand3D()def
expandHeight()def
expandWidth()def
height()def
intersects2D()def
intersects3D()def
isUndefined()def
__ne__()def
__or__()def
radious()def
scale()def
set()def
translate()def
undefine()def
width()def
x()def
y()def
z()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
A bounding box is the minimum size rectangle that englobes completely a graphic shape. It is defined by two points, called from and to, for the bottom-left and top-right coordinates of the rectangle.
A bbox have two states: defined or undefined. An undefined bbox means that the bottom-left and top-right coordinates stored on it cannot be used since they have not been calculated yet. A defined bbox means that the bottom-left and top-right coordinates have been calculated for the graphical object’s shape.
A bbox is undefined when created and can be undefined (to discard the current calculated coordinates) using the method undefined().
Using the set or the expand methods an undefined bbox is defined.
- PyANGKernel.GKBBox.from¶
- PyANGKernel.GKBBox.to¶
- __init__()¶
- __init__(rec)
- Parameters:
rec –
GKBBox
- __init__(points)
- Parameters:
points –
GKPoints
- __init__(x, y, X, Y)
- Parameters:
x – float
y – float
X – float
Y – float
- __init__(x, y, z, X, Y, Z)
- Parameters:
x – float
y – float
z – float
X – float
Y – float
Z – float
Returns the altitude of the bounding box.
Returns this bbox as a 2D polygon of 4 points
Calculates and returns the center of the bbox.
It returns true if p is inside the bbox without taking into account the z coordinate in the box and in the point.
It returns true if p is inside the bbox without taking into account the z coordinate in the box and in the point.
- contains2D(px, py)
- Parameters:
px – float
py – float
- Return type:
It returns true if (px, py) is inside the bbox without taking into account the z coordinate in the box and in the point.
Returns true if rec is inside the bbox.
Returns true if p is inside the bbox.
Makes this bbox greater if it is too small (width or height almost zero) It changes the bbox if width or height is less than 0.5 m adding 0.5 m to its size.
Expands the bbox in both x and y limits with “width” and height
Expands a bbox with the bbox rec. If rec is inside the bbox nothing happen. If rec is outside the bbox it will grow to keep rec inside.
- expand3D(p)
- Parameters:
p –
GKPoint
Expands a bbox with the point p. If p is inside the bbox nothing happen. If p is outside the bbox it will grow to keep p inside.
- expand3D(points)
- Parameters:
points –
GKPoints
Expands a bbox with points. If all the points in points are inside the bbox nothing happen. If any point is outside it will grow to keep the point inside.
Expands the bbox in both y limits with “size”
Expands the bbox in both x limits with “size”
Returns the area (in square m) of this bbox
Returns the height of the bounding box.
- intersections2D(line2[, epsilon=0.00001])¶
Returns true if rec is inside the bbox or if both bboxes intersect.
- intersects2D(line2, point[, epsilon=0.00001])
If this and line2 intersect returns true and finds the intersection point p. Remember that lines perpendicular to the x axis are codified with slope = DBL_MAX and coef = x. Epsilon is the allowed difference between slopes to consider both lines parallel
- intersects3D(box, resultBox[, noZ=false])¶
Returns true if the two given bounding boxes intersect
Returns true if the bbox bottom-left and top-right points have not been calculated yet and false otherwise.
Returns true if the compared bounding boxes are different
Calculates and returns the radious of a circle that totally encloses the bbox. This circle is centered at
center().- scale(factor)¶
- Parameters:
factor – float
Scales the bbox. Keeps the same center.
Calculates the bbox of points. The previous bottom-left and top-right coordinates are discarded.
Creates a bbox using two points. The previous bottom-left and top-right coordinates are discarded.
- set(x, y, X, Y)
- Parameters:
x – float
y – float
X – float
Y – float
Creates a bbox using two points. The previous bottom-left and top-right coordinates are discarded.
- set(x, y, z, X, Y, Z)
- Parameters:
x – float
y – float
z – float
X – float
Y – float
Z – float
Creates a bbox using two points. The previous bottom-left and top-right coordinates are discarded.
Translates the bbox to a new location. That is: add inc to from and to
- undefine()¶
Marks the bbox as undefined. Values in from and to cannot be used.
Returns the width of the bounding box.
Returns the x coordinate of the “from” point of the bounding box, the minimum x of the box.
Returns the y coordinate of the “from” point of the bounding box, the minimum y of the box.
Returns the z coordinate of the “from” point of the bounding box, the minimum z of the box.