Show / Hide Table of Contents

Struct BoundingRect

BoundingRect is an axis oriented rectangle or a 2-dimensional bounding box. It is implemented as a "struct" (value type) so assignements always make a copy.

Implements
IQuadTreeInsertable
System.IComparable<BoundingRect>
System.Runtime.Serialization.ISerializable
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: CADability
Assembly: CADability.dll
Syntax
[Serializable]
public struct BoundingRect : IQuadTreeInsertable, IComparable<BoundingRect>, ISerializable

Constructors

| Improve this Doc View Source

BoundingRect(BoundingRect)

Copy constructor

Declaration
public BoundingRect(BoundingRect r)
Parameters
Type Name Description
BoundingRect r
| Improve this Doc View Source

BoundingRect(GeoPoint2D, Double, Double)

Creates a new BoundingRect with the provided center, half width and half height

Declaration
public BoundingRect(GeoPoint2D Center, double HalfWidth, double HalfHeight)
Parameters
Type Name Description
GeoPoint2D Center

Center of the BoundingRect

System.Double HalfWidth

Half width

System.Double HalfHeight

Half height

| Improve this Doc View Source

BoundingRect(GeoPoint2D[])

Creates a new BoundingRect which contains the provided points

Declaration
public BoundingRect(params GeoPoint2D[] p)
Parameters
Type Name Description
GeoPoint2D[] p

List of points to define the rectangle

| Improve this Doc View Source

BoundingRect(Double, Double, Double, Double)

Creates a new BoundingRect with the provided limits.

Declaration
public BoundingRect(double Left, double Bottom, double Right, double Top)
Parameters
Type Name Description
System.Double Left

Left limit

System.Double Bottom

Bottom limit

System.Double Right
System.Double Top
| Improve this Doc View Source

BoundingRect(Rectangle)

Creates a new BoundingRect from the provided System.Drawing.rectangle

Declaration
public BoundingRect(Rectangle r)
Parameters
Type Name Description
System.Drawing.Rectangle r

das gegebene Rechteck

Fields

| Improve this Doc View Source

Bottom

Declaration
public double Bottom
Field Value
Type Description
System.Double
| Improve this Doc View Source

EmptyBoundingRect

Returns an empty BoundingRect which is convenient as a start for the MinMax(GeoPoint2D) method.

Declaration
public static BoundingRect EmptyBoundingRect
Field Value
Type Description
BoundingRect
| Improve this Doc View Source

HalfInfinitBoundingRect

Declaration
public static BoundingRect HalfInfinitBoundingRect
Field Value
Type Description
BoundingRect
| Improve this Doc View Source

InfinitBoundingRect

Declaration
public static BoundingRect InfinitBoundingRect
Field Value
Type Description
BoundingRect
| Improve this Doc View Source

Left

Declaration
public double Left
Field Value
Type Description
System.Double
| Improve this Doc View Source

Right

Declaration
public double Right
Field Value
Type Description
System.Double
| Improve this Doc View Source

Top

Declaration
public double Top
Field Value
Type Description
System.Double

Properties

| Improve this Doc View Source

Height

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

The height of the rectangle

| Improve this Doc View Source

IsInfinite

Returns true if the BoundingRect is infinite. I.e. left and bottom equal Double.MinValue and right and top equal Double.MaxValue

Declaration
public bool IsInfinite { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Size

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

UnitBoundingRect

Returns an BoundingRect form 0 to 1 in both directions

Declaration
public static BoundingRect UnitBoundingRect { get; }
Property Value
Type Description
BoundingRect
| Improve this Doc View Source

Width

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

The width of the rectangle

Methods

| Improve this Doc View Source

ContainsLb(GeoPoint2D)

Declaration
public bool ContainsLb(GeoPoint2D p)
Parameters
Type Name Description
GeoPoint2D p
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Disjoint(BoundingRect, BoundingRect)

Returns true if the two rectangles are disjoint (do not overlap)

Declaration
public static bool Disjoint(BoundingRect b1, BoundingRect b2)
Parameters
Type Name Description
BoundingRect b1

First rectangle

BoundingRect b2

Second rectangle

Returns
Type Description
System.Boolean

true if disjoint

| Improve this Doc View Source

GetCenter()

Returns the center of the rectangle

Declaration
public GeoPoint2D GetCenter()
Returns
Type Description
GeoPoint2D
| Improve this Doc View Source

GetLowerLeft()

Returns the lower left point of the rectangle

Declaration
public GeoPoint2D GetLowerLeft()
Returns
Type Description
GeoPoint2D
| Improve this Doc View Source

GetLowerMiddle()

Returns the center of the bottom line of the rectangle

Declaration
public GeoPoint2D GetLowerMiddle()
Returns
Type Description
GeoPoint2D
| Improve this Doc View Source

GetLowerRight()

Returns the lower right point of the rectangle

Declaration
public GeoPoint2D GetLowerRight()
Returns
Type Description
GeoPoint2D
| Improve this Doc View Source

GetMiddleLeft()

Returns the center of the left line of the rectangle

Declaration
public GeoPoint2D GetMiddleLeft()
Returns
Type Description
GeoPoint2D
| Improve this Doc View Source

GetMiddleRight()

Returns the center of the right line of the rectangle

Declaration
public GeoPoint2D GetMiddleRight()
Returns
Type Description
GeoPoint2D
| Improve this Doc View Source

GetObjectData(SerializationInfo, StreamingContext)

Implements System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)

Declaration
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info

The System.Runtime.Serialization.SerializationInfo to populate with data.

System.Runtime.Serialization.StreamingContext context

The destination (System.Runtime.Serialization.StreamingContext) for this serialization.

| Improve this Doc View Source

GetPosition(GeoPoint2D, Double)

Returns the position of the provided point with a given precision

Declaration
public BoundingRect.Position GetPosition(GeoPoint2D p, double frameWidth)
Parameters
Type Name Description
GeoPoint2D p

The point to test

System.Double frameWidth

The precision: if the distance to a bounding line is smaller than this value, the point is considered as onframe

Returns
Type Description
BoundingRect.Position

The position of the point

| Improve this Doc View Source

GetUpperLeft()

Returns the upper left point of the rectangle

Declaration
public GeoPoint2D GetUpperLeft()
Returns
Type Description
GeoPoint2D
| Improve this Doc View Source

GetUpperMiddle()

Returns the center of the upper line of the rectangle

Declaration
public GeoPoint2D GetUpperMiddle()
Returns
Type Description
GeoPoint2D
| Improve this Doc View Source

GetUpperRight()

Returns the upper right point of the rectangle

Declaration
public GeoPoint2D GetUpperRight()
Returns
Type Description
GeoPoint2D
| Improve this Doc View Source

Inflate(Double)

Inflates the rectangle by the provided value which may also be negative (for shrinking)

Declaration
public void Inflate(double d)
Parameters
Type Name Description
System.Double d

Value for infaltion

| Improve this Doc View Source

Inflate(Double, Double)

Inflates the rectangle with different values in width an height

Declaration
public void Inflate(double width, double height)
Parameters
Type Name Description
System.Double width

Inflation of the width

System.Double height

Inflation of the height

| Improve this Doc View Source

InflateRelative(Double)

Inflates the rectangle by a factor relative to its Size.

Declaration
public void InflateRelative(double factor)
Parameters
Type Name Description
System.Double factor
| Improve this Doc View Source

Interferes(ref BoundingRect)

Returns true, when this rectangle and the provided rect overlap

Declaration
public bool Interferes(ref BoundingRect rect)
Parameters
Type Name Description
BoundingRect rect
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsEmpty()

Returns true, if this BoundingRect is empty.

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

true, if empty.

| Improve this Doc View Source

MakeEmpty()

Makes this BoundingRect an empty BoundingRect

Declaration
public void MakeEmpty()
| Improve this Doc View Source

MinMax(BoundingRect)

Adapts the size of this bounding rectangle to include the provided rectangle.

Declaration
public void MinMax(BoundingRect r)
Parameters
Type Name Description
BoundingRect r

Rectangle to be included

| Improve this Doc View Source

MinMax(GeoPoint2D)

Adapts the size of this bounding rectangle to include the provided point.

Declaration
public void MinMax(GeoPoint2D p)
Parameters
Type Name Description
GeoPoint2D p

Point to be included

| Improve this Doc View Source

MinMax(GeoPoint2D[])

Adapts the size of this bounding rectangle to include the provided points.

Declaration
public void MinMax(params GeoPoint2D[] p)
Parameters
Type Name Description
GeoPoint2D[] p

Points to be included

| Improve this Doc View Source

Modify(ModOp2D)

Modifies the rectangle by the provided ModOp2D. The resulting rectangle contains the modified vertices of this rectangle

Declaration
public void Modify(ModOp2D m)
Parameters
Type Name Description
ModOp2D m

Modification to use

| Improve this Doc View Source

Move(GeoVector2D)

Moves the rectangle by the provided offset

Declaration
public void Move(GeoVector2D offset)
Parameters
Type Name Description
GeoVector2D offset

Offset to move

| Improve this Doc View Source

ToBorder()

Returns a Border that consists of the four lines of this ractangle.

Declaration
public Border ToBorder()
Returns
Type Description
Border

The border

| Improve this Doc View Source

ToRectangleF()

Declaration
public RectangleF ToRectangleF()
Returns
Type Description
System.Drawing.RectangleF

Operators

| Improve this Doc View Source

Addition(BoundingRect, BoundingRect)

Declaration
public static BoundingRect operator +(BoundingRect r1, BoundingRect r2)
Parameters
Type Name Description
BoundingRect r1
BoundingRect r2
Returns
Type Description
BoundingRect
| Improve this Doc View Source

Addition(BoundingRect, Double)

Returns an inflated or deflated rectangle

Declaration
public static BoundingRect operator +(BoundingRect rect, double offset)
Parameters
Type Name Description
BoundingRect rect

The initial rectangle

System.Double offset

The offset for the inflation (may be negaitve)

Returns
Type Description
BoundingRect

The inflated rectangle

| Improve this Doc View Source

Equality(BoundingRect, BoundingRect)

Declaration
public static bool operator ==(BoundingRect r1, BoundingRect r2)
Parameters
Type Name Description
BoundingRect r1
BoundingRect r2
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Explicit(BoundingRect to Rectangle)

Typecast to a System.Drawing.Rectangle

Declaration
public static explicit operator Rectangle(BoundingRect r)
Parameters
Type Name Description
BoundingRect r

The initial rectangle

Returns
Type Description
System.Drawing.Rectangle

The casted rectangle

| Improve this Doc View Source

GreaterThan(BoundingRect, BoundingRect)

Determins whether r2 is contained in r1.

Declaration
public static bool operator>(BoundingRect r1, BoundingRect r2)
Parameters
Type Name Description
BoundingRect r1

Left operand

BoundingRect r2

Right operand

Returns
Type Description
System.Boolean

true, if r2 is contained in r1.

| Improve this Doc View Source

GreaterThan(GeoPoint2D, BoundingRect)

Determins whether the provided point is outside of the provided ractangle

Declaration
public static bool operator>(GeoPoint2D p, BoundingRect r)
Parameters
Type Name Description
GeoPoint2D p

The point to test

BoundingRect r

The rectangle to test with

Returns
Type Description
System.Boolean

true if outside

| Improve this Doc View Source

GreaterThanOrEqual(BoundingRect, BoundingRect)

Determins whether r2 is contained in r1. It may also contact one ore multiple sides of the rectangle.

Declaration
public static bool operator >=(BoundingRect r1, BoundingRect r2)
Parameters
Type Name Description
BoundingRect r1

Left operand

BoundingRect r2

Right operand

Returns
Type Description
System.Boolean

true, if r2 is contained in r1.

| Improve this Doc View Source

GreaterThanOrEqual(GeoPoint2D, BoundingRect)

Determins whether the provided point is outside of the provided ractangle. It may also reside on one of the bounding lines.

Declaration
public static bool operator >=(GeoPoint2D p, BoundingRect r)
Parameters
Type Name Description
GeoPoint2D p

The point to test

BoundingRect r

The rectangle to test with

Returns
Type Description
System.Boolean

true if outside

| Improve this Doc View Source

Inequality(BoundingRect, BoundingRect)

Declaration
public static bool operator !=(BoundingRect r1, BoundingRect r2)
Parameters
Type Name Description
BoundingRect r1
BoundingRect r2
Returns
Type Description
System.Boolean
| Improve this Doc View Source

LessThan(BoundingRect, BoundingRect)

Determins whether r1 is contained in r2.

Declaration
public static bool operator <(BoundingRect r1, BoundingRect r2)
Parameters
Type Name Description
BoundingRect r1

Left operand

BoundingRect r2

Right operand

Returns
Type Description
System.Boolean

true, if r1 is contained in r2.

| Improve this Doc View Source

LessThan(GeoPoint2D, BoundingRect)

Determins whether the provided point is contained in the provided rectangle

Declaration
public static bool operator <(GeoPoint2D p, BoundingRect r)
Parameters
Type Name Description
GeoPoint2D p

The point to test

BoundingRect r

The rectangle to test with

Returns
Type Description
System.Boolean

true if contained

| Improve this Doc View Source

LessThanOrEqual(BoundingRect, BoundingRect)

Determins whether r1 is contained in r2. It may also contact one ore multiple sides of the rectangle.

Declaration
public static bool operator <=(BoundingRect r1, BoundingRect r2)
Parameters
Type Name Description
BoundingRect r1

Left operand

BoundingRect r2

Right operand

Returns
Type Description
System.Boolean

true, if r1 is contained in r2.

| Improve this Doc View Source

LessThanOrEqual(GeoPoint2D, BoundingRect)

Determins whether the provided point is contained in the provided rectangle. It may also reside on one of the bounding lines.

Declaration
public static bool operator <=(GeoPoint2D p, BoundingRect r)
Parameters
Type Name Description
GeoPoint2D p

The point to test

BoundingRect r

The rectangle to test with

Returns
Type Description
System.Boolean

true if contained

| Improve this Doc View Source

Multiply(BoundingRect, Double)

Returns a rectangle which is scaled by the provided factor. The center remaines fixed.

Declaration
public static BoundingRect operator *(BoundingRect rect, double Factor)
Parameters
Type Name Description
BoundingRect rect

The initial rectangle

System.Double Factor

The scalingfactor

Returns
Type Description
BoundingRect

the scaled rectangle

| Improve this Doc View Source

Multiply(ModOp2D, BoundingRect)

Declaration
public static BoundingRect operator *(ModOp2D m, BoundingRect rect)
Parameters
Type Name Description
ModOp2D m
BoundingRect rect
Returns
Type Description
BoundingRect

Explicit Interface Implementations

| Improve this Doc View Source

IQuadTreeInsertable.GetExtent()

Declaration
BoundingRect IQuadTreeInsertable.GetExtent()
Returns
Type Description
BoundingRect
| Improve this Doc View Source

IQuadTreeInsertable.HitTest(ref BoundingRect, Boolean)

Declaration
bool IQuadTreeInsertable.HitTest(ref BoundingRect rect, bool includeControlPoints)
Parameters
Type Name Description
BoundingRect rect
System.Boolean includeControlPoints
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IQuadTreeInsertable.ReferencedObject

Declaration
object IQuadTreeInsertable.ReferencedObject { get; }
Returns
Type Description
System.Object
| Improve this Doc View Source

IComparable<BoundingRect>.CompareTo(BoundingRect)

Declaration
int IComparable<BoundingRect>.CompareTo(BoundingRect other)
Parameters
Type Name Description
BoundingRect other
Returns
Type Description
System.Int32

Implements

IQuadTreeInsertable
System.IComparable<T>
System.Runtime.Serialization.ISerializable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX