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

#include <Polyline.h>

Classes

class  SegmentEnumerable
 
class  SegmentIterator
 

Public Member Functions

 TPolyline ()
 
 TPolyline (const TArray< VectorType > &VertexList)
 
 TPolyline (const VectorType &Point0, const VectorType &Point1)
 
const VectorTypeoperator[] (int Index) const
 
VectorTypeoperator[] (int Index)
 
const VectorTypeStart () const
 
const VectorTypeEnd () const
 
const TArray< VectorType > & GetVertices () const
 
int VertexCount () const
 
int SegmentCount () const
 
void Clear ()
 
void AppendVertex (const VectorType &Position)
 
void AppendVertices (const TArray< VectorType > &NewVertices)
 
template<typename OtherVectorType >
void AppendVertices (const TArray< OtherVectorType > &NewVertices)
 
void Set (int VertexIndex, const VectorType &Position)
 
void RemoveVertex (int VertexIndex)
 
void SetVertices (const TArray< VectorType > &NewVertices)
 
void Reverse ()
 
VectorType GetTangent (int VertexIndex) const
 
SegmentType GetSegment (int SegmentIndex) const
 
VectorType GetSegmentPoint (int SegmentIndex, T SegmentParam) const
 
VectorType GetSegmentPointUnitParam (int SegmentIndex, T SegmentParam) const
 
BoxType GetBounds () const
 
Length () const
 
SegmentIterator SegmentItr () const
 
SegmentEnumerable Segments () const
 
DistanceSquared (const VectorType &QueryPoint, int &NearestSegIndexOut, T &NearestSegParamOut) const
 
DistanceSquared (const VectorType &QueryPoint) const
 
AverageEdgeLength () const
 
VectorType GetPointFromFirstVertex (const T InDistance) const
 
VectorType GetPointFromLastVertex (const T InDistance) const
 
void SmoothSubdivide (TPolyline< T, D > &NewPolyline) const
 
void Simplify (T ClusterTolerance, T LineDeviationTolerance)
 

Protected Types

typedef TPolylinePolicy< T, D >::VectorType VectorType
 
typedef TPolylinePolicy< T, D >::SegmentType SegmentType
 
typedef TPolylinePolicy< T, D >::BoxType BoxType
 

Protected Attributes

TArray< VectorTypeVertices
 

Friends

class SegmentIterator
 

Detailed Description

template<typename T, int D>
class UE::Geometry::TPolyline< T, D >

TPolyline represents a dimensional independent polyline stored as a list of Vertices.

Member Typedef Documentation

◆ BoxType

template<typename T , int D>
typedef TPolylinePolicy<T,D>::BoxType UE::Geometry::TPolyline< T, D >::BoxType
protected

◆ SegmentType

template<typename T , int D>
typedef TPolylinePolicy<T,D>::SegmentType UE::Geometry::TPolyline< T, D >::SegmentType
protected

◆ VectorType

template<typename T , int D>
typedef TPolylinePolicy<T,D>::VectorType UE::Geometry::TPolyline< T, D >::VectorType
protected

Constructor & Destructor Documentation

◆ TPolyline() [1/3]

template<typename T , int D>
UE::Geometry::TPolyline< T, D >::TPolyline ( )
inline

◆ TPolyline() [2/3]

template<typename T , int D>
UE::Geometry::TPolyline< T, D >::TPolyline ( const TArray< VectorType > &  VertexList)
inline

Construct polyline with given list of vertices

◆ TPolyline() [3/3]

template<typename T , int D>
UE::Geometry::TPolyline< T, D >::TPolyline ( const VectorType Point0,
const VectorType Point1 
)
inline

Construct a single-segment polyline

Member Function Documentation

◆ AppendVertex()

template<typename T , int D>
void UE::Geometry::TPolyline< T, D >::AppendVertex ( const VectorType Position)
inline

Add a vertex to the polyline

◆ AppendVertices() [1/2]

template<typename T , int D>
void UE::Geometry::TPolyline< T, D >::AppendVertices ( const TArray< OtherVectorType > &  NewVertices)
inline

Add a list of Vertices to the polyline

◆ AppendVertices() [2/2]

template<typename T , int D>
void UE::Geometry::TPolyline< T, D >::AppendVertices ( const TArray< VectorType > &  NewVertices)
inline

Add a list of Vertices to the polyline

◆ AverageEdgeLength()

template<typename T , int D>
T UE::Geometry::TPolyline< T, D >::AverageEdgeLength ( ) const
inline
Returns
average edge length of all the edges of the Polygon

◆ Clear()

template<typename T , int D>
void UE::Geometry::TPolyline< T, D >::Clear ( )
inline

Discard all vertices of polyline

◆ DistanceSquared() [1/2]

template<typename T , int D>
T UE::Geometry::TPolyline< T, D >::DistanceSquared ( const VectorType QueryPoint) const
inline

Calculate the squared distance from a point to the polyline

Parameters
QueryPointthe query point
Returns
squared distance to the polyline

◆ DistanceSquared() [2/2]

template<typename T , int D>
T UE::Geometry::TPolyline< T, D >::DistanceSquared ( const VectorType QueryPoint,
int &  NearestSegIndexOut,
T &  NearestSegParamOut 
) const
inline

Calculate the squared distance from a point to the polyline

Parameters
QueryPointthe query point
NearestSegIndexOutThe index of the nearest segment
NearestSegParamOutthe parameter value of the nearest point on the segment
Returns
squared distance to the polyline

◆ End()

template<typename T , int D>
const VectorType & UE::Geometry::TPolyline< T, D >::End ( ) const
inline
Returns
last vertex of polyline

◆ GetBounds()

template<typename T , int D>
BoxType UE::Geometry::TPolyline< T, D >::GetBounds ( ) const
inline
Returns
the bounding box of the polyline Vertices

◆ GetPointFromFirstVertex()

template<typename T , int D>
VectorType UE::Geometry::TPolyline< T, D >::GetPointFromFirstVertex ( const T  InDistance) const
inline

Compute a point on the polyline based on its distance from the first vertex

◆ GetPointFromLastVertex()

template<typename T , int D>
VectorType UE::Geometry::TPolyline< T, D >::GetPointFromLastVertex ( const T  InDistance) const
inline

Compute a point on the polyline based on its distance from the last vertex

◆ GetSegment()

template<typename T , int D>
SegmentType UE::Geometry::TPolyline< T, D >::GetSegment ( int  SegmentIndex) const
inline
Returns
edge of the polyline starting at vertex SegmentIndex

◆ GetSegmentPoint()

template<typename T , int D>
VectorType UE::Geometry::TPolyline< T, D >::GetSegmentPoint ( int  SegmentIndex,
SegmentParam 
) const
inline
Parameters
SegmentIndexindex of first vertex of the edge
SegmentParamparameter in range [-Extent,Extent] along segment
Returns
point on the segment at the given parameter value

◆ GetSegmentPointUnitParam()

template<typename T , int D>
VectorType UE::Geometry::TPolyline< T, D >::GetSegmentPointUnitParam ( int  SegmentIndex,
SegmentParam 
) const
inline
Parameters
SegmentIndexindex of first vertex of the edge
SegmentParamparameter in range [0,1] along segment
Returns
point on the segment at the given parameter value

◆ GetTangent()

template<typename T , int D>
VectorType UE::Geometry::TPolyline< T, D >::GetTangent ( int  VertexIndex) const
inline

Get the tangent vector at a vertex of the polyline, which is the normalized vector from the previous vertex to the next vertex

◆ GetVertices()

template<typename T , int D>
const TArray< VectorType > & UE::Geometry::TPolyline< T, D >::GetVertices ( ) const
inline
Returns
list of Vertices of polyline

◆ Length()

template<typename T , int D>
T UE::Geometry::TPolyline< T, D >::Length ( ) const
inline
Returns
the total perimeter length of the Polygon

◆ operator[]() [1/2]

template<typename T , int D>
VectorType & UE::Geometry::TPolyline< T, D >::operator[] ( int  Index)
inline

Get the vertex at a given index

◆ operator[]() [2/2]

template<typename T , int D>
const VectorType & UE::Geometry::TPolyline< T, D >::operator[] ( int  Index) const
inline

Get the vertex at a given index

◆ RemoveVertex()

template<typename T , int D>
void UE::Geometry::TPolyline< T, D >::RemoveVertex ( int  VertexIndex)
inline

Remove a vertex of the polyline (existing Vertices are shifted)

◆ Reverse()

template<typename T , int D>
void UE::Geometry::TPolyline< T, D >::Reverse ( )
inline

Reverse the order of the Vertices in the polyline (ie switch between Clockwise and CounterClockwise)

◆ SegmentCount()

template<typename T , int D>
int UE::Geometry::TPolyline< T, D >::SegmentCount ( ) const
inline
Returns
number of segments in polyline

◆ SegmentItr()

template<typename T , int D>
SegmentIterator UE::Geometry::TPolyline< T, D >::SegmentItr ( ) const
inline

◆ Segments()

template<typename T , int D>
SegmentEnumerable UE::Geometry::TPolyline< T, D >::Segments ( ) const
inline
Returns
an object that can be used in a range-based for loop to iterate over the Segments of the Polyline

◆ Set()

template<typename T , int D>
void UE::Geometry::TPolyline< T, D >::Set ( int  VertexIndex,
const VectorType Position 
)
inline

Set vertex at given index to a new Position

◆ SetVertices()

template<typename T , int D>
void UE::Geometry::TPolyline< T, D >::SetVertices ( const TArray< VectorType > &  NewVertices)
inline

Replace the list of Vertices with a new list

◆ Simplify()

template<typename T , int D>
void UE::Geometry::TPolyline< T, D >::Simplify ( ClusterTolerance,
LineDeviationTolerance 
)
inline

Simplify the Polyline to reduce the vertex count

Parameters
ClusterToleranceVertices closer than this distance will be merged into a single vertex
LineDeviationToleranceVertices are allowed to deviate this much from the polylines

◆ SmoothSubdivide()

template<typename T , int D>
void UE::Geometry::TPolyline< T, D >::SmoothSubdivide ( TPolyline< T, D > &  NewPolyline) const
inline

Produce a new polyline that is smoother than this one

◆ Start()

template<typename T , int D>
const VectorType & UE::Geometry::TPolyline< T, D >::Start ( ) const
inline
Returns
first vertex of polyline

◆ VertexCount()

template<typename T , int D>
int UE::Geometry::TPolyline< T, D >::VertexCount ( ) const
inline
Returns
number of Vertices in polyline

Friends And Related Symbol Documentation

◆ SegmentIterator

template<typename T , int D>
friend class SegmentIterator
friend

Member Data Documentation

◆ Vertices

template<typename T , int D>
TArray<VectorType> UE::Geometry::TPolyline< T, D >::Vertices
protected

The list of vertices of the polyline


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