Interface for oriented rectangles in 2D coordinate space with double precision coordinates.
Remarks
(0,-1)
. This interface provides read access to the features of the oriented rectangle only, however this does not mean that an instance that implements IOrientedRectangle
will always return the same values for its properties. Often times the instance provides a dynamic read access to the current state of a rectangle. It depends on the context whether it is allowed to or even necessary to copy the state of the properties or whether the reference to the instance should always be used to query the values.Type Details
- yFiles module
- core
See Also
Properties
Determines the bounds of an oriented rectangle.
Remarks
Gets the current height of this instance.
Gets the current width of this instance.
Methods
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 - IPoint
- 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 its 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.
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
.
Determines an intersection point of the given oriented rectangle and the line segment specified by the given endpoints.
Remarks
null
if there is no intersection.Parameters
A map of options to pass to the method.
- lineP1 - Point
- The first endpoint of the line segment.
- lineP2 - Point
- The second endpoint of the line segment.
- eps - number
- A positive value allows for fuzzy hit testing. The rectangle will be enlarged by the given value (or reduced in size by a negative value), so that an intersection point that otherwise would not be found may be returned.
Returns
- ↪Point?
- An intersection point of the given oriented rectangle and the specified line segment or
null
if the rectangle and the segment do not intersect.
Determines whether an OrientedRectangle intersects another one.
Parameters
A map of options to pass to the method.
- rect2 - IOrientedRectangle
- The second oriented rectangle to test.
- eps - number
- A positive value allows for fuzzy hit testing. If the point lies outside the given object but its distance is less than or equal to that value, it will be considered a hit.
Returns
- ↪boolean
true
if the rectangles intersect andfalse
otherwise.
Determines whether the given oriented rectangle and the line segment defined by the two given points intersect.
Parameters
A map of options to pass to the method.
- lineP1 - Point
- The first point defining the line segment.
- lineP2 - Point
- The second point defining the line segment.
- eps - number
- A positive value allows for fuzzy hit testing. If the point lies outside the given object but its distance is less than or equal to that value, it will be considered a hit.
Returns
- ↪boolean
true
if the rectangle and the line segment intersect andfalse
otherwise.
Creates an OrientedRectangle from a given IOrientedRectangle.
Returns
Constants
An immutable empty IOrientedRectangle with width and height of -1
.