Commit ba699bd9 authored by Jan Kremer's avatar Jan Kremer

Working on 2D plots. Added pin feature.

parent cb558583
No preview for this file type
No preview for this file type
......@@ -50,4 +50,12 @@ bHQBuffer=False
bHQDistortion=False
bUpdateOnRT=True
[WindowsApplication.Accessibility]
StickyKeysHotkey=True
ToggleKeysHotkey=True
FilterKeysHotkey=True
StickyKeysConfirmation=True
ToggleKeysConfirmation=True
FilterKeysConfirmation=True
......@@ -50,13 +50,24 @@ void APlot3D::InitPoints()
}
int32 MaxIndex, MinIndex;
float Max, Min;
UKismetMathLibrary::MaxOfFloatArray(Length, MaxIndex, Max);
UKismetMathLibrary::MinOfFloatArray(Length, MinIndex, Min);
UKismetMathLibrary::MaxOfFloatArray(Length, MaxIndex, MaxLength);
UKismetMathLibrary::MinOfFloatArray(Length, MinIndex, MinLength);
UKismetMathLibrary::MaxOfFloatArray(X, MaxIndex, MaxX);
UKismetMathLibrary::MinOfFloatArray(X, MinIndex, MinX);
UKismetMathLibrary::MaxOfFloatArray(Y, MaxIndex, MaxY);
UKismetMathLibrary::MinOfFloatArray(Y, MinIndex, MinY);
UKismetMathLibrary::MaxOfFloatArray(Z, MaxIndex, MaxZ);
UKismetMathLibrary::MinOfFloatArray(Z, MinIndex, MinZ);
UKismetMathLibrary::MaxOfFloatArray(U, MaxIndex, MaxU);
UKismetMathLibrary::MinOfFloatArray(U, MinIndex, MinU);
UKismetMathLibrary::MaxOfFloatArray(V, MaxIndex, MaxV);
UKismetMathLibrary::MinOfFloatArray(V, MinIndex, MinV);
UKismetMathLibrary::MaxOfFloatArray(W, MaxIndex, MaxW);
UKismetMathLibrary::MinOfFloatArray(W, MinIndex, MinW);
for (int32 i = 0; i < Num; i++)
{
FColor Color = CalculateColorOfPoint(i, Min, Max);
FColor Color = CalculateColorOfPoint(i, MaxLength, MinLength);
Points.Emplace(FVector(X[i], Y[i], Z[i]), Color, true);
}
......
......@@ -57,6 +57,48 @@ public:
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
TArray<float> Length;
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
float MinLength;
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
float MaxLength;
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
float MinX;
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
float MaxX;
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
float MinY;
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
float MaxY;
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
float MinZ;
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
float MaxZ;
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
float MinU;
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
float MaxU;
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
float MinV;
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
float MaxV;
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
float MinW;
UPROPERTY(Category = Plot3D, VisibleAnywhere, BlueprintReadOnly)
float MaxW;
UPROPERTY(EditDefaultsOnly, Category = Plot3D)
UCurveVector* TransferFunction;
......
......@@ -66,7 +66,7 @@ void UPlotCanvas::DrawFromData()
for (int i = 0; i < PawnBase->Plot3D->Points.Num(); ++i)
{
InitializeDrawingTools(1, PawnBase->Plot3D->Points[i].Color.R, PawnBase->Plot3D->Points[i].Color.G, PawnBase->Plot3D->Points[i].Color.B);
DrawDot(PawnBase->Plot3D->Points[i].Location.X * 10000 + canvasWidth / 2, PawnBase->Plot3D->U[i] * 5 + canvasHeight / 2);
DrawDot((PawnBase->Plot3D->Points[i].Location.X - PawnBase->Plot3D->MinX) / (PawnBase->Plot3D->MaxX - PawnBase->Plot3D->MinX) * canvasWidth, (PawnBase->Plot3D->U[i] - PawnBase->Plot3D->MinU) / (PawnBase->Plot3D->MaxU - PawnBase->Plot3D->MinU) * canvasHeight);
}
UpdateCanvas();
......
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