IRectangleGeometryAccess
Extends IFreezable.
Interface for accessing the "Rectangle" geometry.
Constructor | Fields | Events | Methods
Constructor
IRectangleGeometryAccess()
Fields
Name |
Type |
Description |
Event manager for the object. Inherited from IFreezable. |
Events
Name |
Description |
Change to corner coordinates. Instance of the Event class. Names of fields that are available via the Event.get method:
|
Methods
Name |
Returns |
Description |
Boolean |
Checks whether the passed point is located inside the rectangle. |
|
freeze() |
Switches the object to "frozen" mode. Inherited from IFreezable. |
|
Object |
Searches for the point nearest to "anchorPosition" on the rectangle contour. |
|
Number[][] |
Returns coordinates of two opposite corners of the rectangle. |
|
isFrozen() |
Boolean |
Returns true if the object is in "frozen" mode, otherwise false. Inherited from IFreezable. |
Sets the coordinates of two opposite corners of the rectangle. |
||
unfreeze() |
Switches the object to active mode. Inherited from IFreezable. |
Events details
change
Change to corner coordinates. Instance of the Event class. Names of fields that are available via the Event.get method:
- oldCoordinates - Old coordinates of the corners.
- newCoordinates - New coordinates of the corners.
Methods details
contains
{Boolean} contains(position)
Checks whether the passed point is located inside the rectangle.
Returns indicator for whether the point belongs to the rectangle.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Number[] Coordinates of a point. |
* Mandatory parameter/option.
getClosest
{Object} getClosest(anchorPosition)
Searches for the point nearest to "anchorPosition" on the rectangle contour.
Returns an object with the following fields:
- position - The point on the rectangle contour that is nearest to "anchorPosition".
- distance - Distance from "anchorPosition" to "position".
Parameters:
Parameter |
Default value |
Description |
— |
Type: Number[] Coordinates of a point for which the nearest rectangle vertex is calculated. |
* Mandatory parameter/option.
getCoordinates
{Number[][]} getCoordinates()
Returns coordinates of two opposite corners of the rectangle.
setCoordinates
{IRectangleGeometryAccess} setCoordinates(coordinates)
Sets the coordinates of two opposite corners of the rectangle.
Returns self-reference.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Number[][] Coordinates of corners. |
* Mandatory parameter/option.
Mandatory parameter/option.