Select Git revision
PointCloud.h 1.81 KiB
#pragma once
#include "CoreMinimal.h"
#include "GPUPointCloudRendererComponent.h"
#include "GameFramework/Actor.h"
#include "MetaCastBachelor/DensityField.h"
#include "PointCloud.generated.h"
class UGPUPointCloudRendererComponent;
UCLASS()
class APointCloud : public AActor
{
GENERATED_BODY()
public:
FDensityField* MyDensityField;
TArray<FVector> PositionVectors;
TArray<bool> DefaultFlags;
TArray<bool> SelectionFlags;
TArray<FColor> PointColors;
mutable FCriticalSection DataGuard;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Bounds")
FVector MinBounds;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Bounds")
FVector MaxBounds;
UPROPERTY()
UGPUPointCloudRendererComponent* PointCloudVisualizer;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Visualization")
float SplatSize = 1.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Files")
FFilePath PointInputData;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Files")
FFilePath FlagInputData;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Materials")
UMaterialInterface* SelectedMaterial;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Materials")
UMaterialInterface* UnselectedMaterial;
// Sets default values for this actor's properties
APointCloud();
void InitPointCloudVisualizer();
void UpdateBounds();
void SetupDensityFieldFromPointCloud() const;
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
void UpdateSelection();
void DrawVoxel(const int Index, float Time) const;
void ColorPointsInVoxels(const TArray<int32> VoxelIndices);
UFUNCTION(BlueprintCallable)
void ReadPointCloudFromFile(FFilePath FileNamePoints, FFilePath FileNameFlags);
};