Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
UE::Math::TIntPoint< InIntType > Struct Template Reference

#include <IntPoint.h>

+ Collaboration diagram for UE::Math::TIntPoint< InIntType >:

Public Types

using IntType = InIntType
 

Public Member Functions

 TIntPoint ()=default
 
 TIntPoint (IntType InX, IntType InY)
 
 TIntPoint (IntType InXY)
 
 TIntPoint (EForceInit)
 
template<typename OtherIntType >
 TIntPoint (TIntPoint< OtherIntType > Other)
 
const IntTypeoperator() (int32 PointIndex) const
 
IntTypeoperator() (int32 PointIndex)
 
bool operator== (const TIntPoint &Other) const
 
bool operator!= (const TIntPoint &Other) const
 
TIntPointoperator*= (IntType Scale)
 
TIntPointoperator/= (IntType Divisor)
 
TIntPointoperator+= (const TIntPoint &Other)
 
TIntPointoperator*= (const TIntPoint &Other)
 
TIntPointoperator-= (const TIntPoint &Other)
 
TIntPointoperator/= (const TIntPoint &Other)
 
TIntPointoperator= (const TIntPoint &Other)
 
TIntPoint operator* (IntType Scale) const
 
TIntPoint operator/ (IntType Divisor) const
 
TIntPoint operator+ (const TIntPoint &Other) const
 
TIntPoint operator- (const TIntPoint &Other) const
 
TIntPoint operator* (const TIntPoint &Other) const
 
TIntPoint operator/ (const TIntPoint &Other) const
 
IntTypeoperator[] (IntType Index)
 
IntType operator[] (IntType Index) const
 
TIntPoint ComponentMin (const TIntPoint &Other) const
 
TIntPoint ComponentMax (const TIntPoint &Other) const
 
IntType GetMax () const
 
IntType GetMin () const
 
IntType Size () const
 
IntType SizeSquared () const
 
FString ToString () const
 
bool Serialize (FArchive &Ar)
 
bool SerializeFromMismatchedTag (FName StructTag, FArchive &Ar)
 
FString ToString () const
 
FString ToString () const
 
FString ToString () const
 
FString ToString () const
 
FString ToString () const
 
FString ToString () const
 
FString ToString () const
 
FString ToString () const
 

Static Public Member Functions

static TIntPoint DivideAndRoundUp (TIntPoint lhs, IntType Divisor)
 
static TIntPoint DivideAndRoundUp (TIntPoint lhs, TIntPoint Divisor)
 
static TIntPoint DivideAndRoundDown (TIntPoint lhs, IntType Divisor)
 
static TIntPoint DivideAndRoundDown (TIntPoint lhs, TIntPoint Divisor)
 
static int32 Num ()
 

Public Attributes

union { 
 
   struct { 
 
      IntType   X 
 
      IntType   Y 
 
   }  
 
   IntType   XY [2] 
 
};  
 

Static Public Attributes

static const TIntPoint ZeroValue
 
static const TIntPoint NoneValue
 

Friends

FArchiveoperator<< (FArchive &Ar, TIntPoint &Point)
 
void operator<< (FStructuredArchive::FSlot Slot, TIntPoint &Point)
 

Detailed Description

template<typename InIntType>
struct UE::Math::TIntPoint< InIntType >

Structure for integer points in 2-d space.

Todo
Docs: The operators need better documentation, i.e. what does it mean to divide a point?

Definition at line 22 of file IntPoint.h.

Member Typedef Documentation

◆ IntType

Definition at line 24 of file IntPoint.h.

Constructor & Destructor Documentation

◆ TIntPoint() [1/5]

template<typename InIntType >
UE::Math::TIntPoint< InIntType >::TIntPoint ( )
default

Default constructor (no initialization).

◆ TIntPoint() [2/5]

template<typename InIntType >
UE::Math::TIntPoint< InIntType >::TIntPoint ( IntType InX,
IntType InY )
inline

Create and initialize a new instance with the specified coordinates.

Parameters
InXThe x-coordinate.
InYThe y-coordinate.

Definition at line 57 of file IntPoint.h.

◆ TIntPoint() [3/5]

template<typename InIntType >
UE::Math::TIntPoint< InIntType >::TIntPoint ( IntType InXY)
inline

Create and initialize a new instance with a single int. Both X and Y will be initialized to this value

Parameters
InXYThe x and y-coordinate.

Definition at line 69 of file IntPoint.h.

◆ TIntPoint() [4/5]

template<typename InIntType >
UE::Math::TIntPoint< InIntType >::TIntPoint ( EForceInit )
inlineexplicit

Create and initialize a new instance to zero.

Parameters
EForceInitForce init enum

Definition at line 80 of file IntPoint.h.

◆ TIntPoint() [5/5]

template<typename InIntType >
template<typename OtherIntType >
UE::Math::TIntPoint< InIntType >::TIntPoint ( TIntPoint< OtherIntType > Other)
inlineexplicit

Converts to another int type. Checks that the cast will succeed.

Definition at line 90 of file IntPoint.h.

Member Function Documentation

◆ ComponentMax()

template<typename InIntType >
TIntPoint UE::Math::TIntPoint< InIntType >::ComponentMax ( const TIntPoint< InIntType > & Other) const
inline

Get the component-wise max of two points.

See also
ComponentMin, GetMin

Definition at line 347 of file IntPoint.h.

◆ ComponentMin()

template<typename InIntType >
TIntPoint UE::Math::TIntPoint< InIntType >::ComponentMin ( const TIntPoint< InIntType > & Other) const
inline

Get the component-wise min of two points.

See also
ComponentMax, GetMax

Definition at line 337 of file IntPoint.h.

◆ DivideAndRoundDown() [1/2]

template<typename InIntType >
static TIntPoint UE::Math::TIntPoint< InIntType >::DivideAndRoundDown ( TIntPoint< InIntType > lhs,
IntType Divisor )
inlinestatic

Divide an int point and round down the result.

Parameters
lhsThe int point being divided.
DivisorWhat to divide the int point by.
Returns
A new divided int point.
See also
DivideAndRoundUp

Definition at line 434 of file IntPoint.h.

◆ DivideAndRoundDown() [2/2]

template<typename InIntType >
static TIntPoint UE::Math::TIntPoint< InIntType >::DivideAndRoundDown ( TIntPoint< InIntType > lhs,
TIntPoint< InIntType > Divisor )
inlinestatic

Definition at line 439 of file IntPoint.h.

◆ DivideAndRoundUp() [1/2]

template<typename InIntType >
static TIntPoint UE::Math::TIntPoint< InIntType >::DivideAndRoundUp ( TIntPoint< InIntType > lhs,
IntType Divisor )
inlinestatic

Divide an int point and round up the result.

Parameters
lhsThe int point being divided.
DivisorWhat to divide the int point by.
Returns
A new divided int point.
See also
DivideAndRoundDown

Definition at line 416 of file IntPoint.h.

◆ DivideAndRoundUp() [2/2]

template<typename InIntType >
static TIntPoint UE::Math::TIntPoint< InIntType >::DivideAndRoundUp ( TIntPoint< InIntType > lhs,
TIntPoint< InIntType > Divisor )
inlinestatic

Definition at line 421 of file IntPoint.h.

◆ GetMax()

template<typename InIntType >
IntType UE::Math::TIntPoint< InIntType >::GetMax ( ) const
inline

Get the larger of the point's two components.

Returns
The maximum component of the point.
See also
GetMin, Size, SizeSquared

Definition at line 358 of file IntPoint.h.

◆ GetMin()

template<typename InIntType >
IntType UE::Math::TIntPoint< InIntType >::GetMin ( ) const
inline

Get the smaller of the point's two components.

Returns
The minimum component of the point.
See also
GetMax, Size, SizeSquared

Definition at line 369 of file IntPoint.h.

◆ Num()

template<typename InIntType >
static int32 UE::Math::TIntPoint< InIntType >::Num ( )
inlinestatic

Get number of components point has.

Returns
number of components point has.

Definition at line 449 of file IntPoint.h.

◆ operator!=()

template<typename InIntType >
bool UE::Math::TIntPoint< InIntType >::operator!= ( const TIntPoint< InIntType > & Other) const
inline

Compare two points for inequality.

Parameters
OtherThe other int point being compared.
Returns
true if the points are not equal, false otherwise.

Definition at line 139 of file IntPoint.h.

◆ operator()() [1/2]

template<typename InIntType >
IntType & UE::Math::TIntPoint< InIntType >::operator() ( int32 PointIndex)
inline

Get specific component of a point.

Parameters
PointIndexIndex of point component
Returns
reference to component.

Definition at line 115 of file IntPoint.h.

◆ operator()() [2/2]

template<typename InIntType >
const IntType & UE::Math::TIntPoint< InIntType >::operator() ( int32 PointIndex) const
inline

Get specific component of a point.

Parameters
PointIndexIndex of point component.
Returns
const reference to component.

Definition at line 102 of file IntPoint.h.

◆ operator*() [1/2]

Get the result of multiplication on this point.

Parameters
OtherThe point to multiply with this point.
Returns
A new multiplied int point

Definition at line 292 of file IntPoint.h.

◆ operator*() [2/2]

Get the result of scaling on this point.

Parameters
ScaleWhat to multiply the point by.
Returns
A new scaled int point.

Definition at line 248 of file IntPoint.h.

◆ operator*=() [1/2]

Multiply another point component-wise from this point.

Parameters
OtherThe point to multiply with this point.
Returns
Reference to this point after multiplication.

Definition at line 192 of file IntPoint.h.

◆ operator*=() [2/2]

Scale this point.

Parameters
ScaleWhat to multiply the point by.
Returns
Reference to this point after multiplication.

Definition at line 150 of file IntPoint.h.

◆ operator+()

Get the result of addition on this point.

Parameters
OtherThe other point to add to this.
Returns
A new combined int point.

Definition at line 270 of file IntPoint.h.

◆ operator+=()

Add another point component-wise to this point.

Parameters
OtherThe point to add to this point.
Returns
Reference to this point after addition.

Definition at line 178 of file IntPoint.h.

◆ operator-()

Get the result of subtraction from this point.

Parameters
OtherThe other point to subtract from this.
Returns
A new subtracted int point.

Definition at line 281 of file IntPoint.h.

◆ operator-=()

Subtract another point component-wise from this point.

Parameters
OtherThe point to subtract from this point.
Returns
Reference to this point after subtraction.

Definition at line 206 of file IntPoint.h.

◆ operator/() [1/2]

Get the result of division on this point.

Parameters
OtherThe other point to subtract from this.
Returns
A new subtracted int point.

Definition at line 303 of file IntPoint.h.

◆ operator/() [2/2]

Get the result of division on this point.

Parameters
DivisorWhat to divide the point by.
Returns
A new divided int point.

Definition at line 259 of file IntPoint.h.

◆ operator/=() [1/2]

Divide this point component-wise by another point.

Parameters
OtherThe point to divide with.
Returns
Reference to this point after division.

Definition at line 220 of file IntPoint.h.

◆ operator/=() [2/2]

Divide this point by a scalar.

Parameters
DivisorWhat to divide the point by.
Returns
Reference to this point after division.

Definition at line 164 of file IntPoint.h.

◆ operator=()

Assign another point to this one.

Parameters
OtherThe point to assign this point from.
Returns
Reference to this point after assignment.

Definition at line 234 of file IntPoint.h.

◆ operator==()

Compare two points for equality.

Parameters
OtherThe other int point being compared.
Returns
true if the points are equal, false otherwise.

Definition at line 128 of file IntPoint.h.

◆ operator[]() [1/2]

Get specific component of the point.

Parameters
Indexthe index of point component
Returns
reference to component.

Definition at line 314 of file IntPoint.h.

◆ operator[]() [2/2]

Get specific component of the point.

Parameters
Indexthe index of point component
Returns
copy of component value.

Definition at line 326 of file IntPoint.h.

◆ Serialize()

template<typename InIntType >
bool UE::Math::TIntPoint< InIntType >::Serialize ( FArchive & Ar)
inline

Serialize the point.

Parameters
ArThe archive to serialize into.
Returns
true on success, false otherwise.

Definition at line 484 of file IntPoint.h.

◆ SerializeFromMismatchedTag()

bool FUint64Point::SerializeFromMismatchedTag ( FName StructTag,
FArchive & Ar )
inline

Definition at line 569 of file IntPoint.h.

◆ Size()

template<typename InIntType >
IntType UE::Math::TIntPoint< InIntType >::Size ( ) const
inline

Get the distance of this point from (0,0).

Returns
The distance of this point from (0,0).
See also
GetMax, GetMin, SizeSquared

Definition at line 380 of file IntPoint.h.

◆ SizeSquared()

template<typename InIntType >
IntType UE::Math::TIntPoint< InIntType >::SizeSquared ( ) const
inline

Get the squared distance of this point from (0,0).

Returns
The squared distance of this point from (0,0).
See also
GetMax, GetMin, Size

Definition at line 393 of file IntPoint.h.

◆ ToString() [1/9]

template<typename InIntType >
FString UE::Math::TIntPoint< InIntType >::ToString ( ) const
inline

Get a textual representation of this point.

Returns
A string describing the point.

Definition at line 403 of file IntPoint.h.

◆ ToString() [2/9]

FString UE::Math::TIntPoint< int64 >::ToString ( ) const
inline

Definition at line 506 of file IntPoint.h.

◆ ToString() [3/9]

FString UE::Math::TIntPoint< int32 >::ToString ( ) const
inline

Definition at line 512 of file IntPoint.h.

◆ ToString() [4/9]

FString UE::Math::TIntPoint< int16 >::ToString ( ) const
inline

Definition at line 518 of file IntPoint.h.

◆ ToString() [5/9]

FString UE::Math::TIntPoint< int8 >::ToString ( ) const
inline

Definition at line 524 of file IntPoint.h.

◆ ToString() [6/9]

FString UE::Math::TIntPoint< uint64 >::ToString ( ) const
inline

Definition at line 530 of file IntPoint.h.

◆ ToString() [7/9]

FString UE::Math::TIntPoint< uint32 >::ToString ( ) const
inline

Definition at line 536 of file IntPoint.h.

◆ ToString() [8/9]

FString UE::Math::TIntPoint< uint16 >::ToString ( ) const
inline

Definition at line 542 of file IntPoint.h.

◆ ToString() [9/9]

FString UE::Math::TIntPoint< uint8 >::ToString ( ) const
inline

Definition at line 548 of file IntPoint.h.

Friends And Related Symbol Documentation

◆ operator<< [1/2]

template<typename InIntType >
FArchive & operator<< ( FArchive & Ar,
TIntPoint< InIntType > & Point )
friend

Serialize the point.

Parameters
ArThe archive to serialize into.
PointThe point to serialize.
Returns
Reference to the Archive after serialization.

Definition at line 461 of file IntPoint.h.

◆ operator<< [2/2]

template<typename InIntType >
void operator<< ( FStructuredArchive::FSlot Slot,
TIntPoint< InIntType > & Point )
friend

Serialize the point.

Parameters
SlotThe structured archive slot to serialize into.
PointThe point to serialize.

Definition at line 472 of file IntPoint.h.

Member Data Documentation

◆ [union]

union { ... } UE::Math::TIntPoint< InIntType >

◆ NoneValue

template<typename IntType >
const TIntPoint< IntType > UE::Math::TIntPoint< IntType >::NoneValue
static

An integer point with INDEX_NONE values.

Definition at line 46 of file IntPoint.h.

◆ X

Holds the point's x-coordinate.

Definition at line 32 of file IntPoint.h.

◆ XY

Definition at line 39 of file IntPoint.h.

◆ Y

Holds the point's y-coordinate.

Definition at line 35 of file IntPoint.h.

◆ ZeroValue

template<typename IntType >
const TIntPoint< IntType > UE::Math::TIntPoint< IntType >::ZeroValue
static

An integer point with zeroed values.

Definition at line 43 of file IntPoint.h.


The documentation for this struct was generated from the following files: