// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "FrameTrackingContourData.h" #define UE_API METAHUMANIDENTITY_API enum class EIdentityPoseType : uint8; enum class EIdentityPartMeshes : uint8; enum class ECurvePresetType : uint8 { Invalid = 0, Identity_NeutralPose, Identity_TeethPose, Performance }; /** persistent data for curves, loaded from json */ struct FMarkerCurveDef { FString Name; FString StartPointName; FString EndPointName; TArray VertexIDs; TArray DefaultScreenPoints; TArray GroupTagIDs; FString CurveMeshFromConfig; }; struct FMarkerDefs { TArray GroupNames; TArray CurveDefs; TMap Landmarks; TMap DefaultScreenPoints; TMap CurveMeshesForMarkers; }; class FLandmarkConfigIdentityHelper { public: UE_API FLandmarkConfigIdentityHelper(); UE_API ~FLandmarkConfigIdentityHelper(); /** Returns all the marker definitions as per config */ UE_API TSharedPtr GetMarkerDefs() const; UE_API TArray GetGroupListForSelectedPreset(const ECurvePresetType& InSelectedPose) const; /** Projects the 2D points based on 3D position of vertex IDs of the archetype mesh */ UE_API FFrameTrackingContourData ProjectPromotedFrameCurvesOnTemplateMesh(const struct FMinimalViewInfo& InViewInfo, const TMap>& InTemplateMeshVertices, const ECurvePresetType& InSelectedPreset, const FIntRect& InViewRect) const; /** Uses preset values for curves in the config */ UE_API FFrameTrackingContourData GetDefaultContourDataFromConfig(const FVector2D& InTexResolution, const ECurvePresetType& InSelectedPreset) const; /** Convert Identity Pose Type enum into a curve preset type */ UE_API ECurvePresetType GetCurvePresetFromIdentityPose(const EIdentityPoseType& InIdentityPoseType) const; private: UE_API void GetProjectedScreenCoordinates(const TArray& InWorldPositions, const struct FMinimalViewInfo& InViewInfo, TArray& OutScreenPositions, const FIntRect& InViewRect) const; UE_API void PopulateMarkerDataFromConfig(const TMap>& InConfigContourData); UE_API bool LoadCurvesAndLandmarksFromJson(const FString& InFileName); UE_API bool LoadGroupsFromJson(const FString& InFileName) const; UE_API TArray GetCurvesForPreset(const ECurvePresetType& InSelectedPose) const; UE_API EIdentityPartMeshes GetMeshPartFromConfigName(const FString& InMeshName) const; /** A struct containing non-changing marker group and curve data */ TSharedPtr MarkerDefs; TSet NeutralPoseCurveExclusionList; TSet NeutralPoseGroupExclusionList; TSet TeethPoseCurveExclusionList; TSet TeethPoseGroupExclusionList; TSet PerformanceCurveList; TSet PerformanceCurveGroups; UE_API const static FString ConfigGroupFileName; }; #undef UE_API