engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | Public 属性 | 友元 | 所有成员列表
FIntRect结构体 参考

Structure for integer rectangles in 2-d space. 更多...

#include <IntRect.h>

Public 成员函数

int32 Area () const
 Calculates the area of this rectangle. 更多...
 
FIntRect Bottom (int32 InHeight) const
 Creates a rectangle from the bottom part of this rectangle. 更多...
 
void Clip (const FIntRect &Other)
 Clip a rectangle using the bounds of another rectangle. 更多...
 
bool Contains (FIntPoint Point) const
 Test whether this rectangle contains a point. 更多...
 
 FIntRect ()
 Constructor
 
 FIntRect (FIntPoint InMin, FIntPoint InMax)
 Constructor 更多...
 
 FIntRect (int32 X0, int32 Y0, int32 X1, int32 Y1)
 Constructor 更多...
 
void GetCenterAndExtents (FIntPoint &OutCenter, FIntPoint &OutExtent) const
 Gets the Center and Extents of this rectangle. 更多...
 
int32 Height () const
 Gets the Height of the rectangle. 更多...
 
void Include (FIntPoint Point)
 Adds to this rectangle to include a given point. 更多...
 
void InflateRect (int32 Amount)
 Inflates or deflates the rectangle. 更多...
 
FIntRect Inner (FIntPoint Shrink) const
 Gets a new rectangle from the inner of this one. 更多...
 
bool IsEmpty () const
 Returns true if the rectangle is 0 x 0. 更多...
 
bool operator!= (const FIntRect &Other) const
 Compares Rectangles for inequality. 更多...
 
FIntPoint & operator() (int32 PointIndex)
 Gets a specific point in this rectangle. 更多...
 
const FIntPoint & operator() (int32 PointIndex) const
 Gets a specific point in this rectangle. 更多...
 
FIntRect operator* (int32 Scale) const
 Gets the result of scaling on this rectangle. 更多...
 
FIntRect & operator*= (int32 Scale)
 Applies scaling to this rectangle. 更多...
 
FIntRect operator+ (const FIntPoint &Point) const
 Gets the result of adding a point to this rectangle. 更多...
 
FIntRect operator+ (const FIntRect &Other) const
 Gets the result of adding two rectangles together. 更多...
 
FIntRect & operator+= (const FIntPoint &Point)
 Adds a point to this rectangle. 更多...
 
FIntRect operator- (const FIntPoint &Point) const
 Gets the result of subtracting a point from this rectangle. 更多...
 
FIntRect operator- (const FIntRect &Other) const
 Gets the result of subtracting a rectangle from this one. 更多...
 
FIntRect & operator-= (const FIntPoint &Point)
 Subtracts a point from this rectangle. 更多...
 
FIntRect operator/ (const FIntPoint &Point) const
 Gets the result of dividing a point with this rectangle. 更多...
 
FIntRect operator/ (int32 Div) const
 Gets the result of division on this rectangle. 更多...
 
bool operator== (const FIntRect &Other) const
 Compares Rectangles for equality. 更多...
 
FIntRect Right (int32 InWidth) const
 Creates a rectangle from the right hand side of this rectangle. 更多...
 
FIntRect Scale (float Fraction) const
 Scales a rectangle using a floating point number. 更多...
 
FIntPoint Size () const
 Gets the distance from one corner of the rectangle to the other. 更多...
 
FString ToString () const
 Get a textual representation of this rectangle. 更多...
 
void Union (const FIntRect &Other)
 Combines the two rectanges.
 
int32 Width () const
 Gets the width of the rectangle. 更多...
 

静态 Public 成员函数

static FIntRect DivideAndRoundUp (FIntRect lhs, int32 Div)
 Divides a rectangle and rounds up to the nearest integer. 更多...
 
static int32 Num ()
 Gets number of points in the Rectangle. 更多...
 

Public 属性

FIntPoint Max
 Holds the last pixel line/row (like in Win32 RECT).
 
FIntPoint Min
 Holds the first pixel line/row (like in Win32 RECT).
 

友元

FArchive & operator<< (FArchive &Ar, FIntRect &Rect)
 Serializes the Rectangle. 更多...
 

详细描述

Structure for integer rectangles in 2-d space.

待办事项:
Docs: The operators need better documentation, i.e. what does it mean to divide a rectangle?

构造及析构函数说明

◆ FIntRect() [1/2]

FORCEINLINE FIntRect::FIntRect ( int32  X0,
int32  Y0,
int32  X1,
int32  Y1 
)

Constructor

参数
X0Minimum X coordinate.
Y0Minimum Y coordinate.
X1Maximum X coordinate.
Y1Maximum Y coordinate.

◆ FIntRect() [2/2]

FORCEINLINE FIntRect::FIntRect ( FIntPoint  InMin,
FIntPoint  InMax 
)

Constructor

参数
InMinMinimum Point
InMaxMaximum Point

成员函数说明

◆ Area()

FORCEINLINE int32 FIntRect::Area ( ) const

Calculates the area of this rectangle.

返回
The area of this rectangle.

◆ Bottom()

FORCEINLINE FIntRect FIntRect::Bottom ( int32  InHeight) const

Creates a rectangle from the bottom part of this rectangle.

参数
InHeightHeight of the new rectangle (<= rectangles original height).
返回
The new rectangle.

◆ Clip()

FORCEINLINE void FIntRect::Clip ( const FIntRect &  Other)

Clip a rectangle using the bounds of another rectangle.

参数
OtherThe other rectangle to clip against.

◆ Contains()

FORCEINLINE bool FIntRect::Contains ( FIntPoint  Point) const

Test whether this rectangle contains a point.

参数
PointThe point to test against.
返回
true if the rectangle contains the specified point,, false otherwise..

◆ DivideAndRoundUp()

FORCEINLINE FIntRect FIntRect::DivideAndRoundUp ( FIntRect  lhs,
int32  Div 
)
static

Divides a rectangle and rounds up to the nearest integer.

参数
lhsThe Rectangle to divide.
DivWhat to divide by.
返回
New divided rectangle.

◆ GetCenterAndExtents()

FORCEINLINE void FIntRect::GetCenterAndExtents ( FIntPoint &  OutCenter,
FIntPoint &  OutExtent 
) const

Gets the Center and Extents of this rectangle.

参数
OutCenterWill contain the center point.
OutExtentWill contain the extent.

◆ Height()

FORCEINLINE int32 FIntRect::Height ( ) const

Gets the Height of the rectangle.

返回
The Height of the rectangle.

◆ Include()

FORCEINLINE void FIntRect::Include ( FIntPoint  Point)

Adds to this rectangle to include a given point.

参数
PointThe point to increase the rectangle to.

◆ InflateRect()

FORCEINLINE void FIntRect::InflateRect ( int32  Amount)

Inflates or deflates the rectangle.

参数
AmountThe amount to inflate or deflate the rectangle on each side.

◆ Inner()

FORCEINLINE FIntRect FIntRect::Inner ( FIntPoint  Shrink) const

Gets a new rectangle from the inner of this one.

参数
ShrinkHow much to remove from each point of this rectangle.
返回
New inner Rectangle.

◆ IsEmpty()

FORCEINLINE bool FIntRect::IsEmpty ( ) const

Returns true if the rectangle is 0 x 0.

返回
true if the rectangle is 0 x 0.

◆ Num()

FORCEINLINE int32 FIntRect::Num ( )
static

Gets number of points in the Rectangle.

返回
Number of points in the Rectangle.

◆ operator!=()

FORCEINLINE bool FIntRect::operator!= ( const FIntRect &  Other) const

Compares Rectangles for inequality.

参数
OtherThe Other Rectangle for comparison.
返回
true if the rectangles are not equal, false otherwise..

◆ operator()() [1/2]

FORCEINLINE FIntPoint & FIntRect::operator() ( int32  PointIndex)

Gets a specific point in this rectangle.

参数
PointIndexIndex of Point in rectangle.
返回
Reference to point in rectangle.

◆ operator()() [2/2]

FORCEINLINE const FIntPoint & FIntRect::operator() ( int32  PointIndex) const

Gets a specific point in this rectangle.

参数
PointIndexIndex of Point in rectangle.
返回
Const reference to point in rectangle.

◆ operator*()

FORCEINLINE FIntRect FIntRect::operator* ( int32  Scale) const

Gets the result of scaling on this rectangle.

参数
ScaleWhat to multiply this rectangle by.
返回
New scaled rectangle.

◆ operator*=()

FORCEINLINE FIntRect & FIntRect::operator*= ( int32  Scale)

Applies scaling to this rectangle.

参数
ScaleWhat to multiply the rectangle by.
返回
Reference to this rectangle after scaling.

◆ operator+() [1/2]

FORCEINLINE FIntRect FIntRect::operator+ ( const FIntPoint &  Point) const

Gets the result of adding a point to this rectangle.

参数
PointThe point to add to both points in the rectangle.
返回
New rectangle with point added to it.

◆ operator+() [2/2]

FORCEINLINE FIntRect FIntRect::operator+ ( const FIntRect &  Other) const

Gets the result of adding two rectangles together.

参数
OtherThe other rectangle to add to this.
返回
New rectangle after both are added together.

◆ operator+=()

FORCEINLINE FIntRect & FIntRect::operator+= ( const FIntPoint &  Point)

Adds a point to this rectangle.

参数
PointThe point to add onto both points in the rectangle.
返回
Reference to this rectangle after addition.

◆ operator-() [1/2]

FORCEINLINE FIntRect FIntRect::operator- ( const FIntPoint &  Point) const

Gets the result of subtracting a point from this rectangle.

参数
PointThe point to subtract from both points in the rectangle.
返回
New rectangle with point subtracted from it.

◆ operator-() [2/2]

FORCEINLINE FIntRect FIntRect::operator- ( const FIntRect &  Other) const

Gets the result of subtracting a rectangle from this one.

参数
OtherThe other rectangle to subtract from this.
返回
New rectangle after one is subtracted from this.

◆ operator-=()

FORCEINLINE FIntRect & FIntRect::operator-= ( const FIntPoint &  Point)

Subtracts a point from this rectangle.

参数
PointThe point to subtract from both points in the rectangle.
返回
Reference to this rectangle after subtraction.

◆ operator/() [1/2]

FORCEINLINE FIntRect FIntRect::operator/ ( const FIntPoint &  Point) const

Gets the result of dividing a point with this rectangle.

参数
PointThe point to divide with.
返回
New rectangle with point divided.

◆ operator/() [2/2]

FORCEINLINE FIntRect FIntRect::operator/ ( int32  Div) const

Gets the result of division on this rectangle.

参数
DivWhat to divide this rectangle by.
返回
New divided rectangle.

◆ operator==()

FORCEINLINE bool FIntRect::operator== ( const FIntRect &  Other) const

Compares Rectangles for equality.

参数
OtherThe Other Rectangle for comparison.
返回
true if the rectangles are equal, false otherwise..

◆ Right()

FORCEINLINE FIntRect FIntRect::Right ( int32  InWidth) const

Creates a rectangle from the right hand side of this rectangle.

参数
InWidthWidth of the new rectangle (<= rectangles original width).
返回
The new rectangle.

◆ Scale()

FORCEINLINE FIntRect FIntRect::Scale ( float  Fraction) const

Scales a rectangle using a floating point number.

参数
FractionWhat to scale the rectangle by
返回
New scaled rectangle.

◆ Size()

FORCEINLINE FIntPoint FIntRect::Size ( ) const

Gets the distance from one corner of the rectangle to the other.

返回
The distance from one corner of the rectangle to the other.

◆ ToString()

FORCEINLINE FString FIntRect::ToString ( ) const

Get a textual representation of this rectangle.

返回
A string describing the rectangle.

◆ Width()

FORCEINLINE int32 FIntRect::Width ( ) const

Gets the width of the rectangle.

返回
The width of the rectangle.

友元及相关函数文档

◆ operator<<

FArchive & operator<< ( FArchive &  Ar,
FIntRect &  Rect 
)
friend

Serializes the Rectangle.

参数
ArThe archive to serialize into.
RectThe rectangle to serialize.
返回
Reference to the Archive after serialization.

该结构体的文档由以下文件生成: