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 brooke.hubert #preflight 6109d1e9b4288d0001acb7ef [CL 17055606 by michael balzer in ue5-main branch]
59 lines
1.6 KiB
C++
59 lines
1.6 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
#include "MeshDescription.h"
|
|
#include "UObject/Interface.h"
|
|
|
|
#include "MeshDescriptionCommitter.generated.h"
|
|
|
|
UINTERFACE()
|
|
class INTERACTIVETOOLSFRAMEWORK_API UMeshDescriptionCommitter : public UInterface
|
|
{
|
|
GENERATED_BODY()
|
|
};
|
|
|
|
class INTERACTIVETOOLSFRAMEWORK_API IMeshDescriptionCommitter
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
|
|
struct FCommitterParams
|
|
{
|
|
/**
|
|
* Mesh description that should be populated/updated by the passed-in function and which
|
|
* will be committed to the target.
|
|
*/
|
|
FMeshDescription* MeshDescriptionOut = nullptr;
|
|
};
|
|
using FCommitter = TFunction<void(const FCommitterParams&)>;
|
|
|
|
/**
|
|
* Commit a mesh description. The mesh description to be committed will be passed to the
|
|
* given function as a parameter, and it is up to the function to update it properly.
|
|
*
|
|
* @param Committer A function that takes in const IMeshDescriptionCommitter::FCommitParams&
|
|
* and populates the FMeshDescription pointed to by the MeshDescription pointer inside.
|
|
*/
|
|
virtual void CommitMeshDescription(const FCommitter& Committer) = 0;
|
|
|
|
/**
|
|
* Commits the given FMeshDescription.
|
|
*/
|
|
virtual void CommitMeshDescription(const FMeshDescription& Mesh)
|
|
{
|
|
// It seems reasonable to have this function, but we'll go ahead and give a default implementation
|
|
// if users want to just implement the other one.
|
|
|
|
CommitMeshDescription([&Mesh](const FCommitterParams& CommitParams)
|
|
{
|
|
if (CommitParams.MeshDescriptionOut)
|
|
{
|
|
*CommitParams.MeshDescriptionOut = Mesh;
|
|
}
|
|
});
|
|
}
|
|
}; |