new BoundingRectangle(xopt, yopt, widthopt, heightopt)
A bounding rectangle given by a corner, width and height.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
x |
Number |
<optional> |
0.0 | The x coordinate of the rectangle. |
y |
Number |
<optional> |
0.0 | The y coordinate of the rectangle. |
width |
Number |
<optional> |
0.0 | The width of the rectangle. |
height |
Number |
<optional> |
0.0 | The height of the rectangle. |
- Source:
- See:
-
- BoundingSphere
- Packable
Members
(static) packedLength :Number
The number of elements used to pack the object into an array.
Type:
- Number
- Source:
height :Number
The height of the rectangle.
Type:
- Number
- Default Value:
- 0.0
- Source:
width :Number
The width of the rectangle.
Type:
- Number
- Default Value:
- 0.0
- Source:
x :Number
The x coordinate of the rectangle.
Type:
- Number
- Default Value:
- 0.0
- Source:
y :Number
The y coordinate of the rectangle.
Type:
- Number
- Default Value:
- 0.0
- Source:
Methods
(static) clone(rectangle, resultopt) → {BoundingRectangle}
Duplicates a BoundingRectangle instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
rectangle |
BoundingRectangle | The bounding rectangle to duplicate. | |
result |
BoundingRectangle |
<optional> |
The object onto which to store the result. |
- Source:
Returns:
The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined)
- Type
- BoundingRectangle
(static) equals(leftopt, rightopt) → {Boolean}
Compares the provided BoundingRectangles componentwise and returns
true
if they are equal, false
otherwise.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
left |
BoundingRectangle |
<optional> |
The first BoundingRectangle. |
right |
BoundingRectangle |
<optional> |
The second BoundingRectangle. |
- Source:
Returns:
true
if left and right are equal, false
otherwise.
- Type
- Boolean
(static) expand(rectangle, point, resultopt) → {BoundingRectangle}
Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
rectangle |
BoundingRectangle | A rectangle to expand. | |
point |
Cartesian2 | A point to enclose in a bounding rectangle. | |
result |
BoundingRectangle |
<optional> |
The object onto which to store the result. |
- Source:
Returns:
The modified result parameter or a new BoundingRectangle instance if one was not provided.
- Type
- BoundingRectangle
(static) fromPoints(positions, resultopt) → {BoundingRectangle}
Computes a bounding rectangle enclosing the list of 2D points.
The rectangle is oriented with the corner at the bottom left.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
positions |
Array.<Cartesian2> | List of points that the bounding rectangle will enclose. Each point must have x and y properties. |
|
result |
BoundingRectangle |
<optional> |
The object onto which to store the result. |
- Source:
Returns:
The modified result parameter or a new BoundingRectangle instance if one was not provided.
- Type
- BoundingRectangle
(static) fromRectangle(rectangle, projectionopt, resultopt) → {BoundingRectangle}
Computes a bounding rectangle from an rectangle.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
rectangle |
Rectangle | The valid rectangle used to create a bounding rectangle. | ||
projection |
Object |
<optional> |
GeographicProjection | The projection used to project the rectangle into 2D. |
result |
BoundingRectangle |
<optional> |
The object onto which to store the result. |
- Source:
Returns:
The modified result parameter or a new BoundingRectangle instance if one was not provided.
- Type
- BoundingRectangle
(static) intersect(left, right) → {Intersect}
Determines if two rectangles intersect.
Parameters:
Name | Type | Description |
---|---|---|
left |
BoundingRectangle | A rectangle to check for intersection. |
right |
BoundingRectangle | The other rectangle to check for intersection. |
- Source:
Returns:
Intersect.INTESECTING
if the rectangles intersect, Intersect.OUTSIDE
otherwise.
- Type
- Intersect
(static) pack(value, array, startingIndexopt) → {Array.<Number>}
Stores the provided instance into the provided array.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value |
BoundingRectangle | The value to pack. | ||
array |
Array.<Number> | The array to pack into. | ||
startingIndex |
Number |
<optional> |
0 | The index into the array at which to start packing the elements. |
- Source:
Returns:
The array that was packed into
- Type
- Array.<Number>
(static) union(left, right, resultopt) → {BoundingRectangle}
Computes a bounding rectangle that is the union of the left and right bounding rectangles.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
left |
BoundingRectangle | A rectangle to enclose in bounding rectangle. | |
right |
BoundingRectangle | A rectangle to enclose in a bounding rectangle. | |
result |
BoundingRectangle |
<optional> |
The object onto which to store the result. |
- Source:
Returns:
The modified result parameter or a new BoundingRectangle instance if one was not provided.
- Type
- BoundingRectangle
(static) unpack(array, startingIndexopt, resultopt) → {BoundingRectangle}
Retrieves an instance from a packed array.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
array |
Array.<Number> | The packed array. | ||
startingIndex |
Number |
<optional> |
0 | The starting index of the element to be unpacked. |
result |
BoundingRectangle |
<optional> |
The object into which to store the result. |
- Source:
Returns:
The modified result parameter or a new BoundingRectangle instance if one was not provided.
- Type
- BoundingRectangle
clone(resultopt) → {BoundingRectangle}
Duplicates this BoundingRectangle instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
result |
BoundingRectangle |
<optional> |
The object onto which to store the result. |
- Source:
Returns:
The modified result parameter or a new BoundingRectangle instance if one was not provided.
- Type
- BoundingRectangle
equals(rightopt) → {Boolean}
Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns
true
if they are equal, false
otherwise.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
right |
BoundingRectangle |
<optional> |
The right hand side BoundingRectangle. |
- Source:
Returns:
true
if they are equal, false
otherwise.
- Type
- Boolean
intersect(right) → {Intersect}
Determines if this rectangle intersects with another.
Parameters:
Name | Type | Description |
---|---|---|
right |
BoundingRectangle | A rectangle to check for intersection. |
- Source:
Returns:
Intersect.INTESECTING
if the rectangles intersect, Intersect.OUTSIDE
otherwise.
- Type
- Intersect