Navigation
API > API/Plugins > API/Plugins/ModelingComponents > API/Plugins/ModelingComponents/Mechanics > API/Plugins/ModelingComponents/Mechanics/UCurveControlPointsMechanic
References
| Module | ModelingComponents |
| Header | /Engine/Plugins/Runtime/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
| Type | Name | Description | |
|---|---|---|---|
| TMap< int32, int32 > | PointIDToSequencePosition | ||
| TArray< int32 > | Sequence | ||
| TSparseArray< FVector3d > | Vertices |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FOrderedPoints
(
const FOrderedPoints& ToCopy |
|||
FOrderedPoints
(
const TArray< FVector3d >& PointSequence |
Functions
| Type | Name | Description | |
|---|---|---|---|
| int32 | AppendPoint
(
const FVector3d& PointCoordinates |
Appends a point with the given coordinates to the end of the sequence. | |
| void | Empty () |
Delete all points in the sequence. | |
| int32 | First () |
||
| FVector3d | GetPointCoordinates
(
int32 PointID |
||
| FVector3d | GetPointCoordinatesAt
(
int32 SequencePosition |
||
| int32 | GetPointIDAt
(
int32 SequencePosition |
||
| int32 | GetSequencePosition
(
int32 PointID |
||
| int32 | InsertPointAt
(
int32 SequencePosition, |
Inserts a point with the given coordinates at the given position in the sequence. | |
| bool | IsValidPoint
(
int32 PointID |
Checks whether given point ID exists in the sequence. | |
| int32 | Last () |
||
| int32 | Num () |
||
| PointIDEnumerable | 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. | |
| void | ReInitialize
(
const TArray< FVector3d >& PointSequence |
||
| int32 | RemovePointAt
(
int32 SequencePosition |
Removes the point at a particular position in the sequence. | |
| void | SetPointCoordinates
(
int32 PointID, |
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. |