Skip to content

Commit 73e0ca4

Browse files
committed
Update
1 parent 9e1303e commit 73e0ca4

65 files changed

Lines changed: 299 additions & 177 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Content/Demo-Map.umap

-2 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

Plugins/PCGExtendedToolkit/Source/PCGExtendedToolkit/Private/Data/PCGExDataState.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ namespace PCGExDataState
148148
void TStatesManager::WriteStateNames(const FName AttributeName, const FName DefaultValue, const TArray<int32>& InIndices)
149149
{
150150
PCGEx::TFAttributeWriter<FName>* StateNameWriter = new PCGEx::TFAttributeWriter<FName>(AttributeName, DefaultValue, false);
151-
StateNameWriter->BindAndGet(const_cast<PCGExData::FPointIO&>(*PointIO));
151+
StateNameWriter->BindAndSetNumUninitialized(const_cast<PCGExData::FPointIO&>(*PointIO));
152152

153153
for (const int32 i : InIndices)
154154
{
@@ -167,7 +167,7 @@ namespace PCGExDataState
167167
void TStatesManager::WriteStateValues(const FName AttributeName, const int32 DefaultValue, const TArray<int32>& InIndices)
168168
{
169169
PCGEx::TFAttributeWriter<int32>* StateValueWriter = new PCGEx::TFAttributeWriter<int32>(AttributeName, DefaultValue, false);
170-
StateValueWriter->BindAndGet(const_cast<PCGExData::FPointIO&>(*PointIO));
170+
StateValueWriter->BindAndSetNumUninitialized(const_cast<PCGExData::FPointIO&>(*PointIO));
171171

172172
for (const int32 i : InIndices)
173173
{
@@ -257,7 +257,7 @@ namespace PCGExDataStateTask
257257
TRACE_CPUPROFILER_EVENT_SCOPE(FWriteIndividualState::ExecuteTask);
258258

259259
PCGEx::TFAttributeWriter<bool>* StateWriter = new PCGEx::TFAttributeWriter<bool>(static_cast<const UPCGExDataStateFactoryBase*>(Handler->Factory)->StateName);
260-
StateWriter->BindAndGet(*PointIO);
260+
StateWriter->BindAndSetNumUninitialized(*PointIO);
261261

262262
for (const int32 i : (*InIndices)) { StateWriter->Values[i] = Handler->Results[i]; }
263263
StateWriter->Write();

Plugins/PCGExtendedToolkit/Source/PCGExtendedToolkit/Private/Graph/Edges/PCGExBridgeEdgeClusters.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ void FPCGExBridgeEdgeClustersContext::BumpEdgeNum(const FPCGPoint& A, const FPCG
2121
{
2222
FWriteScopeLock WriteScopeLock(NumEdgeLock);
2323

24-
FPCGMetadataAttribute<int32>* EdgeNumAtt = static_cast<FPCGMetadataAttribute<int32>*>(CurrentIO->GetOut()->Metadata->GetMutableAttribute(PCGExGraph::Tag_EdgesNum));
24+
FPCGMetadataAttribute<int64>* VtxEndpointAtt = static_cast<FPCGMetadataAttribute<int64>*>(GetCurrentOut()->Metadata->GetMutableAttribute(PCGExGraph::Tag_VtxEndpoint));
2525

26-
EdgeNumAtt->SetValue(A.MetadataEntry, EdgeNumAtt->GetValueFromItemKey(A.MetadataEntry) + 1);
27-
EdgeNumAtt->SetValue(B.MetadataEntry, EdgeNumAtt->GetValueFromItemKey(B.MetadataEntry) + 1);
26+
const uint32 NumA = PCGEx::H64B(VtxEndpointAtt->GetValueFromItemKey(A.MetadataEntry)) + 1;
27+
const uint32 NumB = PCGEx::H64B(VtxEndpointAtt->GetValueFromItemKey(B.MetadataEntry)) + 1;
28+
29+
VtxEndpointAtt->SetValue(A.MetadataEntry, PCGEx::H64(PCGExGraph::HCID(A.MetadataEntry), NumA));
30+
VtxEndpointAtt->SetValue(B.MetadataEntry, PCGEx::H64(PCGExGraph::HCID(B.MetadataEntry), NumB));
2831
}
2932

3033
PCGEX_INITIALIZE_ELEMENT(BridgeEdgeClusters)
@@ -113,7 +116,7 @@ bool FPCGExBridgeEdgeClustersElement::ExecuteInternal(
113116
EdgeIO->CreateInKeys();
114117
Context->GetAsyncManager()->Start<PCGExClusterTask::FBuildCluster>(
115118
-1, Context->CurrentIO,
116-
NewCluster, EdgeIO, &Context->EndpointsLookup, &Context->EdgeNumReader->Values);
119+
NewCluster, EdgeIO, &Context->EndpointsLookup, &Context->EndpointsAdjacency);
117120
}
118121

119122
Context->SetAsyncState(PCGExGraph::State_BuildingClusters);
@@ -328,10 +331,7 @@ bool FPCGExCreateBridgeTask::ExecuteTask()
328331
}
329332

330333
UPCGMetadata* EdgeMetadata = Context->ConsolidatedEdges->GetOut()->Metadata;
331-
UPCGMetadata* PointMetadata = Context->CurrentIO->GetOut()->Metadata;
332-
333-
FPCGMetadataAttribute<int64>* EndpointAtt = static_cast<FPCGMetadataAttribute<int64>*>(EdgeMetadata->GetMutableAttribute(PCGExGraph::Tag_EdgeEndpoints));
334-
const FPCGMetadataAttribute<int64>* EdgeIndexAtt = static_cast<FPCGMetadataAttribute<int64>*>(PointMetadata->GetMutableAttribute(PCGExGraph::Tag_EdgeIndex));
334+
FPCGMetadataAttribute<int64>* EdgeEndpointsAtt = static_cast<FPCGMetadataAttribute<int64>*>(EdgeMetadata->GetMutableAttribute(PCGExGraph::Tag_EdgeEndpoints));
335335

336336
FPCGPoint& EdgePoint = PointIO->GetOut()->GetMutablePoints()[TaskIndex];
337337

@@ -341,8 +341,7 @@ bool FPCGExCreateBridgeTask::ExecuteTask()
341341
EdgePoint.Transform.SetLocation(FMath::Lerp(StartPoint.Transform.GetLocation(), EndPoint.Transform.GetLocation(), 0.5));
342342

343343
Context->BumpEdgeNum(StartPoint, EndPoint);
344-
345-
EndpointAtt->SetValue(EdgePoint.MetadataEntry, EdgeIndexAtt->GetValueFromItemKey(EndPoint.MetadataEntry));
344+
EdgeEndpointsAtt->SetValue(EdgePoint.MetadataEntry, PCGExGraph::HCID(StartPoint.MetadataEntry, EndPoint.MetadataEntry));
346345

347346
return true;
348347
}

Plugins/PCGExtendedToolkit/Source/PCGExtendedToolkit/Private/Graph/Edges/PCGExPromoteEdges.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ bool FPCGExPromoteEdgesElement::ExecuteInternal(
160160

161161

162162
UPCGPointData* OutData = NewObject<UPCGPointData>();
163-
OutData->InitializeFromData(Context->CurrentIO->GetIn());
163+
OutData->InitializeFromData(Context->GetCurrentIn());
164164

165165
if (bool bSuccess = Context->Promotion->PromoteEdgeGen(
166166
OutData,
@@ -193,7 +193,7 @@ bool FPCGExPromoteEdgesElement::ExecuteInternal(
193193

194194
if (!Context->Promotion->GeneratesNewPointData())
195195
{
196-
Context->OutputPoints();
196+
Context->OutputMainPoints();
197197
}
198198

199199
Context->ExecutionComplete();

Plugins/PCGExtendedToolkit/Source/PCGExtendedToolkit/Private/Graph/Edges/PCGExPruneEdgesByLength.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ bool FPCGExPruneEdgesByLengthElement::ExecuteInternal(FPCGContext* InContext) co
7979

8080
BuildIndexedEdges(*Context->CurrentEdges, Context->EndpointsLookup, Context->IndexedEdges);
8181

82-
const TArray<FPCGPoint>& InNodePoints = Context->CurrentIO->GetIn()->GetPoints();
82+
const TArray<FPCGPoint>& InNodePoints = Context->GetCurrentIn()->GetPoints();
8383

8484
Context->EdgeLength.SetNum(Context->IndexedEdges.Num());
8585

Plugins/PCGExtendedToolkit/Source/PCGExtendedToolkit/Private/Graph/Edges/PCGExRefineEdges.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ bool FPCGExRefineEdgesElement::ExecuteInternal(
137137

138138
if (Context->IsDone())
139139
{
140-
Context->OutputPoints();
140+
Context->OutputMainPoints();
141141
Context->ExecutionComplete();
142142
}
143143

Plugins/PCGExtendedToolkit/Source/PCGExtendedToolkit/Private/Graph/Edges/PCGExRelaxEdgeClusters.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ bool FPCGExRelaxEdgeClustersElement::ExecuteInternal(FPCGContext* InContext) con
8686
}
8787
else { Context->InfluenceGetter->bEnabled = false; }
8888

89-
const TArray<FPCGPoint>& InPoints = Context->CurrentIO->GetIn()->GetPoints();
89+
const TArray<FPCGPoint>& InPoints = Context->GetCurrentIn()->GetPoints();
9090
const int32 NumPoints = InPoints.Num();
9191
Context->OriginalBuffer.SetNumUninitialized(NumPoints);
9292
Context->PrimaryBuffer.SetNumUninitialized(NumPoints);

Plugins/PCGExtendedToolkit/Source/PCGExtendedToolkit/Private/Graph/PCGExBuildConvexHull.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ bool FPCGExBuildConvexHullElement::ExecuteInternal(
104104
if (Settings->bMarkHull && !Settings->bPrunePoints)
105105
{
106106
PCGEx::TFAttributeWriter<bool>* HullMarkPointWriter = new PCGEx::TFAttributeWriter<bool>(Settings->HullAttributeName, false, false);
107-
HullMarkPointWriter->BindAndGet(*Context->CurrentIO);
107+
HullMarkPointWriter->BindAndSetNumUninitialized(*Context->CurrentIO);
108108

109109
for (int i = 0; i < Context->CurrentIO->GetNum(); i++) { HullMarkPointWriter->Values[i] = Context->HullIndices.Contains(i); }
110110

@@ -119,7 +119,7 @@ bool FPCGExBuildConvexHullElement::ExecuteInternal(
119119

120120
if (Context->IsDone())
121121
{
122-
Context->OutputPoints();
122+
Context->OutputMainPoints();
123123
Context->ExecutionComplete();
124124
}
125125

Plugins/PCGExtendedToolkit/Source/PCGExtendedToolkit/Private/Graph/PCGExBuildConvexHull2D.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ bool FPCGExBuildConvexHull2DElement::ExecuteInternal(
115115
if (Settings->bMarkHull && !Settings->bPrunePoints)
116116
{
117117
PCGEx::TFAttributeWriter<bool>* HullMarkPointWriter = new PCGEx::TFAttributeWriter<bool>(Settings->HullAttributeName, false, false);
118-
HullMarkPointWriter->BindAndGet(*Context->CurrentIO);
118+
HullMarkPointWriter->BindAndSetNumUninitialized(*Context->CurrentIO);
119119

120120
for (int i = 0; i < Context->CurrentIO->GetNum(); i++) { HullMarkPointWriter->Values[i] = Context->HullIndices.Contains(i); }
121121

@@ -131,7 +131,7 @@ bool FPCGExBuildConvexHull2DElement::ExecuteInternal(
131131

132132
if (Context->IsDone())
133133
{
134-
Context->OutputPoints(Settings->bPrunePoints);
134+
Context->OutputMainPoints(Settings->bPrunePoints);
135135
Context->PathsIO->OutputTo(Context);
136136
Context->ExecutionComplete();
137137
}
@@ -196,7 +196,7 @@ bool FPCGExConvexHull2Task::ExecuteTask()
196196
PCGExGeo::TDelaunay2* Delaunay = new PCGExGeo::TDelaunay2();
197197

198198
TArray<FVector> Positions;
199-
PCGExGeo::PointsToPositions(Context->CurrentIO->GetIn()->GetPoints(), Positions);
199+
PCGExGeo::PointsToPositions(Context->GetCurrentIn()->GetPoints(), Positions);
200200

201201
const TArrayView<FVector> View = MakeArrayView(Positions);
202202
if (!Delaunay->Process(View, Context->ProjectionSettings))

0 commit comments

Comments
 (0)