Options
All
  • Public
  • Public/Protected
  • All
Menu

A Bounds object is a 3D axis-aligned box. It has a location, a width, height, and a depth. The location is represented by the smallest x, y and z coordinate encompassed by the box, i.e. the lower-left corner. The width, height and depth are the box's extents in the positive directions of the x, y and z axis, respectively.

Note that Bounds instances will be normalized when (re)configuring them. width, h In case the Bounds instance is defined in a GEODETIC coordinate system, the properties will be normalized:
  • the x coordinate will be in the [-180, 180] range.
  • the width will be in the [0, 360] range. In case the width covers the entire world, the x coordinate will be normalized to -180.
  • the y coordinate will be [-90, 90] range.
  • the height coordinate will never exceed the north pole. (i.e. y + height <= 90).
  • no normalization occurs on the z-axis.

The box is typically used as a bounding box for more complex geometries. It must be instantiated using createBounds.

Hierarchy

Implements

Overview

Accessors

bounds

coordinateType

  • The coordinate type this shape. This property is read only. An Error will be thrown when trying to assign to this property.

    Returns CoordinateType

depth

  • get depth(): number
  • set depth(value: number): void
  • The depth of the bounding box (the box's extent along the Z-axis). The depth must be larger than or equal to zero.

    Returns number

  • The depth of the bounding box (the box's extent along the Z-axis). The depth must be larger than or equal to zero.

    Parameters

    • value: number

    Returns any

focusPoint

  • get focusPoint(): Point

height

  • get height(): number
  • set height(value: number): void
  • The height of the bounding box (the box's extent along the Y-axis). The height must be larger than or equal to zero.

    Returns number

  • The height of the bounding box (the box's extent along the Y-axis). The height must be larger than or equal to zero.

    Parameters

    • value: number

    Returns any

reference

  • The spatial reference of this shape. This property is read only. An Error will be thrown when trying to assign to this property.

    Returns CoordinateReference | null

type

width

  • get width(): number
  • set width(value: number): void
  • The width of this bounding box (the box's extent along the x-axis). The width must be larger than or equal to zero.

    Returns number

  • The width of this bounding box (the box's extent along the x-axis). The width must be larger than or equal to zero.

    Parameters

    • value: number

    Returns any

x

  • get x(): number
  • set x(value: number): void
  • The x coordinate or longitude of the location of the bounding box.

    Returns number

  • The x coordinate or longitude of the location of the bounding box.

    Parameters

    • value: number

    Returns any

y

  • get y(): number
  • set y(value: number): void
  • The y coordinate or latitude of the location of the bounding box.

    Returns number

  • The y coordinate or latitude of the location of the bounding box.

    Parameters

    • value: number

    Returns any

z

  • get z(): number
  • set z(value: number): void
  • The z coordinate of the location of the bounding box.

    Returns number

  • The z coordinate of the location of the bounding box.

    Parameters

    • value: number

    Returns any

Methods

Abstract contains2D

  • Determines whether a given bounds is inside this bounds. This method checks containment only in two dimensions: on the (x,y)-axis or the (lon,lat)-axis (depending on the spatial reference of the shape).

    throws

    InvalidReferenceError when passing a Bounds with another spatial reference

    deprecated

    Please use contains2DBounds instead.

    Parameters

    • bounds: Bounds

      The bounds for which containment must be checked. If a 3D bounds is passed to this function, it will be treated as a 2D bounds: the z coordinate (height) will be ignored. The reference of the passed bounds must be the same reference as this Bounds

    Returns boolean

    true when the given bounds are contained in this bounds

contains2DBounds

  • Determines whether a given bounds is inside this bounds. This method checks containment only in two dimensions: on the (x,y)-axis or the (lon,lat)-axis (depending on the spatial reference of the shape).

    throws

    InvalidReferenceError when passing a Bounds with another spatial reference

    Parameters

    • bounds: Bounds

      The bounds for which containment must be checked. If a 3D bounds is passed to this function, it will be treated as a 2D bounds: the z coordinate (height) will be ignored. The reference of the passed bounds must be the same reference as this Bounds

    Returns boolean

    true when the given bounds are contained in this bounds

Abstract contains2DCoordinates

  • (x: number, y: number): boolean
  • Determines whether the given point is inside this shape. This method checks containment only in two dimensions: on the (x,y)-axis or the (lon,lat)-axis (depending on the spatial reference of the shape).

    throws

    InvalidReferenceError when passing a Point with another spatial reference

    Parameters

    • x: number

      The x coordinate of the point for which containment must be checked

    • y: number

      The y coordinate of the point for which containment must be checked

    Returns boolean

    true when the given point is contained in this shape

contains2DPoint

  • (point: Point): boolean
  • Determines whether the given point is inside this shape. This method checks containment only in two dimensions: on the (x,y)-axis or the (lon,lat)-axis (depending on the spatial reference of the shape).

    throws

    InvalidReferenceError when passing a Point with another spatial reference

    Parameters

    • point: Point

      The point for which containment must be checked.

    Returns boolean

    true when the given point is contained in this shape

contains3D

  • Check whether this Bounds instance contains the bounds in the 3D space.

    throws

    InvalidReferenceError when the reference of the bounds parameter does not correspond with the reference of this Bounds

    deprecated

    Please use contains3DBounds instead.

    Parameters

    • pointOrBounds: Point | Bounds

      The bounds or point whose containment must be checked

    Returns boolean

    true when the point or bounds are contained

Abstract contains3DBounds

  • Check whether this Bounds instance contains the bounds in the 3D space.

    throws

    InvalidReferenceError when the reference of the bounds parameter does not correspond with the reference of this Bounds

    Parameters

    • bounds: Bounds

      The bounds whose containment must be checked

    Returns boolean

    true when the point or bounds are contained

contains3DPoint

  • (point: Point): boolean
  • Determines whether a given point is inside this shape. This method checks containment in three dimensions: on the (x,y,z)-axis or the (lon,lat,height)-axis (depending on the spatial reference of the shape).

    throws

    InvalidReferenceError when passing a Point with another spatial reference.

    Parameters

    • point: Point

      The point for which containment must be checked. If a 3D point is passed to this function, a z-coordinate (height) value of 0 is assumed. This point must have the same spatial reference as the shape.

    Returns boolean

Abstract copy

Abstract equals

  • (otherShape: Shape): boolean
  • Indicates whether this shape is equal to another.

    Parameters

    • otherShape: Shape

      the other shape this shape is compared with.

    Returns boolean

    true if both shapes are equal, false otherwise.

Abstract interacts2D

  • Checks whether this Bounds object interacts with the given Bounds object in the 2D space. Only the first two dimensions of the Bounds objects are considered.

    Parameters

    • bounds: Bounds

      the bounds to compare with.

    Returns boolean

    the boolean result of the interaction test.

move2D

  • (xOrPoint: number | Point, y?: number): void
  • Moves the location of this Bounds instance to the location specified by x and y.

    throws

    InvalidReferenceError when the reference of the Point parameter does not correspond with the reference of this Bounds.

    Parameters

    • xOrPoint: number | Point

      x coordinate value or the location as a point.

    • Optional y: number

      y coordinate value

    Returns void

Abstract move2DToCoordinates

  • (x: number, y: number): void
  • Moves the location of this Bounds instance to the location specified by x and y.

    Parameters

    • x: number

      x coordinate value

    • y: number

      y coordinate value

    Returns void

move2DToPoint

  • Moves the location of this Bounds instance to the location of the point. The z-value of the point is ignored.

    throws

    InvalidReferenceError when the reference of the Point parameter does not correspond with the reference of this Bounds.

    Parameters

    • point: Point

      a Point instance or x coordinate value

    Returns void

move3D

  • (xOrPoint: number | Point, y?: number, z?: number): void
  • Moves this Bounds instance to the location specified by the x, y and z parameters.

    throws

    InvalidReferenceError when the reference of the Point parameter does not correspond with the reference of this Bounds.

    Parameters

    • xOrPoint: number | Point

      x coordinate value or the point to move the location of this bounds to

    • Optional y: number

      y coordinate value

    • Optional z: number

      z coordinate value

    Returns void

Abstract move3DToCoordinates

  • (x: number, y: number, z: number): void
  • Moves this Bounds instance to the location specified by the x, y and z parameters.

    Parameters

    • x: number

      x coordinate value

    • y: number

      y coordinate value

    • z: number

      z coordinate value

    Returns void

move3DToPoint

  • Moves this Bounds instance to the location in 3D space as specified by the point.

    throws

    InvalidReferenceError when the reference of the Point parameter does not correspond with the reference of this Bounds.

    Parameters

    • point: Point

      the point to move the location of this bounds to.

    Returns void

Abstract setTo2D

  • (x: number, width: number, y: number, height: number): void
  • Configure this Bounds instance in 2 dimensions.

    Parameters

    • x: number

      The x coordinate of Bounds instance's location.

    • width: number

      The width of the Bounds instance.

    • y: number

      The y coordinate of the Bounds instance's

    • height: number

      The height of the Bounds instance's location

    Returns void

Abstract setTo2DIntersection

  • Calculates the 2D intersection of this Bounds instance and a given Bounds instance. Only the first two dimensions of the Bounds objects are considered. This Bounds object is updated with the result. Its third dimension is left unchanged.

    throws

    InvalidReferenceError when the reference of the Bounds parameter does not correspond with the reference of this Bounds object

    Parameters

    • bounds: Bounds

      the other Bounds operand for the intersection.

    Returns void

Abstract setTo2DUnion

  • Calculates the 2D union of this Bounds instance and a given Bounds instance. The result contains at least all the points that are contained in either of the Bounds objects (and typically more). Only the first two dimensions of the Bounds objects are considered. This Bounds object is updated with the result. Its third dimension is left unchanged.

    throws

    InvalidReferenceError when the reference of the Bounds parameter does not correspond with the reference of this Bounds object

    Parameters

    • bounds: Bounds

      the other Bounds operand for the union.

    Returns void

Abstract setTo3D

  • (x: number, width: number, y: number, height: number, z: number, depth: number): void
  • Configure this Bounds instance in 3 dimensions.

    Parameters

    • x: number

      The x coordinate of Bounds instance's location.

    • width: number

      The width of the Bounds instance.

    • y: number

      The y coordinate of the Bounds instance's

    • height: number

      The height of the Bounds instance's location

    • z: number

      The z coordinate of the Bounds instance's

    • depth: number

      The depth of the Bounds instance's location

    Returns void

Abstract setTo3DIntersection

  • Calculates the 3D intersection of this Bounds instance and a given Bounds instance. This Bounds object is updated with the result.

    throws

    InvalidReferenceError when the reference of the Bounds parameter does not correspond with the reference of this Bounds object

    Parameters

    • bounds: Bounds

      the other Bounds operand for the intersection.

    Returns void

Abstract setTo3DUnion

  • Calculates the 3D union of this Bounds object and a given Bounds object. The result contains at least all the points that are contained in either or both of the Bounds objects (and typically more). This Bounds object is updated with the result.

    throws

    InvalidReferenceError when the reference of the Bounds parameter does not correspond with the reference of this Bounds object

    Parameters

    • bounds: Bounds

      the other Bounds operand for the union.

    Returns void

Abstract setToBounds2D

  • Configure this Bounds instance in 2 dimensions, using the dimensions of another Bounds instance.

    throws

    InvalidReferenceError if bounds is defined in a different reference

    Parameters

    • bounds: Bounds

      the bounds that must be used to configure this bounds. Only the x, width, y and height properties of this bounds instance will be considered.

    Returns void

Abstract setToBounds3D

  • Configure this Bounds instance in 2 dimensions, using the dimensions of another Bounds instance.

    throws

    InvalidReferenceError if bounds is defined in a different reference

    Parameters

    • bounds: Bounds

      the bounds that must be used to configure this bounds.

    Returns void

Abstract setToIncludePoint2D

  • Calculates the 2D extension of this Bounds object that contains a given Point. The result contains at least the given point and all the points that are contained in this Bounds (and typically more). Only the first two dimensions of this Bounds object and the Bounds are considered. This Bounds object is updated with the result. Its third dimension is left unchanged.

    throws

    InvalidReferenceError When the passed Point's reference does not match the spatial reference of this Bounds.

    Parameters

    • point: Point

      the point that should be inside (or at the edge) after the extension of the bounds.

    Returns void

Abstract setToIncludePoint3D

  • Calculates the 3D extension of this Bounds that contains a given Point. The result contains at least the given point and all the points that are contained in this Bounds (and typically more). This Bounds object is updated
    with the result.

    throws

    InvalidReferenceError When the passed Point's reference does not match the spatial reference of this Bounds.

    Parameters

    • point: Point

      the point operand for the union.

    Returns void

toString

  • (): string

translate

  • (x: number, y: number, z?: number): void
  • Translates this bounds from its current position over the given translation vector to another location. This method can be called with an x, y and optionally a z value. If the z coordinate is not specified, the translation will only affect the x and y coordinate.

    Parameters

    • x: number

      x coordinate value

    • y: number

      y coordinate value

    • Optional z: number

      z coordinate value, may be omitted.

    Returns void

Abstract translate2D

  • (x: number, y: number): void
  • Translates the shape over the given vector in 2D space.

    Parameters

    • x: number

      The x coordinate of the translation vector

    • y: number

      The y coordinate of the translation vector

    Returns void

Abstract translate3D

  • (x: number, y: number, z: number): void
  • Translates this bounds from its current position over the given translation vector to another location.

    Parameters

    • x: number

      x coordinate value

    • y: number

      y coordinate value

    • z: number

      z coordinate value

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method