You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb none #preflight 62d1c7222e3e5993c351a126 [CL 21117964 by Ryan Schmidt in ue5-main branch]
52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "Selections/GeometrySelection.h"
|
|
#include "DynamicMesh/DynamicMesh3.h"
|
|
|
|
using namespace UE::Geometry;
|
|
|
|
void FGeometrySelectionEditor::Initialize(FGeometrySelection* TargetSelectionIn)
|
|
{
|
|
check(TargetSelectionIn != nullptr);
|
|
TargetSelection = TargetSelectionIn;
|
|
}
|
|
|
|
void FGeometrySelectionEditor::ClearSelection(FGeometrySelectionDelta& DeltaOut)
|
|
{
|
|
for (uint64 ID : TargetSelection->Selection)
|
|
{
|
|
DeltaOut.Removed.Add(ID);
|
|
}
|
|
|
|
TargetSelection->Reset();
|
|
}
|
|
|
|
|
|
bool FGeometrySelectionEditor::IsSelected(uint64 ID) const
|
|
{
|
|
return TargetSelection->Selection.Contains(ID);
|
|
}
|
|
|
|
bool FGeometrySelectionEditor::Replace(const FGeometrySelection& NewSelection, FGeometrySelectionDelta& DeltaOut)
|
|
{
|
|
// currently hard-enforcing this...maybe we can allow switches?
|
|
if (ensure(TargetSelection->ElementType == NewSelection.ElementType) == false ||
|
|
ensure(TargetSelection->TopologyType == NewSelection.TopologyType) == false)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
for (uint64 ID : TargetSelection->Selection)
|
|
{
|
|
DeltaOut.Removed.Add(ID);
|
|
}
|
|
TargetSelection->Selection.Reset();
|
|
|
|
for (uint64 ID : NewSelection.Selection)
|
|
{
|
|
TargetSelection->Selection.Add(ID);
|
|
DeltaOut.Added.Add(ID);
|
|
}
|
|
|
|
return true;
|
|
} |