piDogGeometry

Notes

About

The piDogGeometry Module contains classes and methods that are required by piDogScrollingCanvas.

piDogGeometry.DoubleRect is a rect class that parallels most of REALbasic.Rect but uses Double values.

piDogGeometry.DoublePoint is a point class that parallels some of REALbasic.Point but using Double Values.

Theses items are available for you to use and/or borrow from. Please share improvements back to me!

Constants

pi

Methods

Function Contains(extends r As REALbasic.Rect, r2 as piDogGeometry.DoubleRect) As Boolean

whether this realbasic.rect contains a doubleRect

Function Intersects(extends r As REALbasic.Rect, r2 as piDogGeometry.DoubleRect) As Boolean

whether this realbasic.rect intersects a doubleRect

piDogGeometry.DoublePoint

Notes

About

piDogGeometry.DoublePoint is a point class that parallels some of REALbasic.Point but using Double Values.

Methods

Sub Constructor(x As Double, y As Double)

Creates a new DoublePoint

Function Operator_Convert() As REALbasic.Point

Gets a RealBasic.Point

Properties

x As Double

x coordinate

y As Double

y coordinate

piDogGeometry.DoubleRect

Notes

About

piDogGeometry.DoubleRect is a rect class that parallels most of REALbasic.Rect but uses Double values.

Methods

Function Clone() As piDogGeometry.doubleRect

Returns a copy of this rectangle

Sub Constructor(left As Double, top As Double, width As Double, height as Double, rotation As Double = 0)

create a new rectangle with the specified bounds and rotation

Sub Constructor(r As REALbasic.Rect)

create a new DoubleRect from a realbasic.rect

Function Contains(other As DoubleRect) As Boolean

Whether this rect contains other DoubleRect.

Function Contains(other As piDogGeometry.DoublePoint) As Boolean

whether this rect contains the other piDogGeometry.DoublePoint

Function Contains(other As REALbasic.Point) As Boolean

whether this rect contains the other REALbasic.Point

Function Contains(other As REALbasic.Rect) As Boolean

Whether this rect contains other REALbasic.Rect.

Function HorizontalCenter() As Double

the middle of the rect

Function Intersection(other As piDogGeometry.doubleRect) As piDogGeometry.doubleRect

the area where this rect overlaps the other rect

Function Intersection(other As REALbasic.Rect) As piDogGeometry.doubleRect

the area where this rect overlaps the other REALbasic.Rect

Function Intersects(other As piDogGeometry.doubleRect) As Boolean

whether this rect Intersects (but not contains or is contained by) other DoubleRect

Function Intersects(other As REALbasic.Rect) As Boolean

whether this rect intersects(but does not contain or is contained by) other REALbasic.rect

Function Operator_Add(other As piDogGeometry.doubleRect) As piDogGeometry.doubleRect()

Allows the adding of 2 rect areas together

Differs from Union in that + will return an array of rects filling the shape covered by the two rects.

If the rects do not overlap, the return is a clone of the left operand

rects()=rect1+rect2

Function Operator_Compare(other As piDogGeometry.doubleRect) As integer

Whether the two rects are equal

Function Operator_Convert() As REALbasic.Rect

a realbasic.rect from this rect

Function operator_divide(other As piDogGeometry.doubleRect) As piDogGeometry.doubleRect()

Returns an array of rects representing the left operand split at the borderlines of the other rect

Rects()=rect1/rect2

Function Operator_Modulo(other As piDogGeometry.doubleRect) As piDogGeometry.doubleRect()

Returns an array of rects representing the area left over when 2 overlapping rects are united

Rects()=rect1 mod rect2

Function Operator_Subtract(Other As piDogGeometry.doubleRect) As piDogGeometry.doubleRect()

Returns an array of rects representing the area left over when one rect is removed from the other

Rects()=rect1-rect2

Function Overlaps(other As piDogGeometry.doubleRect) As Boolean

Whether this rect intersects, contains, or is contained by, other rect

Function Overlaps(other As REALbasic.Rect) As Boolean

Whether this rect intersects, contains, or is contained by, other rect

Function RotatedRect() As piDogGeometry.doubleRect

The area consumed by this rect when rotation is applied

Function split(other As piDogGeometry.doubleRect) As piDogGeometry.doubleRect()

returns an array of rects representing a union of the two divided at each edge of both rects

Function SplitHorizontal(x As Double) As piDogGeometry.doubleRect

return a new rect at x, inluding the right part of this rect. this rect is resized down to x width

Function SplitVertical(y As Double) As DoubleRect

returns a new rect at y, encompasing the bottom of this rect. This rect is resized to y height.

Function Union(other As piDogGeometry.doubleRect) As piDogGeometry.doubleRect

returns a new rect encompassing this rect and other rect

Function Union(other As REALbasic.Rect) As piDogGeometry.doubleRect

returns a new rect encompassing this rect and other rect

Function UnionWithRotation(other As piDogGeometry.doubleRect) As piDogGeometry.doubleRect

returns a new rect encompassing this rect's RotatedRect and other rect's RotatedRect

Function VerticalCenter() As Double

vertical middle point

Properties

bottom As Double

top+height

Center As DoublePoint

point at center of rect. Setting changes top and left.

dataStruct As DoubleRectStruct

height As Double

height of the rect

left As Double

left edge of the rect

right As Double

right edge of the rect

Rotation As Double

rotation in Radians to be applied for RotatedRect

top As Double

top edge of this rect

width As Double

width of this rect