Navigation
API > API/Plugins > API/Plugins/PCG
TPCGValueRange is used to represent a list of InNumElements values but those values are provided by an underlying TStridedView which can have a different number of values.
Most common use case is where we have N Points, a TPCGValueRange might be used to iterate through all the Point Colors.
For UPCGPointData, all Points have a memory allocation representing those Colors so the PCGValueRange number of elements will match the underlying TStridedView number of elements
but if we have another type of Point data which doesn't allocate Colors by default and just uses a single value, We can still use a TPCGValueRange with the same number of elements with an underlying TStridedView with a single element.
This allows us to write processing functions that operate on ranges without knowledge of the underlying memory layout
The range index will be modulated against the underlying TStridedView num elements.
ex:
Range with 5 Elements & StridedView of 1 Element Range Indices [0, 1, 2, 3 ,4] StridedView Indices [0, 0, 0, 0, 0]
Range with 5 Elements & StridedView of 3 Element(s) Range Indices [0, 1, 2, 3, 4] StridedView Indices [0, 1, 2, 0, 1]
Range with 5 Elements & StridedView of 5 Elements(s) or more Range Indices [0, 1, 2, 3, 4] StridedView Indices [0, 1, 2, 3, 4]
Note: For multithreaded usage it is preferred to declare the ranges in each thread so that the 'StubValue' is thread local
| Name | TPCGValueRange |
| Type | class |
| Header File | /Engine/Plugins/PCG/Source/PCG/Public/Utils/PCGValueRange.h |
| Include Path | #include "Utils/PCGValueRange.h" |
Syntax
template<typename ElementType, typename ViewType>
class TPCGValueRange
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Utils/PCGValueRange.h | |||
TPCGValueRange
(
ViewType InElementView |
Utils/PCGValueRange.h | ||
TPCGValueRange
(
ViewType InElementView, |
Utils/PCGValueRange.h |
Structs
| Name | Remarks |
|---|---|
| FIterator |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| NonConstElementType | std::remove_const_t< ElementType > | Utils/PCGValueRange.h | |
| SizeType | typename ViewType::SizeType | Utils/PCGValueRange.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ElementView | ViewType | Utils/PCGValueRange.h | ||
| NumElements | SizeType | Utils/PCGValueRange.h | ||
| PCGValueRangeHelpers | friend | Utils/PCGValueRange.h | ||
| StubValue | NonConstElementType | Utils/PCGValueRange.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FIterator begin() |
Utils/PCGValueRange.h | ||
FIterator end() |
Utils/PCGValueRange.h | ||
TOptional< ElementType > GetSingleValue() |
Utils/PCGValueRange.h | ||
bool IsEmpty() |
Utils/PCGValueRange.h | ||
bool IsValidIndex
(
SizeType Index |
Utils/PCGValueRange.h | ||
SizeType Num() |
Utils/PCGValueRange.h | ||
void Set
(
const ElementType& Value |
Utils/PCGValueRange.h | ||
SizeType ViewNum() |
Utils/PCGValueRange.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ElementType & operator[]
(
SizeType Index |
Utils/PCGValueRange.h |