Enhanced C#
Language of your choice: library documentation
Public Member Functions | List of all members
Loyc.Geometry.IRectangleBase< T > Interface Template Reference

Represents a mutable 2D rectangle. More...

Source file:
Inheritance diagram for Loyc.Geometry.IRectangleBase< T >:
Loyc.Geometry.IRectangleReader< T > Loyc.Geometry.ISizeReader< T > Loyc.Geometry.IRectangle< T > Loyc.Geometry.IRectangle3Base< T > Loyc.Geometry.IRectangle3< T >


Represents a mutable 2D rectangle.

Template Parameters
TType of each coordinate.

This interface can represent one of three types of rectangles: either "normal" rectangles with fundamental variables X, Y, Width, Height, bounding rectangles with two coordinate ranges (X1-X2) and (Y1-Y2), or or pairs of points (X1, Y1) and (X2, Y2).

Because of this fact, it is not clear when you modify X1 whether this should affect X2 or Width. Similarly, when you modify X2, Y1 or Y2, it is not clear whether the size property or the opposite boundary should change. To resolve this question, this interface does not allow you to modify the coordinates individually; instead you must change them in pairs: you either set X and Width together, or X1 and X2 together; and similarly Y and Height together, or Y1 and Y2 together.

You can also call the extension methods SetRect() or SetRange() to set all four coordinates at once.

See also
IRectangle<T>, BoundingBox<T>

Public Member Functions

void SetXAndWidth (T x, T width)
void SetYAndHeight (T y, T height)
void SetXRange (T x1, T x2)
void SetYRange (T x1, T x2)

Additional Inherited Members

- Properties inherited from Loyc.Geometry.IRectangleReader< T >
X1 [get]
Y1 [get]
X2 [get]
Y2 [get]
- Properties inherited from Loyc.Geometry.ISizeReader< T >
Width [get]
 Gets the width of a rectangle (the difference between X coordinates). More...
Height [get]
 Gets the height of a rectangle (the difference between Y coordinates). More...