// Copyright 2020 Phyronnaz #pragma once #include "CoreMinimal.h" #include "VoxelMinimal.h" class SVoxelGraphPreview; class SVoxelGraphPreviewViewport; class FVoxelData; class FReferenceCollector; class FAdvancedPreviewScene; class FVoxelGraphGeneratorInstance; class UTexture2D; class UStaticMeshComponent; class UVoxelGraphGenerator; class UVoxelLineBatchComponent; class UMaterialInstanceDynamic; enum class EVoxelGraphPreviewFlags; class FVoxelGraphPreview { public: FVoxelGraphPreview( UVoxelGraphGenerator* Generator, const TSharedPtr& Preview, const TSharedPtr& PreviewViewport, const TSharedPtr& PreviewScene); void Update(EVoxelGraphPreviewFlags Flags); void AddReferencedObjects(FReferenceCollector& Collector); private: UVoxelGraphGenerator* const Generator; TSharedPtr const Preview; TSharedPtr const PreviewViewport; TSharedPtr const PreviewScene; TVoxelSharedPtr Data; UStaticMeshComponent* PreviewSceneFloor = nullptr; UVoxelLineBatchComponent* LineBatchComponent = nullptr; UMaterialInstanceDynamic* HeightmapMaterial = nullptr; UMaterialInstanceDynamic* SliceMaterial = nullptr; UTexture2D* DensitiesTexture = nullptr; UTexture2D* MaterialsTexture = nullptr; UTexture2D* MaterialsTextureWithCrossAndNoAlpha = nullptr; void UpdateTextures(EVoxelGraphPreviewFlags Flags); void UpdateMaterialParameters(); void AddMessages(FVoxelGraphGeneratorInstance& GraphGeneratorInstance) const; };