dwv.math. Rectangle

new Rectangle(begin, end)

Rectangle shape.

Parameters:
NameTypeDescription
begindwv.math.Point2D

A Point2D representing the beginning of the rectangle.

enddwv.math.Point2D

A Point2D representing the end of the rectangle.

Methods

equals(rhs) → {boolean}

Check for equality.

Parameters:
NameTypeDescription
rhsdwv.math.Rectangle

The object to compare to.

Returns:

True if both objects are equal.

Type: 
boolean

getBegin() → {dwv.math.Point2D}

Get the begin point of the rectangle.

Returns:

The begin point of the rectangle

Type: 
dwv.math.Point2D

getEnd() → {dwv.math.Point2D}

Get the end point of the rectangle.

Returns:

The end point of the rectangle

Type: 
dwv.math.Point2D

getHeight() → {number}

Get the height of the rectangle.

Returns:

The height of the rectangle.

Type: 
number

getRealHeight() → {number}

Get the real height of the rectangle.

Returns:

The real height of the rectangle.

Type: 
number

getRealWidth() → {number}

Get the real width of the rectangle.

Returns:

The real width of the rectangle.

Type: 
number

getRound() → {object}

Get the rounded limits of the rectangle.

Returns:

The rounded limits.

Type: 
object

getSurface() → {number}

Get the surface of the rectangle.

Returns:

The surface of the rectangle.

Type: 
number

getWidth() → {number}

Get the width of the rectangle.

Returns:

The width of the rectangle.

Type: 
number

getWorldSurface(spacingX, spacingY) → {number}

Get the surface of the rectangle according to a spacing.

Parameters:
NameTypeDescription
spacingXnumber

The X spacing.

spacingYnumber

The Y spacing.

Returns:

The surface of the rectangle multiplied by the given spacing or null for null spacings.

Type: 
number

quantify(viewController, flags) → {object}

Quantify a rectangle according to view information.

Parameters:
NameTypeDescription
viewControllerobject

The associated view controller.

flagsArray

A list of stat values to calculate.

Returns:

A quantification object.

Type: 
object