Navigation
API > API/Plugins > API/Plugins/PCG > API/Plugins/PCG/FPCGDataTypeRegistry
Description
Returns the data type for the composition of all the identifiers passed as input. It will be simplified if possible (like composition of spline and landscape spline gives a polyline).
Goal: From a list of identifiers, aggregate all the types, and reduce types that are fully represent the parent type (i.e. if we compose DataB and DataC that are the only children of DataA, the composition should return DataA) Algorithm overview:
- Gather all the unique types
- Do a depth search in the hierarchy tree to look for our unique types
- When we find a type, we mark at which depth it is and add it to our list of nodes.
- Since it's Depth first, any type that we found that is at a greater depth that the one marked is a child, and can be discarded for the composition.
- At the moment we have a Depth greater or equal than the one marked, we are on another branch, and we reset our marked depth.
- When all of our types are found, we sort them by depth in descending order (deeper first), we need the descending order because we might merge 2 types that can be merged with something at a higher level of the hierarchy. (i.e. D and E are child of B, and B and C are child of A, combining C, D and E should give A.
- We iterate through our sorted list, and we look for all the other nodes that are on the same depth (potential siblings). We count all of them that share the same parent.
- If the number of siblings is equal to the number of children of the parent type, we can merge them all into the parent type.
- When the merge is done, we return the aggregation of the all the remaining types.
| Name | GetIdentifiersComposition |
| Type | function |
| Header File | /Engine/Plugins/PCG/Source/PCG/Public/Data/Registry/PCGDataTypeRegistry.h |
| Include Path | #include "Data/Registry/PCGDataTypeRegistry.h" |
| Source | /Engine/Plugins/PCG/Source/PCG/Private/Data/Registry/PCGDataTypeRegistry.cpp |
FPCGDataTypeIdentifier GetIdentifiersComposition
(
TConstArrayView< FPCGDataTypeIdentifier > Identifiers
) const