struct TArea2

template<typename PositionType, typename SizeType = PositionType>

Represents a 2D area.

Area is represented with an origin in top left and width/height.

Public

Constructors

TArea2<PositionType, SizeType>

TArea2<PositionType, SizeType>() = default

TArea2<PositionType, SizeType>

constexpr TArea2<PositionType, SizeType>(PositionType x, PositionType y, SizeType width, SizeType height)

TArea2<PositionType, SizeType>

TArea2<PositionType, SizeType>(const TVector2<PositionType> &position, const TSize2<SizeType> &size)

TArea2

TArea2() = default

TArea2

constexpr TArea2(int x, int y, int width, int height)

TArea2

TArea2(const TVector2<int> &position, const TSize2<int> &size)

TArea2

TArea2() = default

TArea2

constexpr TArea2(int x, int y, unsigned int width, unsigned int height)

TArea2

TArea2(const TVector2<int> &position, const TSize2<unsigned int> &size)

TArea2

TArea2() noexcept = default

TArea2

constexpr TArea2(float x, float y, float width, float height)

TArea2

TArea2(const TVector2<float> &position, const TSize2<float> &size)

TArea2

TArea2() = default

TArea2

constexpr TArea2(TUnitValue<i32, LogicalPixel> x, TUnitValue<i32, LogicalPixel> y, TUnitValue<i32, LogicalPixel> width, TUnitValue<i32, LogicalPixel> height)

TArea2

TArea2(const TVector2<TUnitValue<i32, LogicalPixel>> &position, const TSize2<TUnitValue<i32, LogicalPixel>> &size)

TArea2

TArea2() = default

TArea2

constexpr TArea2(TUnitValue<float, LogicalPixel> x, TUnitValue<float, LogicalPixel> y, TUnitValue<float, LogicalPixel> width, TUnitValue<float, LogicalPixel> height)

TArea2

TArea2(const TVector2<TUnitValue<float, LogicalPixel>> &position, const TSize2<TUnitValue<float, LogicalPixel>> &size)

TArea2

TArea2() noexcept(false) = default

TArea2

constexpr TArea2(TUnitValue<i32, PhysicalPixel> x, TUnitValue<i32, PhysicalPixel> y, TUnitValue<i32, PhysicalPixel> width, TUnitValue<i32, PhysicalPixel> height)

TArea2

TArea2(const TVector2<TUnitValue<i32, PhysicalPixel>> &position, const TSize2<TUnitValue<i32, PhysicalPixel>> &size)

TArea2

TArea2() = default

TArea2

constexpr TArea2(TUnitValue<float, PhysicalPixel> x, TUnitValue<float, PhysicalPixel> y, TUnitValue<float, PhysicalPixel> width, TUnitValue<float, PhysicalPixel> height)

TArea2

TArea2(const TVector2<TUnitValue<float, PhysicalPixel>> &position, const TSize2<TUnitValue<float, PhysicalPixel>> &size)

Methods

IsEmpty

bool IsEmpty() const

Returns true if the area covered is 0.

GetPosition

TVector2<PositionType> GetPosition() const

Returns the top left corner of the area.

GetSize

TSize2<SizeType> GetSize() const

Returns the size of the area.

GetCenter

TVector2<PositionType> GetCenter() const

Center of the rectangle.

Contains

bool Contains(const TVector2<PositionType> &point) const

Returns true if the area contains the provided point.

Contains

bool Contains(const TArea2<PositionType, SizeType> &other) const

Returns true if the area fully contains the provided rectangle.

Overlaps

bool Overlaps(const TArea2<PositionType, SizeType> &other) const

Returns true if the area overlaps the provided area.

Also returns true if the areas are contained within each other completely (no intersecting edges).

Encapsulate

void Encapsulate(const TArea2<PositionType, SizeType> &other)

Extends this area so that the provided area is completely contained within it.

SetPosition

void SetPosition(const TVector2<PositionType> &position)

Sets the X/Y coordinates of the area.

SetSize

void SetSize(const TSize2<SizeType> &size)

Sets the width/height of the area.

Clip

void Clip(const TArea2<PositionType, SizeType> &clipRect)

Clips current area so that it does not overlap the provided area.

Cut

u32 Cut(const TArea2<PositionType, SizeType> &rectangleToCutWith, Array<TArea2<PositionType, SizeType>, 4> &outPieces) const

Cuts the current area with the provided area and outputs the pieces.

The pieces will contain all area of the current area without including the cut area area.

Cut

void Cut(const Vector<TArea2<PositionType, SizeType>> &rectanglesToCutWith, Vector<TArea2<PositionType, SizeType>> &outPieces) const

Cuts the current area with the provided areas and outputs the pieces.

The pieces will contain all area of the current area without including the cut area.

IsEmpty

bool IsEmpty() const

Returns true if the area covered is 0.

GetPosition

TVector2<int> GetPosition() const

Returns the top left corner of the area.

GetSize

TSize2<int> GetSize() const

Returns the size of the area.

GetCenter

TVector2<int> GetCenter() const

Center of the rectangle.

Contains

bool Contains(const TVector2<int> &point) const

Returns true if the area contains the provided point.

Contains

bool Contains(const TArea2<i32> &other) const

Returns true if the area fully contains the provided rectangle.

Overlaps

bool Overlaps(const TArea2<i32> &other) const

Returns true if the area overlaps the provided area.

Also returns true if the areas are contained within each other completely (no intersecting edges).

Encapsulate

void Encapsulate(const TArea2<i32> &other)

Extends this area so that the provided area is completely contained within it.

SetPosition

void SetPosition(const TVector2<int> &position)

Sets the X/Y coordinates of the area.

SetSize

void SetSize(const TSize2<int> &size)

Sets the width/height of the area.

Clip

void Clip(const TArea2<i32> &clipRect)

Clips current area so that it does not overlap the provided area.

Cut

u32 Cut(const TArea2<i32> &rectangleToCutWith, Array<TArea2<i32>, 4> &outPieces) const

Cuts the current area with the provided area and outputs the pieces.

The pieces will contain all area of the current area without including the cut area area.

Cut

void Cut(const Vector<TArea2<i32>> &rectanglesToCutWith, Vector<TArea2<i32>> &outPieces) const

Cuts the current area with the provided areas and outputs the pieces.

The pieces will contain all area of the current area without including the cut area.

IsEmpty

bool IsEmpty() const

Returns true if the area covered is 0.

GetPosition

TVector2<int> GetPosition() const

Returns the top left corner of the area.

GetSize

TSize2<unsigned int> GetSize() const

Returns the size of the area.

GetCenter

TVector2<int> GetCenter() const

Center of the rectangle.

Contains

bool Contains(const TVector2<int> &point) const

Returns true if the area contains the provided point.

Contains

bool Contains(const TArea2<i32, u32> &other) const

Returns true if the area fully contains the provided rectangle.

Overlaps

bool Overlaps(const TArea2<i32, u32> &other) const

Returns true if the area overlaps the provided area.

Also returns true if the areas are contained within each other completely (no intersecting edges).

Encapsulate

void Encapsulate(const TArea2<i32, u32> &other)

Extends this area so that the provided area is completely contained within it.

SetPosition

void SetPosition(const TVector2<int> &position)

Sets the X/Y coordinates of the area.

SetSize

void SetSize(const TSize2<unsigned int> &size)

Sets the width/height of the area.

Clip

void Clip(const TArea2<i32, u32> &clipRect)

Clips current area so that it does not overlap the provided area.

Cut

u32 Cut(const TArea2<i32, u32> &rectangleToCutWith, Array<TArea2<i32, u32>, 4> &outPieces) const

Cuts the current area with the provided area and outputs the pieces.

The pieces will contain all area of the current area without including the cut area area.

Cut

void Cut(const Vector<TArea2<i32, u32>> &rectanglesToCutWith, Vector<TArea2<i32, u32>> &outPieces) const

Cuts the current area with the provided areas and outputs the pieces.

The pieces will contain all area of the current area without including the cut area.

IsEmpty

bool IsEmpty() const

Returns true if the area covered is 0.

GetPosition

TVector2<float> GetPosition() const

Returns the top left corner of the area.

GetSize

TSize2<float> GetSize() const

Returns the size of the area.

GetCenter

TVector2<float> GetCenter() const

Center of the rectangle.

Contains

bool Contains(const TVector2<float> &point) const

Returns true if the area contains the provided point.

Contains

bool Contains(const TArea2<float> &other) const

Returns true if the area fully contains the provided rectangle.

Overlaps

bool Overlaps(const TArea2<float> &other) const

Returns true if the area overlaps the provided area.

Also returns true if the areas are contained within each other completely (no intersecting edges).

Encapsulate

void Encapsulate(const TArea2<float> &other)

Extends this area so that the provided area is completely contained within it.

SetPosition

void SetPosition(const TVector2<float> &position)

Sets the X/Y coordinates of the area.

SetSize

void SetSize(const TSize2<float> &size)

Sets the width/height of the area.

Clip

void Clip(const TArea2<float> &clipRect)

Clips current area so that it does not overlap the provided area.

Cut

u32 Cut(const TArea2<float> &rectangleToCutWith, Array<TArea2<float>, 4> &outPieces) const

Cuts the current area with the provided area and outputs the pieces.

The pieces will contain all area of the current area without including the cut area area.

Cut

void Cut(const Vector<TArea2<float>> &rectanglesToCutWith, Vector<TArea2<float>> &outPieces) const

Cuts the current area with the provided areas and outputs the pieces.

The pieces will contain all area of the current area without including the cut area.

IsEmpty

bool IsEmpty() const

Returns true if the area covered is 0.

GetPosition

TVector2<TUnitValue<i32, LogicalPixel>> GetPosition() const

Returns the top left corner of the area.

GetSize

TSize2<TUnitValue<i32, LogicalPixel>> GetSize() const

Returns the size of the area.

GetCenter

TVector2<TUnitValue<i32, LogicalPixel>> GetCenter() const

Center of the rectangle.

Contains

bool Contains(const TVector2<TUnitValue<i32, LogicalPixel>> &point) const

Returns true if the area contains the provided point.

Contains

bool Contains(const TArea2<TUnitValue<i32, LogicalPixel>> &other) const

Returns true if the area fully contains the provided rectangle.

Overlaps

bool Overlaps(const TArea2<TUnitValue<i32, LogicalPixel>> &other) const

Returns true if the area overlaps the provided area.

Also returns true if the areas are contained within each other completely (no intersecting edges).

Encapsulate

void Encapsulate(const TArea2<TUnitValue<i32, LogicalPixel>> &other)

Extends this area so that the provided area is completely contained within it.

SetPosition

void SetPosition(const TVector2<TUnitValue<i32, LogicalPixel>> &position)

Sets the X/Y coordinates of the area.

SetSize

void SetSize(const TSize2<TUnitValue<i32, LogicalPixel>> &size)

Sets the width/height of the area.

Clip

void Clip(const TArea2<TUnitValue<i32, LogicalPixel>> &clipRect)

Clips current area so that it does not overlap the provided area.

Cut

u32 Cut(const TArea2<TUnitValue<i32, LogicalPixel>> &rectangleToCutWith, Array<TArea2<TUnitValue<i32, LogicalPixel>>, 4> &outPieces) const

Cuts the current area with the provided area and outputs the pieces.

The pieces will contain all area of the current area without including the cut area area.

Cut

void Cut(const Vector<TArea2<TUnitValue<i32, LogicalPixel>>> &rectanglesToCutWith, Vector<TArea2<TUnitValue<i32, LogicalPixel>>> &outPieces) const

Cuts the current area with the provided areas and outputs the pieces.

The pieces will contain all area of the current area without including the cut area.

IsEmpty

bool IsEmpty() const

Returns true if the area covered is 0.

GetPosition

TVector2<TUnitValue<float, LogicalPixel>> GetPosition() const

Returns the top left corner of the area.

GetSize

TSize2<TUnitValue<float, LogicalPixel>> GetSize() const

Returns the size of the area.

GetCenter

TVector2<TUnitValue<float, LogicalPixel>> GetCenter() const

Center of the rectangle.

Contains

bool Contains(const TVector2<TUnitValue<float, LogicalPixel>> &point) const

Returns true if the area contains the provided point.

Contains

bool Contains(const TArea2<TUnitValue<float, LogicalPixel>> &other) const

Returns true if the area fully contains the provided rectangle.

Overlaps

bool Overlaps(const TArea2<TUnitValue<float, LogicalPixel>> &other) const

Returns true if the area overlaps the provided area.

Also returns true if the areas are contained within each other completely (no intersecting edges).

Encapsulate

void Encapsulate(const TArea2<TUnitValue<float, LogicalPixel>> &other)

Extends this area so that the provided area is completely contained within it.

SetPosition

void SetPosition(const TVector2<TUnitValue<float, LogicalPixel>> &position)

Sets the X/Y coordinates of the area.

SetSize

void SetSize(const TSize2<TUnitValue<float, LogicalPixel>> &size)

Sets the width/height of the area.

Clip

void Clip(const TArea2<TUnitValue<float, LogicalPixel>> &clipRect)

Clips current area so that it does not overlap the provided area.

Cut

u32 Cut(const TArea2<TUnitValue<float, LogicalPixel>> &rectangleToCutWith, Array<TArea2<TUnitValue<float, LogicalPixel>>, 4> &outPieces) const

Cuts the current area with the provided area and outputs the pieces.

The pieces will contain all area of the current area without including the cut area area.

Cut

void Cut(const Vector<TArea2<TUnitValue<float, LogicalPixel>>> &rectanglesToCutWith, Vector<TArea2<TUnitValue<float, LogicalPixel>>> &outPieces) const

Cuts the current area with the provided areas and outputs the pieces.

The pieces will contain all area of the current area without including the cut area.

IsEmpty

bool IsEmpty() const

Returns true if the area covered is 0.

GetPosition

TVector2<TUnitValue<i32, PhysicalPixel>> GetPosition() const

Returns the top left corner of the area.

GetSize

TSize2<TUnitValue<i32, PhysicalPixel>> GetSize() const

Returns the size of the area.

GetCenter

TVector2<TUnitValue<i32, PhysicalPixel>> GetCenter() const

Center of the rectangle.

Contains

bool Contains(const TVector2<TUnitValue<i32, PhysicalPixel>> &point) const

Returns true if the area contains the provided point.

Contains

bool Contains(const TArea2<TUnitValue<i32, PhysicalPixel>> &other) const

Returns true if the area fully contains the provided rectangle.

Overlaps

bool Overlaps(const TArea2<TUnitValue<i32, PhysicalPixel>> &other) const

Returns true if the area overlaps the provided area.

Also returns true if the areas are contained within each other completely (no intersecting edges).

Encapsulate

void Encapsulate(const TArea2<TUnitValue<i32, PhysicalPixel>> &other)

Extends this area so that the provided area is completely contained within it.

SetPosition

void SetPosition(const TVector2<TUnitValue<i32, PhysicalPixel>> &position)

Sets the X/Y coordinates of the area.

SetSize

void SetSize(const TSize2<TUnitValue<i32, PhysicalPixel>> &size)

Sets the width/height of the area.

Clip

void Clip(const TArea2<TUnitValue<i32, PhysicalPixel>> &clipRect)

Clips current area so that it does not overlap the provided area.

Cut

u32 Cut(const TArea2<TUnitValue<i32, PhysicalPixel>> &rectangleToCutWith, Array<TArea2<TUnitValue<i32, PhysicalPixel>>, 4> &outPieces) const

Cuts the current area with the provided area and outputs the pieces.

The pieces will contain all area of the current area without including the cut area area.

Cut

void Cut(const Vector<TArea2<TUnitValue<i32, PhysicalPixel>>> &rectanglesToCutWith, Vector<TArea2<TUnitValue<i32, PhysicalPixel>>> &outPieces) const

Cuts the current area with the provided areas and outputs the pieces.

The pieces will contain all area of the current area without including the cut area.

IsEmpty

bool IsEmpty() const

Returns true if the area covered is 0.

GetPosition

TVector2<TUnitValue<float, PhysicalPixel>> GetPosition() const

Returns the top left corner of the area.

GetSize

TSize2<TUnitValue<float, PhysicalPixel>> GetSize() const

Returns the size of the area.

GetCenter

TVector2<TUnitValue<float, PhysicalPixel>> GetCenter() const

Center of the rectangle.

Contains

bool Contains(const TVector2<TUnitValue<float, PhysicalPixel>> &point) const

Returns true if the area contains the provided point.

Contains

bool Contains(const TArea2<TUnitValue<float, PhysicalPixel>> &other) const

Returns true if the area fully contains the provided rectangle.

Overlaps

bool Overlaps(const TArea2<TUnitValue<float, PhysicalPixel>> &other) const

Returns true if the area overlaps the provided area.

Also returns true if the areas are contained within each other completely (no intersecting edges).

Encapsulate

void Encapsulate(const TArea2<TUnitValue<float, PhysicalPixel>> &other)

Extends this area so that the provided area is completely contained within it.

SetPosition

void SetPosition(const TVector2<TUnitValue<float, PhysicalPixel>> &position)

Sets the X/Y coordinates of the area.

SetSize

void SetSize(const TSize2<TUnitValue<float, PhysicalPixel>> &size)

Sets the width/height of the area.

Clip

void Clip(const TArea2<TUnitValue<float, PhysicalPixel>> &clipRect)

Clips current area so that it does not overlap the provided area.

Cut

u32 Cut(const TArea2<TUnitValue<float, PhysicalPixel>> &rectangleToCutWith, Array<TArea2<TUnitValue<float, PhysicalPixel>>, 4> &outPieces) const

Cuts the current area with the provided area and outputs the pieces.

The pieces will contain all area of the current area without including the cut area area.

Cut

void Cut(const Vector<TArea2<TUnitValue<float, PhysicalPixel>>> &rectanglesToCutWith, Vector<TArea2<TUnitValue<float, PhysicalPixel>>> &outPieces) const

Cuts the current area with the provided areas and outputs the pieces.

The pieces will contain all area of the current area without including the cut area.

Fields

X

PositionType X

Y

PositionType Y

Width

SizeType Width

Height

SizeType Height

X

int X

Y

int Y

Width

int Width

Height

int Height

X

int X

Y

int Y

Width

unsigned int Width

Height

unsigned int Height

X

float X

Y

float Y

Width

float Width

Height

float Height

Width

Height

X

Y

Width

TUnitValue<float, LogicalPixel> Width

Height

TUnitValue<float, LogicalPixel> Height

Width

Height

Width

Height

TUnitValue<float, PhysicalPixel> Height

Operators

operator==

bool operator==(const TArea2<PositionType, SizeType> &rhs) const

operator!=

bool operator!=(const TArea2<PositionType, SizeType> &rhs) const

operator==

bool operator==(const TArea2<i32> &rhs) const

operator!=

bool operator!=(const TArea2<i32> &rhs) const

operator==

bool operator==(const TArea2<i32, u32> &rhs) const

operator!=

bool operator!=(const TArea2<i32, u32> &rhs) const

operator==

bool operator==(const TArea2<float> &rhs) const

operator!=

bool operator!=(const TArea2<float> &rhs) const

operator==

bool operator==(const TArea2<TUnitValue<i32, LogicalPixel>> &rhs) const

operator!=

bool operator!=(const TArea2<TUnitValue<i32, LogicalPixel>> &rhs) const

operator==

bool operator==(const TArea2<TUnitValue<float, LogicalPixel>> &rhs) const

operator!=

bool operator!=(const TArea2<TUnitValue<float, LogicalPixel>> &rhs) const

operator==

bool operator==(const TArea2<TUnitValue<i32, PhysicalPixel>> &rhs) const

operator!=

bool operator!=(const TArea2<TUnitValue<i32, PhysicalPixel>> &rhs) const

operator==

bool operator==(const TArea2<TUnitValue<float, PhysicalPixel>> &rhs) const

operator!=

bool operator!=(const TArea2<TUnitValue<float, PhysicalPixel>> &rhs) const