Show / Hide Table of Contents

    Class BoundingBox

    Bounding box type with double precision

    Inheritance
    System.Object
    BoundingBox
    Implements
    System.IEquatable<BoundingBox>
    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Mapsui.Geometries
    Assembly: Mapsui.Geometries.dll
    Syntax
    public class BoundingBox : IEquatable<BoundingBox>
    Remarks

    The Bounding Box represents a box whose sides are parallel to the two axes of the coordinate system.

    Constructors

    | Improve this Doc View Source

    BoundingBox()

    Declaration
    public BoundingBox()
    | Improve this Doc View Source

    BoundingBox(BoundingBox)

    Declaration
    public BoundingBox(BoundingBox boundingBox)
    Parameters
    Type Name Description
    BoundingBox boundingBox
    | Improve this Doc View Source

    BoundingBox(Point, Point)

    Initializes a bounding box

    Declaration
    public BoundingBox(Point minPoint, Point maxPoint)
    Parameters
    Type Name Description
    Point minPoint

    Lower left corner

    Point maxPoint

    Upper right corner

    | Improve this Doc View Source

    BoundingBox(IEnumerable<BoundingBox>)

    Initializes a new Bounding Box based on the bounds from a set of bounding boxes

    Declaration
    public BoundingBox(IEnumerable<BoundingBox> boundingBoxes)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<BoundingBox> boundingBoxes
    | Improve this Doc View Source

    BoundingBox(IEnumerable<Geometry>)

    Initializes a new Bounding Box based on the bounds from a set of geometries

    Declaration
    public BoundingBox(IEnumerable<Geometry> objects)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Geometry> objects

    list of objects

    | Improve this Doc View Source

    BoundingBox(Double, Double, Double, Double)

    Initializes a bounding box

    Declaration
    public BoundingBox(double minX, double minY, double maxX, double maxY)
    Parameters
    Type Name Description
    System.Double minX

    left

    System.Double minY

    bottom

    System.Double maxX

    right

    System.Double maxY

    top

    Remarks

    In case min values are larger than max values, the parameters will be swapped to ensure correct min/max boundary

    Properties

    | Improve this Doc View Source

    Bottom

    Gets the bottom boundary

    Declaration
    public double Bottom { get; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    BottomLeft

    Declaration
    public Point BottomLeft { get; }
    Property Value
    Type Description
    Point
    | Improve this Doc View Source

    BottomRight

    Declaration
    public Point BottomRight { get; }
    Property Value
    Type Description
    Point
    | Improve this Doc View Source

    Centroid

    Returns the center of the bounding box

    Declaration
    public Point Centroid { get; }
    Property Value
    Type Description
    Point
    | Improve this Doc View Source

    Height

    Returns the height of the bounding box

    Declaration
    public double Height { get; }
    Property Value
    Type Description
    System.Double

    Height of boundingbox

    | Improve this Doc View Source

    Left

    Gets the left boundary

    Declaration
    public double Left { get; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    LongestAxis

    Intersection scalar (used for weighting in building the tree)

    Declaration
    public uint LongestAxis { get; }
    Property Value
    Type Description
    System.UInt32
    | Improve this Doc View Source

    Max

    Gets or sets the upper right corner.

    Declaration
    public Point Max { get; set; }
    Property Value
    Type Description
    Point
    | Improve this Doc View Source

    MaxX

    Declaration
    public double MaxX { get; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    MaxY

    Declaration
    public double MaxY { get; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    Min

    Gets or sets the lower left corner.

    Declaration
    public Point Min { get; set; }
    Property Value
    Type Description
    Point
    | Improve this Doc View Source

    MinX

    Declaration
    public double MinX { get; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    MinY

    Declaration
    public double MinY { get; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    Right

    Gets the right boundary

    Declaration
    public double Right { get; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    Top

    Gets the top boundary

    Declaration
    public double Top { get; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    TopLeft

    Declaration
    public Point TopLeft { get; }
    Property Value
    Type Description
    Point
    | Improve this Doc View Source

    TopRight

    Declaration
    public Point TopRight { get; }
    Property Value
    Type Description
    Point
    | Improve this Doc View Source

    Width

    Returns the width of the bounding box

    Declaration
    public double Width { get; }
    Property Value
    Type Description
    System.Double

    Width of boundingbox

    Methods

    | Improve this Doc View Source

    CheckMinMax()

    Checks whether min values are actually smaller than max values and in that case swaps them.

    Declaration
    public bool CheckMinMax()
    Returns
    Type Description
    System.Boolean

    true if the bounding was changed

    | Improve this Doc View Source

    Clone()

    Creates a copy of the BoundingBox

    Declaration
    public BoundingBox Clone()
    Returns
    Type Description
    BoundingBox
    | Improve this Doc View Source

    Contains(BoundingBox)

    Returns true if this instance contains the BoundingBox

    Declaration
    public bool Contains(BoundingBox r)
    Parameters
    Type Name Description
    BoundingBox r BoundingBox
    Returns
    Type Description
    System.Boolean

    True it contains

    | Improve this Doc View Source

    Contains(Point)

    Checks whether a point lies within the bounding box

    Declaration
    public bool Contains(Point p)
    Parameters
    Type Name Description
    Point p

    Point

    Returns
    Type Description
    System.Boolean

    true if point is within

    | Improve this Doc View Source

    Distance(BoundingBox)

    Computes the minimum distance between this and another BoundingBox. The distance between overlapping bounding boxes is 0. Otherwise, the distance is the Euclidean distance between the closest points.

    Declaration
    public virtual double Distance(BoundingBox box)
    Parameters
    Type Name Description
    BoundingBox box

    Box to calculate distance to

    Returns
    Type Description
    System.Double

    The distance between this and another BoundingBox.

    | Improve this Doc View Source

    Distance(Point)

    Computes the minimum distance between this BoundingBox and a Point

    Declaration
    public virtual double Distance(Point p)
    Parameters
    Type Name Description
    Point p

    Point to calculate distance to.

    Returns
    Type Description
    System.Double

    Minimum distance.

    | Improve this Doc View Source

    Equals(BoundingBox)

    Checks whether the values of this instance is equal to the values of another instance.

    Declaration
    public bool Equals(BoundingBox other)
    Parameters
    Type Name Description
    BoundingBox other

    BoundingBox to compare to.

    Returns
    Type Description
    System.Boolean

    True if equal

    | Improve this Doc View Source

    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
    Returns
    Type Description
    System.Boolean
    Overrides
    System.Object.Equals(System.Object)
    | Improve this Doc View Source

    GetArea()

    Returns the area of the BoundingBox

    Declaration
    public double GetArea()
    Returns
    Type Description
    System.Double

    Area of box

    | Improve this Doc View Source

    GetCentroid()

    Declaration
    [Obsolete("Use the Centroid field instead")]
    public Point GetCentroid()
    Returns
    Type Description
    Point
    | Improve this Doc View Source

    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
    System.Object.GetHashCode()
    | Improve this Doc View Source

    GetIntersectingArea(BoundingBox)

    Gets the intersecting area between two boundingboxes

    Declaration
    public double GetIntersectingArea(BoundingBox r)
    Parameters
    Type Name Description
    BoundingBox r

    BoundingBox

    Returns
    Type Description
    System.Double

    Area

    | Improve this Doc View Source

    Grow(Double)

    Increases the size of the boundingbox by the givent amount in all directions

    Declaration
    public BoundingBox Grow(double amount)
    Parameters
    Type Name Description
    System.Double amount

    Amount to grow in all directions

    Returns
    Type Description
    BoundingBox
    | Improve this Doc View Source

    Grow(Double, Double)

    Increases the size of the boundingbox by the givent amount in horizontal and vertical directions

    Declaration
    public BoundingBox Grow(double amountInX, double amountInY)
    Parameters
    Type Name Description
    System.Double amountInX

    Amount to grow in horizontal direction

    System.Double amountInY

    Amount to grow in vertical direction

    Returns
    Type Description
    BoundingBox
    | Improve this Doc View Source

    Intersects(BoundingBox)

    Determines whether the boundingbox intersects another boundingbox

    Declaration
    public bool Intersects(BoundingBox box)
    Parameters
    Type Name Description
    BoundingBox box
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Join(BoundingBox)

    Computes the joined boundingbox of this instance and another boundingbox

    Declaration
    public BoundingBox Join(BoundingBox box)
    Parameters
    Type Name Description
    BoundingBox box

    Boundingbox to join with

    Returns
    Type Description
    BoundingBox

    Boundingbox containing both boundingboxes

    | Improve this Doc View Source

    Join(BoundingBox, BoundingBox)

    Computes the joined boundingbox of two boundingboxes

    Declaration
    public static BoundingBox Join(BoundingBox box1, BoundingBox box2)
    Parameters
    Type Name Description
    BoundingBox box1
    BoundingBox box2
    Returns
    Type Description
    BoundingBox
    | Improve this Doc View Source

    Join(BoundingBox[])

    Computes the joined BoundingBox of an array of boundingboxes.

    Declaration
    public static BoundingBox Join(BoundingBox[] boxes)
    Parameters
    Type Name Description
    BoundingBox[] boxes

    Boxes to join

    Returns
    Type Description
    BoundingBox

    Combined BoundingBox

    | Improve this Doc View Source

    Offset(Point)

    Moves/translates the BoundingBox along the the specified vector

    Declaration
    public void Offset(Point vector)
    Parameters
    Type Name Description
    Point vector

    Offset vector

    | Improve this Doc View Source

    Offset(Double, Double)

    Declaration
    public void Offset(double x, double y)
    Parameters
    Type Name Description
    System.Double x
    System.Double y
    | Improve this Doc View Source

    Rotate(Double)

    Calculates a new quad by rotating this bounding box about its center by the specified angle clockwise

    Declaration
    public Quad Rotate(double degrees)
    Parameters
    Type Name Description
    System.Double degrees

    Angle about which to rotate (degrees)

    Returns
    Type Description
    Quad

    Returns the calculated quad

    | Improve this Doc View Source

    ToString()

    Returns a string representation of the boundingbox as LowerLeft + UpperRight formatted as "MinX,MinY MaxX,MaxY"

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    MinX,MinY MaxX,MaxY

    Overrides
    System.Object.ToString()
    | Improve this Doc View Source

    Touches(BoundingBox)

    Returns true if this instance touches the BoundingBox

    Declaration
    public bool Touches(BoundingBox r)
    Parameters
    Type Name Description
    BoundingBox r BoundingBox
    Returns
    Type Description
    System.Boolean

    True it touches

    | Improve this Doc View Source

    Touches(Point)

    Returns true if this instance touches the Point

    Declaration
    public bool Touches(Point p)
    Parameters
    Type Name Description
    Point p

    Geometry

    Returns
    Type Description
    System.Boolean

    True if touches

    Implements

    System.IEquatable<T>

    Extension Methods

    BoundingBoxExtensions.ToSkia(BoundingBox)
    BoundingBoxExtensions.Copy(BoundingBox)
    BoundingBoxExtensions.IsInitialized(BoundingBox)
    BoundingBoxExtensions.ToExtent(BoundingBox)
    BoundingBoxIterator.AllVertices(BoundingBox)
    BoundingBoxIterator.GetCornerVertices(BoundingBox)
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX