C# Class SilverFlow.Controls.Extensions.GeometryExtensions

Geometry extensions
Mostra file Open project: Zoomicon/ZUI

Public Methods

Method Description
Add ( this point, Distance distance ) : Point

Shifts the point to the specified distance.

Add ( this point, Size size ) : Point

Adds an offset specified by the Size to the specified point.

Add ( this point, double x, double y ) : Point

Adds an offset to the specified point.

Add ( this rect, double width, double height ) : Rect

Increases size if the rectangle to the specified width and height.

Add ( this size, double x, double y ) : Size

Increments size to the specified values.

BottomLeft ( this rect ) : Point

Gets position the lower left corner of the rectangle.

BottomRight ( this rect ) : Point

Gets position the lower right corner of the rectangle.

Center ( this rect ) : Point

Gets center of the specified rectangle.

CenterX ( this rect ) : double

Gets x-coordinate for center of the specified rectangle.

CenterY ( this rect ) : double

Gets y-coordinate for center of the specified rectangle.

EnsureInBounds ( this point, Rect bounds ) : Point

Ensures that coordinates of the point are in the specified bounds.

EnsureInHorizontalBounds ( this point, Rect bounds ) : Point

Ensures that the X-coordinate of the point is in the specified horizontal bounds.

EnsureInVerticalBounds ( this point, Rect bounds ) : Point

Ensures that the Y-coordinate of the point is in the specified vertical bounds.

EnsurePositive ( this point ) : Point

Ensures that coordinates are positive.

IsNotSet ( this point ) : bool

Determines whether coordinates of the point are Not a Number (NaN).

OverlapsHorizontally ( this rect, Rect testRect, double accuracy ) : bool

Tests whether the rectangle overlaps with another one horizontally.

OverlapsVertically ( this rect, Rect testRect, double accuracy ) : bool

Tests whether the rectangle overlaps with another one vertically.

Position ( this rect ) : Point

Gets position of the specified rectangle.

Round ( this point ) : Point

Rounds the specified point to the nearest integer coordinates.

Scaled ( this rect, double factor ) : Rect

Gets scaled rect.

Scaled ( this size, double factor ) : Size

Gets scaled size.

Subtract ( this point, Size size ) : Point

Subtracts an offset specified by the Size from the specified point.

TopLeft ( this rect ) : Point

Gets position the upper left corner of the rectangle.

TopRight ( this rect ) : Point

Gets position the upper right corner of the rectangle.

Method Details

Add() public static method

Shifts the point to the specified distance.
public static Add ( this point, Distance distance ) : Point
point this The point.
distance Distance The distance.
return Point

Add() public static method

Adds an offset specified by the Size to the specified point.
public static Add ( this point, Size size ) : Point
point this The point.
size System.Windows.Size Distance to add.
return Point

Add() public static method

Adds an offset to the specified point.
public static Add ( this point, double x, double y ) : Point
point this The point.
x double Distance along X-coordinate.
y double Distance along Y-coordinate.
return Point

Add() public static method

Increases size if the rectangle to the specified width and height.
public static Add ( this rect, double width, double height ) : Rect
rect this The rectangle.
width double Value to add to the width of the rectangle.
height double Value to add to the height of the rectangle.
return System.Windows.Rect

Add() public static method

Increments size to the specified values.
public static Add ( this size, double x, double y ) : Size
size this The size.
x double Increment by X-coordinate.
y double Increment by Y-coordinate.
return System.Windows.Size

BottomLeft() public static method

Gets position the lower left corner of the rectangle.
public static BottomLeft ( this rect ) : Point
rect this Rectangle.
return Point

BottomRight() public static method

Gets position the lower right corner of the rectangle.
public static BottomRight ( this rect ) : Point
rect this Rectangle.
return Point

Center() public static method

Gets center of the specified rectangle.
public static Center ( this rect ) : Point
rect this Rectangle.
return Point

CenterX() public static method

Gets x-coordinate for center of the specified rectangle.
public static CenterX ( this rect ) : double
rect this Rectangle.
return double

CenterY() public static method

Gets y-coordinate for center of the specified rectangle.
public static CenterY ( this rect ) : double
rect this Rectangle.
return double

EnsureInBounds() public static method

Ensures that coordinates of the point are in the specified bounds.
public static EnsureInBounds ( this point, Rect bounds ) : Point
point this The point.
bounds System.Windows.Rect The bounds.
return Point

EnsureInHorizontalBounds() public static method

Ensures that the X-coordinate of the point is in the specified horizontal bounds.
public static EnsureInHorizontalBounds ( this point, Rect bounds ) : Point
point this The point.
bounds System.Windows.Rect The bounds.
return Point

EnsureInVerticalBounds() public static method

Ensures that the Y-coordinate of the point is in the specified vertical bounds.
public static EnsureInVerticalBounds ( this point, Rect bounds ) : Point
point this The point.
bounds System.Windows.Rect The bounds.
return Point

EnsurePositive() public static method

Ensures that coordinates are positive.
public static EnsurePositive ( this point ) : Point
point this The point.
return Point

IsNotSet() public static method

Determines whether coordinates of the point are Not a Number (NaN).
public static IsNotSet ( this point ) : bool
point this The point.
return bool

OverlapsHorizontally() public static method

Tests whether the rectangle overlaps with another one horizontally.
public static OverlapsHorizontally ( this rect, Rect testRect, double accuracy ) : bool
rect this The rectangle.
testRect System.Windows.Rect Test rectangle.
accuracy double Accuracy.
return bool

OverlapsVertically() public static method

Tests whether the rectangle overlaps with another one vertically.
public static OverlapsVertically ( this rect, Rect testRect, double accuracy ) : bool
rect this The rectangle.
testRect System.Windows.Rect Test rectangle.
accuracy double Accuracy.
return bool

Position() public static method

Gets position of the specified rectangle.
public static Position ( this rect ) : Point
rect this Rectangle.
return Point

Round() public static method

Rounds the specified point to the nearest integer coordinates.
public static Round ( this point ) : Point
point this The point to round coordinates.
return Point

Scaled() public static method

Gets scaled rect.
public static Scaled ( this rect, double factor ) : Rect
rect this
factor double
return System.Windows.Rect

Scaled() public static method

Gets scaled size.
public static Scaled ( this size, double factor ) : Size
size this Size.
factor double
return System.Windows.Size

Subtract() public static method

Subtracts an offset specified by the Size from the specified point.
public static Subtract ( this point, Size size ) : Point
point this The point.
size System.Windows.Size Distance to subtract.
return Point

TopLeft() public static method

Gets position the upper left corner of the rectangle.
public static TopLeft ( this rect ) : Point
rect this Rectangle.
return Point

TopRight() public static method

Gets position the upper right corner of the rectangle.
public static TopRight ( this rect ) : Point
rect this Rectangle.
return Point