UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::TGeneralPolygon2< T > Class Template Reference

#include <GeneralPolygon2.h>

Public Member Functions

 TGeneralPolygon2 ()
 
 TGeneralPolygon2 (const TPolygon2< T > &ToSetOuter)
 
void SetOuter (const TPolygon2< T > &ToSetOuter)
 
void SetOuterWithOrientation (const TPolygon2< T > &ToSetOuter, bool bToSetOuterIsCW)
 
const TPolygon2< T > & GetOuter () const
 
const TArray< TPolygon2< T > > & GetHoles () const
 
bool AddHole (TPolygon2< T > Hole, bool bCheckContainment=true, bool bCheckOrientation=true)
 
void ClearHoles ()
 
bool HasHoles () const
 
void FilterHoles (TFunctionRef< bool(const TPolygon2< T > &)> RemoveHolePredicateFunc)
 
double SignedArea () const
 
double HoleUnsignedArea () const
 
double Perimeter () const
 
TAxisAlignedBox2< T > Bounds () const
 
void Translate (TVector2< T > translate)
 
void Scale (TVector2< T > scale, TVector2< T > origin)
 
void Transform (const TFunction< TVector2< T >(const TVector2< T > &)> &TransformFunc)
 
void Reverse ()
 
bool OuterIsClockwise () const
 
bool Contains (TVector2< T > vTest) const
 
bool Contains (TPolygon2< T > Poly) const
 
bool Intersects (TPolygon2< T > Poly) const
 
TVector2< T > GetSegmentPoint (int iSegment, double fSegT, int iHoleIndex=-1) const
 
TSegment2< T > Segment (int iSegment, int iHoleIndex=-1) const
 
TVector2< T > GetNormal (int iSegment, double segT, int iHoleIndex=-1) const
 
double DistanceSquared (TVector2< T > p, int &iHoleIndex, int &iNearSeg, double &fNearSegT) const
 
void Simplify (double ClusterTol=0.0001, double LineDeviationTol=0.01)
 
void VtxNormalOffset (T OffsetDistance, bool bUseFaceAvg=false)
 

Protected Attributes

TPolygon2< T > Outer
 
bool bOuterIsCW
 
TArray< TPolygon2< T > > Holes
 

Detailed Description

template<typename T>
class UE::Geometry::TGeneralPolygon2< T >

TGeneralPolygon2 is a 2D polygon with holes

Constructor & Destructor Documentation

◆ TGeneralPolygon2() [1/2]

template<typename T >
UE::Geometry::TGeneralPolygon2< T >::TGeneralPolygon2 ( )
inline

◆ TGeneralPolygon2() [2/2]

template<typename T >
UE::Geometry::TGeneralPolygon2< T >::TGeneralPolygon2 ( const TPolygon2< T > &  ToSetOuter)
inline

Construct a general polygon with the given polygon as boundary

Member Function Documentation

◆ AddHole()

template<typename T >
bool UE::Geometry::TGeneralPolygon2< T >::AddHole ( TPolygon2< T >  Hole,
bool  bCheckContainment = true,
bool  bCheckOrientation = true 
)
inline

◆ Bounds()

template<typename T >
TAxisAlignedBox2< T > UE::Geometry::TGeneralPolygon2< T >::Bounds ( ) const
inline

◆ ClearHoles()

template<typename T >
void UE::Geometry::TGeneralPolygon2< T >::ClearHoles ( )
inline

◆ Contains() [1/2]

template<typename T >
bool UE::Geometry::TGeneralPolygon2< T >::Contains ( TPolygon2< T >  Poly) const
inline

◆ Contains() [2/2]

template<typename T >
bool UE::Geometry::TGeneralPolygon2< T >::Contains ( TVector2< T >  vTest) const
inline

◆ DistanceSquared()

template<typename T >
double UE::Geometry::TGeneralPolygon2< T >::DistanceSquared ( TVector2< T >  p,
int &  iHoleIndex,
int &  iNearSeg,
double fNearSegT 
) const
inline

◆ FilterHoles()

template<typename T >
void UE::Geometry::TGeneralPolygon2< T >::FilterHoles ( TFunctionRef< bool(const TPolygon2< T > &)>  RemoveHolePredicateFunc)
inline

Remove any Hole polygons for which RemoveHolePredicateFunc(Hole) returns true

◆ GetHoles()

template<typename T >
const TArray< TPolygon2< T > > & UE::Geometry::TGeneralPolygon2< T >::GetHoles ( ) const
inline

◆ GetNormal()

template<typename T >
TVector2< T > UE::Geometry::TGeneralPolygon2< T >::GetNormal ( int  iSegment,
double  segT,
int  iHoleIndex = -1 
) const
inline

◆ GetOuter()

template<typename T >
const TPolygon2< T > & UE::Geometry::TGeneralPolygon2< T >::GetOuter ( ) const
inline

◆ GetSegmentPoint()

template<typename T >
TVector2< T > UE::Geometry::TGeneralPolygon2< T >::GetSegmentPoint ( int  iSegment,
double  fSegT,
int  iHoleIndex = -1 
) const
inline

◆ HasHoles()

template<typename T >
bool UE::Geometry::TGeneralPolygon2< T >::HasHoles ( ) const
inline

◆ HoleUnsignedArea()

template<typename T >
double UE::Geometry::TGeneralPolygon2< T >::HoleUnsignedArea ( ) const
inline

◆ Intersects()

template<typename T >
bool UE::Geometry::TGeneralPolygon2< T >::Intersects ( TPolygon2< T >  Poly) const
inline

◆ OuterIsClockwise()

template<typename T >
bool UE::Geometry::TGeneralPolygon2< T >::OuterIsClockwise ( ) const
inline

◆ Perimeter()

template<typename T >
double UE::Geometry::TGeneralPolygon2< T >::Perimeter ( ) const
inline

◆ Reverse()

template<typename T >
void UE::Geometry::TGeneralPolygon2< T >::Reverse ( )
inline

◆ Scale()

template<typename T >
void UE::Geometry::TGeneralPolygon2< T >::Scale ( TVector2< T >  scale,
TVector2< T >  origin 
)
inline

◆ Segment()

template<typename T >
TSegment2< T > UE::Geometry::TGeneralPolygon2< T >::Segment ( int  iSegment,
int  iHoleIndex = -1 
) const
inline

◆ SetOuter()

template<typename T >
void UE::Geometry::TGeneralPolygon2< T >::SetOuter ( const TPolygon2< T > &  ToSetOuter)
inline

◆ SetOuterWithOrientation()

template<typename T >
void UE::Geometry::TGeneralPolygon2< T >::SetOuterWithOrientation ( const TPolygon2< T > &  ToSetOuter,
bool  bToSetOuterIsCW 
)
inline

◆ SignedArea()

template<typename T >
double UE::Geometry::TGeneralPolygon2< T >::SignedArea ( ) const
inline

◆ Simplify()

template<typename T >
void UE::Geometry::TGeneralPolygon2< T >::Simplify ( double  ClusterTol = 0.0001,
double  LineDeviationTol = 0.01 
)
inline

◆ Transform()

template<typename T >
void UE::Geometry::TGeneralPolygon2< T >::Transform ( const TFunction< TVector2< T >(const TVector2< T > &)> &  TransformFunc)
inline

◆ Translate()

template<typename T >
void UE::Geometry::TGeneralPolygon2< T >::Translate ( TVector2< T >  translate)
inline

◆ VtxNormalOffset()

template<typename T >
void UE::Geometry::TGeneralPolygon2< T >::VtxNormalOffset ( OffsetDistance,
bool  bUseFaceAvg = false 
)
inline

Offset each polygon by the given Distance along vertex "normal" direction (ie for positive offset, outer polygon grows and holes shrink)

Parameters
OffsetDistancethe distance to offset
bUseFaceAvgif true, we offset by the average-face normal instead of the perpendicular-tangent normal

Member Data Documentation

◆ bOuterIsCW

template<typename T >
bool UE::Geometry::TGeneralPolygon2< T >::bOuterIsCW
protected

◆ Holes

template<typename T >
TArray<TPolygon2<T> > UE::Geometry::TGeneralPolygon2< T >::Holes
protected

The list of Holes in the polygon

◆ Outer

template<typename T >
TPolygon2<T> UE::Geometry::TGeneralPolygon2< T >::Outer
protected

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