A mutable oriented rectangle in 2D coordinate space with double precision values stored in an instance of IMutablePoint and IMutableSize as well as two doubles for the up vector components.
Remarks
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.geometry.OrientedRectangle
See Also
Constructors
Creates a new instance using the provided rectangle to initialize the anchor and size.
Remarks
(0, -1)
.Parameters
A map of options to pass to the method.
- rectangle - IRectangle
- The rectangle to initialize the anchor and size from.
Creates a new instance using the provided values to initialize.
Remarks
Parameters
A map of options to pass to the method.
- rectangle - IOrientedRectangle
- The rectangle to initialize the anchor and size and up vector from.
Creates a new instance using the provided values to initialize the anchor and size.
Remarks
(0, -1)
. The instances provided will be referenced by this instance. This instance will be used as a live view over the provided instances. Changes to them will indirectly change the state of this instance and changes applied through this instance will be written to the referenced implementations.Parameters
A map of options to pass to the method.
- anchor - IMutablePoint
- The provider for the dynamic anchor of this instance.
- size - IMutableSize
- The provider for the dynamic size of this instance.
Initializes a new instance of the OrientedRectangle class located at 0.0d,0.0d
with empty width and height (-1.0d
).
OrientedRectangle
(anchorX: number, anchorY: number, width: number, height: number, upX?: number, upY?: number)Creates a new instance using the provided values to initialize the anchor and size.
Remarks
Parameters
A map of options to pass to the method.
- anchorX - number
- The x coordinate of the anchor of the oriented rectangle.
- anchorY - number
- The y coordinate of the anchor of the oriented rectangle.
- width - number
- The width of the rectangle.
- height - number
- The height of the rectangle.
- upX - number
- The x component of the up vector.
- upY - number
- The y component of the up vector.
Properties
Gets or sets the anchor of this oriented rectangle.
Remarks
Gets the anchor location of the oriented rectangle as a Point struct.
Overrides
Gets or sets the x coordinate of the anchor of this instance from the anchor instance.
Remarks
Implements
Gets or sets the y coordinate of the anchor of this instance from the anchor instance.
Remarks
Implements
Gets or sets the orientation of this rectangle.
Remarks
The angle is specified in radians. An angle of 0
means the up vector points up in direction (0,-1)
. The angle value is not stored and will be recalculated from upX and upY every time this is invoked, so this is a costly method. Setting the angle changes the upX and upY values accordingly.
The angle is between 0 an PI if the up vector points to quadrant 2 or 3 and between -PI and 0 if the up vector points to quadrant 1 or 4.
Determines the bounds of an oriented rectangle.
Gets or sets the height of this instance from the size instance.
Remarks
See Also
Implements
Gets the current center of the oriented rectangle as a Point struct.
Gets or sets the size of this rectangle.
Remarks
Gets the up vector of the oriented rectangle as a Point struct.
Overrides
Gets or sets the x component of the up vector to the new value.
Remarks
See Also
Implements
Gets or sets the y component of the up vector to the new value.
Remarks
See Also
Implements
Gets or sets the width of this instance from the size instance.
Remarks
See Also
Implements
Gets or sets the x coordinate of the anchor of this instance from the anchor instance.
Gets or sets the y coordinate of the anchor of this instance from the anchor instance.
Methods
Create a clone of this object.
Determines whether the given oriented rectangle contains the provided point, using an epsilon value.
Parameters
A map of options to pass to the method.
- point - Point
- The coordinates of the point to test.
- eps - number
- A positive value allows for fuzzy hit testing. If the point lies outside the given object but it's distance is less than or equal to that value, it will be considered a hit.
Returns
- ↪boolean
true
iff the point lies inside the rectangle.
Overrides
Creates a transformation matrix that can be used to transform points that are in the local coordinate system of the oriented rectangle if the top-left corner is the origin.
Returns
- ↪Matrix
- A matrix that can be used to transform from oriented rectangle coordinates to world coordinates.
Overrides
Calculates the Euclidean distance between two points.
Parameters
A map of options to pass to the method.
- point2 - IPoint
- The second point.
Returns
- ↪number
- The distance between the two points.
Overrides
Implements the equals method by comparing the given object's values.
Remarks
Parameters
A map of options to pass to the method.
- other - Object
- The other instance to compare the values against.
Returns
- ↪boolean
- Whether the other instance is of this type or the immutable types created by this class and whether their values are the same as for this type.
Creates an enlarged instance that is the same as this one but enlarged by the specified padding.
Parameters
A map of options to pass to the method.
- padding - Insets
- The padding to use to add to the instance.
Returns
- ↪OrientedRectangle
- A new OrientedRectangle instance which is enlarged by the given
padding
.
Overrides
Determines whether the oriented rectangle contains the provided point, using an epsilon value.
Parameters
A map of options to pass to the method.
- location - Point
- The coordinates of the point to test.
- eps - number
- A positive value allows for fuzzy hit testing. If the point lies outside the given object but it's distance is less than or equal to that value, it will be considered a hit.
Returns
- ↪boolean
true
iff the point lies inside the rectangle.
Overrides
Sets the coordinates of the point to the given values.
Parameters
A map of options to pass to the method.
- x - number
- The new x coordinate
- y - number
- The new y coordinate
Defined in
Sets the coordinates of the point to the given values.
Parameters
A map of options to pass to the method.
- location - IPoint
- The new location.
Defined in
Applies the values provided by the given instance to the values of this instance.
Parameters
A map of options to pass to the method.
- rectangle - IOrientedRectangle
- The instance to retrieve the values from.
Sets the coordinates of the size to the given values.
Parameters
A map of options to pass to the method.
- newWidth - number
- The new x coordinate
- newHeight - number
- The new y coordinate
Overrides
Sets the coordinates of the size to the given values.
Parameters
A map of options to pass to the method.
- newSize - ISize
- The new location.
Overrides
Sets the anchor vector of the oriented rectangle to the given value.
Parameters
A map of options to pass to the method.
- location - Point
- The coordinates of the new anchor location.
Defined in
Sets the center of the oriented rectangle to the given value.
Parameters
A map of options to pass to the method.
- center - Point
- The coordinates of the new center.
Defined in
Sets the components of the up vector to the new values.
Remarks
Parameters
A map of options to pass to the method.
- upx - number
- The x component of the normalized up vector.
- upy - number
- The y component of the normalized up vector.
See Also
Implements
Creates a YOrientedRectangle from a given IOrientedRectangle.
Returns
Class.ensure(LayoutExecutor)
More information.Overrides
Static Methods
A casting operator that creates a new instance of OrientedRectangle using the current state of the rectangle that is cast.
Remarks
(0, -1)
. Unlike true casting this will create a new instance that will be initialized to the current state of the object being cast, but which will not stay in sync with the state of the object.Parameters
A map of options to pass to the method.
- rect - MutableRectangle
- the rectangle to get the current state from
Returns
- ↪OrientedRectangle
- A new instance of OrientedRectangle that holds no reference to the provided rectangle.
createImmutable
(anchorX: number, anchorY: number, width: number, height: number, upX: number, upY: number) : IOrientedRectangleCreates an immutable IOrientedRectangle with the given values.