Files
UnrealEngineUWP/Engine/Plugins/Runtime/GeometryProcessing/Source/DynamicMesh/Public/Operations/MeshAttributeTransfer.h
michael balzer ba195473cd GeometryProcessing: Move plugin from Experimental to Runtime
#jira UETOOL-3823
#rb ryan.schmidt

#ROBOMERGE-SOURCE: CL 16958628 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)

[CL 16958640 by michael balzer in ue5-release-engine-test branch]
2021-07-26 14:07:13 -04:00

68 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "MathUtil.h"
#include "VectorTypes.h"
#include "DynamicMesh/DynamicMeshAABBTree3.h"
namespace UE
{
namespace Geometry
{
class FDynamicMesh3;
enum class EMeshAttributeTransferType
{
MaterialID
};
enum class EMeshAttributeTransferError
{
InvalidSource,
InvalidTarget,
SourceMissingAttribute,
TargetMissingAttribute,
InvalidOperationForInputs
};
/**
* FMeshAttributeTransfer transfers attributes from a SourceMesh to a TargetMesh
*/
class DYNAMICMESH_API FMeshAttributeTransfer
{
public:
/** The mesh that we are transferring from */
const FDynamicMesh3* SourceMesh;
/** The mesh that we are transferring to */
FDynamicMesh3* TargetMesh;
/** What is being transferred */
EMeshAttributeTransferType TransferType = EMeshAttributeTransferType::MaterialID;
TArray<EMeshAttributeTransferError> Errors;
public:
FMeshAttributeTransfer(const FDynamicMesh3* SourceMeshIn, FDynamicMesh3* TargetMeshIn);
virtual ~FMeshAttributeTransfer() {}
/**
* Run the operation and modify .Mesh
* @return true if the algorithm succeeds
*/
virtual bool Apply();
protected:
TUniquePtr<FDynamicMeshAABBTree3> SourceSpatial;
bool Apply_MaterialID();
};
} // end namespace UE::Geometry
} // end namespace UE