| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 | /** @Author: namidame* @Description: A Heatmap Generation plugin based on the old HeatMapActor, Supports Heightmap, Texture Coordinate Points And Geographic Location Data.* @Date: 2024/07/27*/#pragma once#include "CoreMinimal.h"#include "Engine/DataTable.h"#include "DynamicHeatmapDefs.generated.h"/* * Defines which method is used to generate the heatmap *  * GrayScaleTexture: Use a gray scale value texture to create a heatmap. * TextureCoordPoint: Use a map with texture coordinate point for keys and heat value(0 to 1) to create a heatmap. * GeographicData: Use a map with geographic point (longitude, latitude) for keys and heat value(0 to 1) to create a heatmap. * JsonFileData: Use a json file with geographic point (longitude, latitude) and heat value(0 to 1) to create a heatmap. * HgtFileData: Use a hgt file (a DEM data format file) to create a heatmap. */UENUM(BlueprintType)enum class EDynamicHeatmapType : uint8{	NONE,	GrayScaleTexture,	TextureCoordPoint,	GeographicData,	JsonFileData,	HgtFileData};/* * Configuration of field names and types of a json content.  */USTRUCT(BlueprintType)struct FJsonConfig{	GENERATED_BODY()	FJsonConfig()	: LngName("lng")	, LatName("lat")	, ValueName("value")	, bStringCoord(false)	, bStringValue(false)	{};	FJsonConfig(const FString& lng, const FString& lat, const FString& vName, bool bStringCoordValue, bool bStringValueValue)		: LngName(lng)		, LatName(lat)		, ValueName(vName)		, bStringCoord(bStringCoordValue)		, bStringValue(bStringValueValue)	{			};		UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Json)	FString LngName;	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Json)	FString LatName;	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Json)	FString ValueName;	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(DisplayName="Is String Coordinate"), Category=Json)	bool bStringCoord;	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(DisplayName="Is String Heat Value"), Category=Json)	bool bStringValue;};/* * Defines fields in heatmap data table. */USTRUCT(BlueprintType)struct FHeatmapData : public FTableRowBase{	GENERATED_BODY()	FHeatmapData()		: Longitude(0)		, Latitude(0)		, HeatValue(0)	{};		UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Heatmap)	double Longitude;		UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Heatmap)	double Latitude;		UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Heatmap)	float HeatValue;};/* * Defines data format in TextureCoordPoint method.  */USTRUCT(BlueprintType)struct FTextureCoordPointData : public FTableRowBase{	GENERATED_BODY()	FTextureCoordPointData()		: TextureCoord(FVector2D::Zero())		, HeatValue(0)	{};		UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Heatmap)	FVector2D TextureCoord;		UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Heatmap)	float HeatValue;};
 |