Class Rectangle2d
Represents a 2D bounding box.
Inheritance
Namespace: Paramdigma.Core.Geometry
Assembly: Paramdigma.Core.dll
Syntax
public class Rectangle2d : object
Constructors
| Improve this Doc View SourceRectangle2d(Point2d, Point2d)
Initializes a new instance of the Rectangle2d class from 2 points. Coordinates will automatically be corrected if the corners are not consistent with naming (i.e. bottomLeftCorner is actually topLeft..)
Declaration
public Rectangle2d(Point2d bottomLeftCorner, Point2d topRightCorner)
Parameters
Type | Name | Description |
---|---|---|
Point2d | bottomLeftCorner | Bottom left corner. |
Point2d | topRightCorner | Top right corner. |
Rectangle2d(Polyline2d)
Initializes a new instance of the Rectangle2d class from a polyline.
Declaration
public Rectangle2d(Polyline2d polyline)
Parameters
Type | Name | Description |
---|---|---|
Polyline2d | polyline | Polyline. |
Properties
| Improve this Doc View SourceBottomLeft
Gets the Bottom left corner of the BBox.
Declaration
public Point2d BottomLeft { get; }
Property Value
Type | Description |
---|---|
Point2d |
BottomRight
Gets the Bottom right corner of the BBox.
Declaration
public Point2d BottomRight { get; }
Property Value
Type | Description |
---|---|
Point2d |
Center
Gets the center of the bounding BBox.
Declaration
public Point2d Center { get; }
Property Value
Type | Description |
---|---|
Point2d |
MidBottom
Gets the midpoint at the bottom edge of the box.
Declaration
public Point2d MidBottom { get; }
Property Value
Type | Description |
---|---|
Point2d |
MidLeft
Gets the midpoint at the left edge of the box.
Declaration
public Point2d MidLeft { get; }
Property Value
Type | Description |
---|---|
Point2d |
MidRight
Gets the midpoint at the right edge of the box.
Declaration
public Point2d MidRight { get; }
Property Value
Type | Description |
---|---|
Point2d |
MidTop
Gets the midpoint at the top edge of the box.
Declaration
public Point2d MidTop { get; }
Property Value
Type | Description |
---|---|
Point2d |
TopLeft
Gets the top left corner of the BBox.
Declaration
public Point2d TopLeft { get; }
Property Value
Type | Description |
---|---|
Point2d |
TopRight
Gets the top right corner of the BBox.
Declaration
public Point2d TopRight { get; }
Property Value
Type | Description |
---|---|
Point2d |
XDomain
Gets or sets the Domain in the X direction.
Declaration
public Interval XDomain { get; set; }
Property Value
Type | Description |
---|---|
Interval |
YDomain
Gets or sets the Domain in the Y direction.
Declaration
public Interval YDomain { get; set; }
Property Value
Type | Description |
---|---|
Interval |
Methods
| Improve this Doc View SourceContainsPoint(Point2d)
Checks if a point is contained inside the box.
Declaration
public bool ContainsPoint(Point2d pt)
Parameters
Type | Name | Description |
---|---|---|
Point2d | pt | Point to test containment. |
Returns
Type | Description |
---|---|
System.Boolean | True if point is contained inside the bounding box. |
IntersectsBox(Rectangle2d)
Checks if a box intersects with this instance.
Declaration
public bool IntersectsBox(Rectangle2d box)
Parameters
Type | Name | Description |
---|---|---|
Rectangle2d | box | Box to check intersection against. |
Returns
Type | Description |
---|---|
System.Boolean | True if intersection exists. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |