You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UETOOL-3823 #rb lonnie.li #preflight 617b1aea5794a500014f544a #ROBOMERGE-AUTHOR: michael.balzer #ROBOMERGE-SOURCE: CL 17972239 in //UE5/Release-5.0/... via CL 17972248 #ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v885-17909292) #ROBOMERGE[STARSHIP]: UE5-Main [CL 17972256 by michael balzer in ue5-release-engine-test branch]
70 lines
1.2 KiB
C++
70 lines
1.2 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "Changes/MeshSelectionChange.h"
|
|
|
|
|
|
void FMeshSelectionChange::Apply(UObject* Object)
|
|
{
|
|
UMeshSelectionSet* Selection = CastChecked<UMeshSelectionSet>(Object);
|
|
|
|
if (bAdded)
|
|
{
|
|
Selection->AddIndices(ElementType, Indices);
|
|
}
|
|
else
|
|
{
|
|
Selection->RemoveIndices(ElementType, Indices);
|
|
}
|
|
}
|
|
|
|
void FMeshSelectionChange::Revert(UObject* Object)
|
|
{
|
|
UMeshSelectionSet* Selection = CastChecked<UMeshSelectionSet>(Object);
|
|
|
|
if (bAdded)
|
|
{
|
|
Selection->RemoveIndices(ElementType, Indices);
|
|
}
|
|
else
|
|
{
|
|
Selection->AddIndices(ElementType, Indices);
|
|
}
|
|
}
|
|
|
|
|
|
FString FMeshSelectionChange::ToString() const
|
|
{
|
|
return FString(TEXT("Mesh Selection Change"));
|
|
}
|
|
|
|
|
|
|
|
|
|
FMeshSelectionChangeBuilder::FMeshSelectionChangeBuilder(EMeshSelectionElementType ElementType, bool bAdding)
|
|
{
|
|
Change = MakeUnique<FMeshSelectionChange>();
|
|
Change->ElementType = ElementType;
|
|
Change->bAdded = bAdding;
|
|
}
|
|
|
|
void FMeshSelectionChangeBuilder::Add(int32 ElementID)
|
|
{
|
|
Change->Indices.Add(ElementID);
|
|
}
|
|
|
|
|
|
|
|
void FMeshSelectionChangeBuilder::Add(const TArray<int32>& Elements)
|
|
{
|
|
Change->Indices.Append(Elements);
|
|
}
|
|
|
|
void FMeshSelectionChangeBuilder::Add(const TSet<int32>& Elements)
|
|
{
|
|
for (int32 Index : Elements)
|
|
{
|
|
Change->Indices.Add(Index);
|
|
}
|
|
}
|
|
|