Class BoundingRectangle
Represents an axis aligned bounding rectangle.
Inheritance
Inherited Members
Namespace: netDxf
Assembly: CADability.dll
Syntax
public class BoundingRectangle
Constructors
| Improve this Doc View SourceBoundingRectangle(Vector2, Vector2)
Initializes a new axis aligned bounding rectangle.
Declaration
public BoundingRectangle(Vector2 min, Vector2 max)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | min | Lower-left corner. |
| Vector2 | max | Upper-right corner. |
BoundingRectangle(Vector2, Double)
Initializes a new axis aligned bounding rectangle from a circle.
Declaration
public BoundingRectangle(Vector2 center, double radius)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | center | Center of the bounding rectangle. |
| System.Double | radius | Radius of the circle. |
BoundingRectangle(Vector2, Double, Double)
Initializes a new axis aligned bounding rectangle.
Declaration
public BoundingRectangle(Vector2 center, double width, double height)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | center | Center of the bounding rectangle. |
| System.Double | width | Width of the bounding rectangle. |
| System.Double | height | Height of the bounding rectangle. |
BoundingRectangle(Vector2, Double, Double, Double)
Initializes a new axis aligned bounding rectangle from a rotated ellipse.
Declaration
public BoundingRectangle(Vector2 center, double majorAxis, double minorAxis, double rotation)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | center | Center of the ellipse. |
| System.Double | majorAxis | Major axis of the ellipse. |
| System.Double | minorAxis | Minor axis of the ellipse. |
| System.Double | rotation | Rotation in degrees of the ellipse. |
BoundingRectangle(IEnumerable<Vector2>)
Initializes a new axis aligned bounding rectangle.
Declaration
public BoundingRectangle(IEnumerable<Vector2> points)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<Vector2> | points | A list of Vector2. |
Properties
| Improve this Doc View SourceCenter
Gets the bounding rectangle center.
Declaration
public Vector2 Center { get; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
Height
Gets the bounding rectangle height.
Declaration
public double Height { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Max
Gets or sets the bounding rectangle upper-right corner.
Declaration
public Vector2 Max { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
Min
Gets or sets the bounding rectangle lower-left corner.
Declaration
public Vector2 Min { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
Radius
Gets the radius of the circle that contains the bounding rectangle.
Declaration
public double Radius { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Width
Gets the bounding rectangle width.
Declaration
public double Width { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Methods
| Improve this Doc View SourcePointInside(Vector2)
Checks if a point is inside the bounding rectangle.
Declaration
public bool PointInside(Vector2 point)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | point | Vector2 to check. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the point is inside the bounding rectangle, false otherwise. |
Union(BoundingRectangle, BoundingRectangle)
Obtains the union between two bounding rectangles.
Declaration
public static BoundingRectangle Union(BoundingRectangle aabr1, BoundingRectangle aabr2)
Parameters
| Type | Name | Description |
|---|---|---|
| BoundingRectangle | aabr1 | A bounding rectangle. |
| BoundingRectangle | aabr2 | A bounding rectangle. |
Returns
| Type | Description |
|---|---|
| BoundingRectangle | The resulting bounding rectangle. |
Union(IEnumerable<BoundingRectangle>)
Obtains the union of a bounding rectangles list .
Declaration
public static BoundingRectangle Union(IEnumerable<BoundingRectangle> rectangles)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<BoundingRectangle> | rectangles | A list of bounding rectangles. |
Returns
| Type | Description |
|---|---|
| BoundingRectangle | The resulting bounding rectangle. |