Plot3D.h 1.77 KB
Newer Older
Jan Kremer's avatar
Jan Kremer committed
1 2 3 4 5 6 7 8
// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "PointCloud.h"
#include "PointCloudActor.h"
Jan Kremer's avatar
Jan Kremer committed
9
#include "Runtime/Engine/Classes/Curves/CurveVector.h"
10
#include "SharedEnums.h"
Jan Kremer's avatar
Jan Kremer committed
11 12 13 14 15 16 17 18 19 20
#include "Plot3D.generated.h"

UCLASS()
class IMMERSIVEANALYTICS_API APlot3D : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	APlot3D();
21
	void Init(class UDataComponent* DataComponent);
Jan Kremer's avatar
Jan Kremer committed
22
	void OnLoadStep(bool KeepBrushedIndexes);
Jan Kremer's avatar
Jan Kremer committed
23 24 25 26 27 28

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

private:
Jan Kremer's avatar
Jan Kremer committed
29 30
	void UpdatePoints(bool KeepBrushedIndexes);

31
	FVector Center;
Jan Kremer's avatar
Jan Kremer committed
32 33 34

	UPROPERTY(Category = PointCloudActor, VisibleAnywhere, BlueprintReadOnly, meta = (ExposeFunctionCategories = "Rendering,Components|PointCloud", AllowPrivateAccess = "true"))
	class UPointCloudComponent* PointCloudComponent;
Jan Kremer's avatar
Jan Kremer committed
35

36
	class UDataComponent* Data;
Jan Kremer's avatar
Jan Kremer committed
37 38 39
public:	
	virtual void Tick(float DeltaTime) override;

40 41
	UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
	UPointCloud *PointCloud;
42

43
	class UPointCloudComponent* GetPointCloudComponent() const { return PointCloudComponent; }
44

45
	UPROPERTY(Category = Plot3D, VisibleDefaultsOnly, BlueprintReadOnly)
46
	TArray<FPointCloudPoint> Points;
47

48 49
	// plot interface
	void BrushPoints(TArray<int32> PointIndexes, bool Rebuild);
Jan Kremer's avatar
Jan Kremer committed
50 51 52
	void BrushPoint(int32 PointIndex, bool Add);
	void ResetPoints(bool Rebuild);
	void InvertPoints(bool Rebuild);
53
	void RebuildCloud();
Jan Kremer's avatar
Jan Kremer committed
54

55
	// aux
Jan Kremer's avatar
Jan Kremer committed
56

57
	FVector CalculateWorldLocOfPoint(int32 PointIndex);
Jan Kremer's avatar
Jan Kremer committed
58

59 60 61 62 63 64
	UFUNCTION(BlueprintCallable)
	void RefreshAfterSettingsChange();

	UFUNCTION(BlueprintCallable)
	void EnableAllPoints();

65
	UFUNCTION(BlueprintCallable)
Jan Kremer's avatar
Jan Kremer committed
66
	void UpdateSpriteSize(bool Rebuild);
Jan Kremer's avatar
Jan Kremer committed
67
};