You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Before: 3648 unity files Total CPU Time: 47886.140625 s Total time in Parallel executor: 498.81 seconds After: 3548 unity files Total CPU Time: 46643.828125 s Total time in Parallel executor: 486.06 seconds #jira #preflight [CL 22173263 by marc audy in ue5-main branch]
98 lines
2.1 KiB
C++
98 lines
2.1 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "SelectionSet.h"
|
|
|
|
#include UE_INLINE_GENERATED_CPP_BY_NAME(SelectionSet)
|
|
|
|
|
|
UMeshSelectionSet::UMeshSelectionSet()
|
|
{
|
|
//SetFlags(RF_Transactional);
|
|
}
|
|
|
|
|
|
TArray<int>& UMeshSelectionSet::GetElements(EMeshSelectionElementType ElementType)
|
|
{
|
|
switch (ElementType)
|
|
{
|
|
default:
|
|
case EMeshSelectionElementType::Vertex:
|
|
return Vertices;
|
|
case EMeshSelectionElementType::Edge:
|
|
return Edges;
|
|
case EMeshSelectionElementType::Face:
|
|
return Faces;
|
|
case EMeshSelectionElementType::Group:
|
|
return Groups;
|
|
}
|
|
check(false);
|
|
}
|
|
|
|
const TArray<int>& UMeshSelectionSet::GetElements(EMeshSelectionElementType ElementType) const
|
|
{
|
|
switch (ElementType)
|
|
{
|
|
default:
|
|
case EMeshSelectionElementType::Vertex:
|
|
return Vertices;
|
|
case EMeshSelectionElementType::Edge:
|
|
return Edges;
|
|
case EMeshSelectionElementType::Face:
|
|
return Faces;
|
|
case EMeshSelectionElementType::Group:
|
|
return Groups;
|
|
}
|
|
check(false);
|
|
}
|
|
|
|
|
|
|
|
void UMeshSelectionSet::AddIndices(EMeshSelectionElementType ElementType, const TArray<int32>& Indices)
|
|
{
|
|
TArray<int32>& CurElements = GetElements(ElementType);
|
|
|
|
int N = Indices.Num();
|
|
for (int k = 0; k < N; ++k)
|
|
{
|
|
CurElements.Add(Indices[k]);
|
|
}
|
|
NotifySelectionSetModified();
|
|
}
|
|
|
|
void UMeshSelectionSet::AddIndices(EMeshSelectionElementType ElementType, const TSet<int32>& Indices)
|
|
{
|
|
TArray<int>& CurElements = GetElements(ElementType);
|
|
|
|
for ( int32 Index : Indices )
|
|
{
|
|
CurElements.Add(Index);
|
|
}
|
|
NotifySelectionSetModified();
|
|
}
|
|
|
|
|
|
void UMeshSelectionSet::RemoveIndices(EMeshSelectionElementType ElementType, const TArray<int32>& Indices)
|
|
{
|
|
TSet<int32> IndicesSet(Indices);
|
|
RemoveIndices(ElementType, IndicesSet);
|
|
}
|
|
|
|
|
|
void UMeshSelectionSet::RemoveIndices(EMeshSelectionElementType ElementType, const TSet<int32>& Indices)
|
|
{
|
|
TArray<int32>& CurElements = GetElements(ElementType);
|
|
|
|
TArray<int32> NewElements;
|
|
NewElements.Reserve(FMath::Max(0, CurElements.Num() - Indices.Num()));
|
|
for (int32 Index : CurElements)
|
|
{
|
|
if (Indices.Contains(Index) == false)
|
|
{
|
|
NewElements.Add(Index);
|
|
}
|
|
}
|
|
CurElements = MoveTemp(NewElements);
|
|
|
|
NotifySelectionSetModified();
|
|
}
|