Commit 0ecf4154 authored by Jan Kremer's avatar Jan Kremer

Working on 3D point color/brush color/transparency.

parent 8f97c099
No preview for this file type
No preview for this file type
This diff is collapsed.
......@@ -50,12 +50,4 @@ bHQBuffer=False
bHQDistortion=False
bUpdateOnRT=True
[WindowsApplication.Accessibility]
StickyKeysHotkey=True
ToggleKeysHotkey=True
FilterKeysHotkey=True
StickyKeysConfirmation=True
ToggleKeysConfirmation=True
FilterKeysConfirmation=True
......@@ -17,6 +17,12 @@ APlot3D::APlot3D()
PointCloudComponent->SetupAttachment(RootComponent);
PointCloudComponent->bCastVolumetricTranslucentShadow = true;
PointCloudComponent->bCastShadowAsTwoSided = true;
BrushAlpha = 0;
SpriteAlpha = 255;
BrushOverridesColor = false;
BrushColor = FColor(0, 0, 0, 0);
UseTransparency = true;
}
// Called when the game starts or when spawned
......@@ -146,19 +152,30 @@ void APlot3D::BrushPoint(int32 PointIndex, bool Add)
return;
}
Points[PointIndex].SetEnabled(!Add);
IsBrushed[PointIndex] = Add;
/*
if (Add)
if (UseTransparency)
{
Points[PointIndex].Color = FColor();
if (Add)
{
FColor NewColor = Points[PointIndex].OriginalColor;
if (BrushOverridesColor)
{
NewColor = BrushColor;
}
NewColor.A = BrushAlpha;
Points[PointIndex].Color = NewColor;
}
else
{
Points[PointIndex].Color = Points[PointIndex].OriginalColor;
Points[PointIndex].Color.A = SpriteAlpha;
}
}
else
{
Points[PointIndex].Color = Points[PointIndex].OriginalColor;
Points[PointIndex].SetEnabled(!Add);
}
*/
}
void APlot3D::ResetPoints(bool Rebuild)
......@@ -183,7 +200,7 @@ void APlot3D::InvertPoints(bool Rebuild)
{
for (int i = 0; i < Points.Num(); ++i)
{
BrushPoint(i, Points[i].IsEnabled());
BrushPoint(i, !IsBrushed[i]);
}
/*ParallelFor(Points.Num(), [this](int32 CurrIdx)
......@@ -372,3 +389,20 @@ void APlot3D::AddFilter_Sphere(FVector Location, float Radius, bool Add, bool Re
BrushPoints(Indexes, Add, Rebuild);
}
void APlot3D::RefreshAfterSettingsChange()
{
for (int i = 0; i < Points.Num(); ++i)
{
BrushPoint(i, IsBrushed[i]);
};
RebuildCloud();
}
void APlot3D::EnableAllPoints()
{
for (int i = 0; i < Points.Num(); ++i)
{
Points[i].SetEnabled(true);
};
}
\ No newline at end of file
......@@ -118,6 +118,21 @@ public:
UPROPERTY(EditAnywhere, Category = Plot3D)
FString FileName;
UPROPERTY(EditAnywhere, Category = Plot3D, BlueprintReadWrite)
FColor BrushColor;
UPROPERTY(EditAnywhere, Category = Plot3D, BlueprintReadWrite)
bool BrushOverridesColor;
UPROPERTY(EditAnywhere, Category = Plot3D, BlueprintReadWrite)
uint8 BrushAlpha;
UPROPERTY(EditAnywhere, Category = Plot3D, BlueprintReadWrite)
uint8 SpriteAlpha;
UPROPERTY(EditAnywhere, Category = Plot3D, BlueprintReadWrite)
bool UseTransparency;
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
UPointCloud *PointCloud;
......@@ -151,5 +166,11 @@ public:
UFUNCTION(BlueprintCallable)
void AddFilter_Sphere(FVector Location, float Radius, bool Add, bool Rebuild);
UFUNCTION(BlueprintCallable)
void RefreshAfterSettingsChange();
UFUNCTION(BlueprintCallable)
void EnableAllPoints();
class UPointCloudComponent* GetPointCloudComponent() const { return PointCloudComponent; }
};
......@@ -63,6 +63,15 @@ public:
UFUNCTION(BlueprintCallable, Category = DrawingTools)
void DrawRectangle(int32 x1, int32 y1, int32 x2, int32 y2, const uint8 r, const uint8 g, const uint8 b, const uint8 a);
UPROPERTY(Category = Plot3D, VisibleDefaultsOnly, BlueprintReadOnly)
float XMin;
UPROPERTY(Category = Plot3D, VisibleDefaultsOnly, BlueprintReadOnly)
float XMax;
UPROPERTY(Category = Plot3D, VisibleDefaultsOnly, BlueprintReadOnly)
float YMin;
UPROPERTY(Category = Plot3D, VisibleDefaultsOnly, BlueprintReadOnly)
float YMax;
private:
// canvas
......@@ -82,9 +91,7 @@ private:
void setPixelColor(uint8*& pointer, uint8 red, uint8 green, uint8 blue, uint8 alpha);
TArray<float>* XArray;
float XMin;
float XMax;
TArray<float>* YArray;
float YMin;
float YMax;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment