FOrderedPoints

We want some way to store the control point sequence that lets us easily associate points with their renderable and hit-testable representations, since we need to alter all of these together as points get moved or added.

Windows
MacOS
Linux

References

Module

ModelingComponents

Header

/Engine/Plugins/Experimental/MeshModelingToolset/Source/ModelingComponents/Public/Mechanics/CurveControlPointsMechanic.h

Include

#include "Mechanics/CurveControlPointsMechanic.h"

Syntax

class FOrderedPoints

Remarks

We want some way to store the control point sequence that lets us easily associate points with their renderable and hit-testable representations, since we need to alter all of these together as points get moved or added. We use FOrderedPoints for this, until we decide on how we want to store sequences of points in general. FOrderedPoints maintains a sequence of point ID's, the positions associated with each ID, and a mapping back from ID to position. The ID's can then be used to match to renderable points, hit-testable points, and segments going to the next point. A sequence of 3-component vectors that can be used to represent a polyline in 3d space, or some other sequence of control points in 3d space.

The sequence is determined by a sequence of point IDs which can be used to look up the point coordinates.

Variables

Name Description

Protected variable

TMap< int32, in...

 

PointIDToSequencePosition

Protected variable

TArray< int32 >

 

Sequence

Protected variable

TSparseArray< F...

 

Vertices

Constructors

Name Description

Public function

FOrderedPoints()

Public function

FOrderedPoints

(
    const FOrderedPoints& ToCopy
)

Public function

FOrderedPoints

(
    const TArray< FVector3d >& PointSe...
)

Functions

Name Description

Public function

int32

 

AppendPoint

(
    const FVector3d& PointCoordinates
)

Appends a point with the given coordinates to the end of the sequence.

Public function

void

 

Empty()

Delete all points in the sequence.

Public function

int32

 

First()

Public function Const

FVector3d

 

GetPointCoordinates

(
    int32 PointID
)

Public function Const

FVector3d

 

GetPointCoordinatesAt

(
    int32 SequencePosition
)

Public function

int32

 

GetPointIDAt

(
    int32 SequencePosition
)

Public function

int32

 

GetSequencePosition

(
    int32 PointID
)

Public function

int32

 

InsertPointAt

(
    int32 SequencePosition,
    const FVector3d& PointCoordinates,
    const int32* KnownPointID
)

Inserts a point with the given coordinates at the given position in the sequence.

Public function Const

bool

 

IsValidPoint

(
    int32 PointID
)

Checks whether given point ID exists in the sequence.

Public function

int32

 

Last()

Public function

int32

 

Num()

Public function

PointIDEnume...

 

PointIDItr()

This function should only be used to iterate across the point id's in sequence in a range-based for-loop as in "for (int32 PointID : PointSequence->PointIDItr()) { ... }" The return type of this function is likely to change, but it will continue to work in range-based for-loops.

Protected function

void

 

ReInitialize

(
    const TArray< FVector3d >& PointSe...
)

Public function

int32

 

RemovePointAt

(
    int32 SequencePosition
)

Removes the point at a particular position in the sequence.

Public function

void

 

SetPointCoordinates

(
    int32 PointID,
    const FVector3d& NewCoordinates
)

Change the coordinates associated with a given point ID.

Typedefs

Name

Description

PointIDEnumerable

TODO: We should have a proper iterable to iterate over point ID's (and maybe one to iterate over point coordinates too. We're temporarily taking a shortcut by using the actual sequence array as our iterable, but only until we've decided on the specifics of the class.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss