Plot3D.h 1.89 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 "MyObject.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 IsFirstTime, 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
	void RebuildCloud();
30

Jan Kremer's avatar
Jan Kremer committed
31 32
	void UpdatePoints(bool KeepBrushedIndexes);

33
	FVector Center;
Jan Kremer's avatar
Jan Kremer committed
34 35 36

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

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

42 43
	UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
	UPointCloud *PointCloud;
44

45
	class UPointCloudComponent* GetPointCloudComponent() const { return PointCloudComponent; }
46

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

50
	// rendering
51

52 53 54
	UPROPERTY(Category = Plot3D, VisibleDefaultsOnly, BlueprintReadOnly)
	float DataScaleFactor;

55 56
	// plot interface
	void BrushPoints(TArray<int32> PointIndexes, bool Rebuild);
Jan Kremer's avatar
Jan Kremer committed
57 58 59 60
	void BrushPoint(int32 PointIndex, bool Add);
	void ResetPoints(bool Rebuild);
	void InvertPoints(bool Rebuild);

61
	// aux
Jan Kremer's avatar
Jan Kremer committed
62

63
	FVector CalculateWorldLocOfPoint(int32 PointIndex);
Jan Kremer's avatar
Jan Kremer committed
64

65 66 67 68 69 70
	UFUNCTION(BlueprintCallable)
	void RefreshAfterSettingsChange();

	UFUNCTION(BlueprintCallable)
	void EnableAllPoints();

71
	UFUNCTION(BlueprintCallable)
Jan Kremer's avatar
Jan Kremer committed
72
	void UpdateSpriteSize(bool Rebuild);
Jan Kremer's avatar
Jan Kremer committed
73
};