Class Quad
Double precision polygon with 4 explicit vertices. This is useful to represent a BoundingBox that has been rotated.
Inheritance
Implements
Inherited Members
Namespace: Mapsui.Geometries
Assembly: Mapsui.Geometries.dll
Syntax
public class Quad : IEquatable<Quad>
Remarks
The sides do not have to be parallel to the two axes of the coordinate system. If this has been rotated, the 'BottomLeft' vertex may not actually be the min point in x/y.
Constructors
| Improve this Doc View SourceQuad()
Declaration
public Quad()
Quad(Point, Point, Point, Point)
Declaration
public Quad(Point bottomLeft, Point topLeft, Point topRight, Point bottomRight)
Parameters
Type | Name | Description |
---|---|---|
Point | bottomLeft | |
Point | topLeft | |
Point | topRight | |
Point | bottomRight |
Quad(Quad)
Declaration
public Quad(Quad quad)
Parameters
Type | Name | Description |
---|---|---|
Quad | quad |
Properties
| Improve this Doc View SourceBottomLeft
Declaration
public Point BottomLeft { get; set; }
Property Value
Type | Description |
---|---|
Point |
BottomRight
Declaration
public Point BottomRight { get; set; }
Property Value
Type | Description |
---|---|
Point |
TopLeft
Declaration
public Point TopLeft { get; set; }
Property Value
Type | Description |
---|---|
Point |
TopRight
Declaration
public Point TopRight { get; set; }
Property Value
Type | Description |
---|---|
Point |
Vertices
Returns the vertices in clockwise order from bottom left around to bottom right
Declaration
public IEnumerable<Point> Vertices { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Point> |
Methods
| Improve this Doc View SourceEquals(Quad)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(Quad other)
Parameters
Type | Name | Description |
---|---|---|
Quad | other | Other object to compare |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if they are equal |
Equals(Object)
Indicates whether the current object is equal to another object of the same type.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Other object to compare |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if they are equal |
Overrides
GetHashCode()
Returns a hash code for the specified object
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the specified object |
Overrides
Rotate(Double, Double, Double)
Creates a new quad by rotate all 4 vertices clockwise about the specified center point
Declaration
public Quad Rotate(double degrees, double centerX, double centerY)
Parameters
Type | Name | Description |
---|---|---|
System.Double | degrees | Angle to rotate clockwise (degrees) |
System.Double | centerX | X coordinate of point about which to rotate |
System.Double | centerY | Y coordinate of point about which to rotate |
Returns
Type | Description |
---|---|
Quad | Returns the rotate quad |
ToBoundingBox()
Calculates a new bounding box that encompasses all 4 vertices.
Declaration
public BoundingBox ToBoundingBox()
Returns
Type | Description |
---|---|
BoundingBox | Returns the calculate bounding box |
ToString()
Returns a string representation of the vertices from bottom-left clockwise to bottom-right
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | Returns the string |