Altus Mapping Engine JavaScript API Reference - v2.0.ut.2153.g60764257e - Tuesday May 16, 2022 SDK Documentation | Builds | BA3 Home
AltusUnified::BoundingBox Class Reference

Public Member Functions

 BoundingBox ()
 Constructor More...
 
 BoundingBox (vec2d min, vec2d max)
 Constructor More...
 
 BoundingBox (double minX, double minY, double maxX, double maxY)
 Constructor More...
 
 BoundingBox (VectorVec2d points)
 Constructor More...
 
bool isValid ()
 Is this bounding box valid? minX < = maxX minY < = maxY minX >= -180.0 maxX < = 180.0 minY >= -90.0 maxY < = 90.0 More...
 
bool intersects (BoundingBox box)
 Does the passed BoundingBox intersect this one? More...
 
bool contains (vec2d point)
 Does this BoundingBox contain a point? More...
 
bool contains (BoundingBox bounds)
 Does this BoundingBox contain the passed BoundingBox? More...
 
vec2d center ()
 Gets the center point of this BoundingBox More...
 
vec2d size ()
 Gets the size of this BoundingBox (max - min) More...
 
GeoBoundingBox toGeoBoundingBox ()
 Constructs and returns a GeoBoundingBox with the bounds of this BoundingBox More...
 
bool crossesMeridian ()
 Does this BoundingBox cross the prime meridian? More...
 
BoundingBox intersect (BoundingBox otherBox)
 Gets a BoundingBox representing the intersection of this box and the passed box More...
 
BoundingBox combine (BoundingBox other)
 Gets a BoundingBox encompassing both this box and the passed box More...
 
BoundingBox relativeBounds (BoundingBox other)
 Gets the normalized bounds of the passed box in relation to this box. Calling this.RelativeBounds(this) will return a BoundingBox with min = (0,0), max = (1,1). More...
 
double distanceToPoint (vec2d point)
 Gets the nearest distance between this box and a point. More...
 
VectorBoundingBox divide (int xSides, int ySides)
 Generate a grid of BoundingBoxes by dividing this BoundingBox into xSides columns and ySides rows. More...
 
string toString ()
 Gets a string describing this BoundingBox. More...
 
vec2d min ()
 The minimum of this BoundingBox. More...
 
void min_set (vec2d val)
 
vec2d max ()
 The maximum of this BoundingBox. More...
 
void max_set (vec2d val)
 

Constructor & Destructor Documentation

AltusUnified::BoundingBox::BoundingBox ( )

Constructor

AltusUnified::BoundingBox::BoundingBox ( vec2d  min,
vec2d  max 
)

Constructor

Parameters
minvec2d, minX and minY
maxvec2d, maxX and maxY
AltusUnified::BoundingBox::BoundingBox ( double  minX,
double  minY,
double  maxX,
double  maxY 
)

Constructor

Parameters
minXThe minimum x value in decimal degrees
minYThe minimum y value in decimal degrees
maxXThe maximum x value in decimal degrees
maxYThe maximum y value in decimal degrees
AltusUnified::BoundingBox::BoundingBox ( VectorVec2d  points)

Constructor

Parameters
pointsA vector of vec2d's containing the minimum and maximum points of the box, in decimal degrees: point1 (minX, minY), point2 (maxX, maxY)

Member Function Documentation

vec2d AltusUnified::BoundingBox::center ( )

Gets the center point of this BoundingBox

BoundingBox AltusUnified::BoundingBox::combine ( BoundingBox  other)

Gets a BoundingBox encompassing both this box and the passed box

Parameters
otherThe other BoundingBox
bool AltusUnified::BoundingBox::contains ( vec2d  point)

Does this BoundingBox contain a point?

Parameters
pointA vec2d describing the point to test
bool AltusUnified::BoundingBox::contains ( BoundingBox  bounds)

Does this BoundingBox contain the passed BoundingBox?

Parameters
boundsA BoundingBox to test
bool AltusUnified::BoundingBox::crossesMeridian ( )

Does this BoundingBox cross the prime meridian?

double AltusUnified::BoundingBox::distanceToPoint ( vec2d  point)

Gets the nearest distance between this box and a point.

Parameters
pointThe point as a vec2d
VectorBoundingBox AltusUnified::BoundingBox::divide ( int  xSides,
int  ySides 
)

Generate a grid of BoundingBoxes by dividing this BoundingBox into xSides columns and ySides rows.

Parameters
xSidesThe number of columns in the rsulting grid of BoundingBoxes
ySidesThe number of rows in the rsulting grid of BoundingBoxes
BoundingBox AltusUnified::BoundingBox::intersect ( BoundingBox  otherBox)

Gets a BoundingBox representing the intersection of this box and the passed box

Parameters
otherBoxThe other BoundingBox
bool AltusUnified::BoundingBox::intersects ( BoundingBox  box)

Does the passed BoundingBox intersect this one?

Parameters
boxA BoundingBox to test for intersection with this box
bool AltusUnified::BoundingBox::isValid ( )

Is this bounding box valid? minX < = maxX minY < = maxY minX >= -180.0 maxX < = 180.0 minY >= -90.0 maxY < = 90.0

vec2d AltusUnified::BoundingBox::max ( )

The maximum of this BoundingBox.

void AltusUnified::BoundingBox::max_set ( vec2d  val)
vec2d AltusUnified::BoundingBox::min ( )

The minimum of this BoundingBox.

void AltusUnified::BoundingBox::min_set ( vec2d  val)
BoundingBox AltusUnified::BoundingBox::relativeBounds ( BoundingBox  other)

Gets the normalized bounds of the passed box in relation to this box. Calling this.RelativeBounds(this) will return a BoundingBox with min = (0,0), max = (1,1).

Parameters
otherThe other BoundingBox
vec2d AltusUnified::BoundingBox::size ( )

Gets the size of this BoundingBox (max - min)

GeoBoundingBox AltusUnified::BoundingBox::toGeoBoundingBox ( )

Constructs and returns a GeoBoundingBox with the bounds of this BoundingBox

string AltusUnified::BoundingBox::toString ( )

Gets a string describing this BoundingBox.