Class MQuad
Double precision polygon with 4 explicit vertices. This is useful to represent a MRect that has been rotated.
Implements
Inherited Members
Namespace: Mapsui
Assembly: Mapsui.dll
Syntax
public class MQuad : IEquatable<MQuad>
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
| Edit this page View SourceMQuad()
Declaration
public MQuad()
MQuad(MPoint, MPoint, MPoint, MPoint)
Declaration
public MQuad(MPoint bottomLeft, MPoint topLeft, MPoint topRight, MPoint bottomRight)
Parameters
| Type | Name | Description |
|---|---|---|
| MPoint | bottomLeft | |
| MPoint | topLeft | |
| MPoint | topRight | |
| MPoint | bottomRight |
MQuad(MQuad)
Declaration
public MQuad(MQuad quad)
Parameters
| Type | Name | Description |
|---|---|---|
| MQuad | quad |
Properties
| Edit this page View SourceBottomLeft
Declaration
public MPoint BottomLeft { get; set; }
Property Value
| Type | Description |
|---|---|
| MPoint |
BottomRight
Declaration
public MPoint BottomRight { get; set; }
Property Value
| Type | Description |
|---|---|
| MPoint |
TopLeft
Declaration
public MPoint TopLeft { get; set; }
Property Value
| Type | Description |
|---|---|
| MPoint |
TopRight
Declaration
public MPoint TopRight { get; set; }
Property Value
| Type | Description |
|---|---|
| MPoint |
Vertices
Returns the vertices in clockwise order from bottom left around to bottom right
Declaration
public IEnumerable<MPoint> Vertices { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<MPoint> |
Methods
| Edit this page View SourceEquals(MQuad?)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(MQuad? other)
Parameters
| Type | Name | Description |
|---|---|---|
| MQuad | other | Other object to compare |
Returns
| Type | Description |
|---|---|
| bool | 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 |
|---|---|---|
| object | obj | Other object to compare |
Returns
| Type | Description |
|---|---|
| bool | Returns true if they are equal |
Overrides
| Edit this page View SourceGetHashCode()
Returns a hash code for the specified object
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the specified object |
Overrides
| Edit this page View SourceRotate(double, double, double)
Creates a new quad by rotate all 4 vertices clockwise about the specified center point
Declaration
public MQuad Rotate(double degrees, double centerX, double centerY)
Parameters
| Type | Name | Description |
|---|---|---|
| double | degrees | Angle to rotate clockwise (degrees) |
| double | centerX | X coordinate of point about which to rotate |
| double | centerY | Y coordinate of point about which to rotate |
Returns
| Type | Description |
|---|---|
| MQuad | Returns the rotate quad |
ToBoundingBox()
Calculates a new bounding box that encompasses all 4 vertices.
Declaration
public MRect ToBoundingBox()
Returns
| Type | Description |
|---|---|
| MRect | 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 |
|---|---|
| string | Returns the string |