PS_Charts: English comments, ASTERION VR copyright, ASTERION Blueprint categories

- Add 'Copyright ASTERION VR. All Rights Reserved.' header to every plugin source file
- Translate all comments and property/function tooltips to English
- Move UFUNCTION categories to ASTERION|PS_Charts|Data and ASTERION|PS_Charts|Style

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-22 13:27:27 +02:00
parent 6adb8566a7
commit 9db3db9101
22 changed files with 152 additions and 129 deletions

View File

@@ -1,3 +1,5 @@
// Copyright ASTERION VR. All Rights Reserved.
using UnrealBuildTool;
public class PS_Charts : ModuleRules

View File

@@ -1,11 +1,12 @@
// PS_Charts - widget UMG histogramme
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - UMG bar chart widget
#include "PSBarChart.h"
#include "SPSBarChart.h"
UPSBarChart::UPSBarChart()
{
// Donnees d'exemple pour la previsualisation dans le designer UMG
// Sample data for the UMG designer preview
Categories = { TEXT("Jan"), TEXT("Feb"), TEXT("Mar"), TEXT("Apr"), TEXT("May"), TEXT("Jun") };
Series.Emplace(TEXT("Serie 1"), TArray<float>{ 12.f, 25.f, 18.f, 30.f, 22.f, 27.f });
Series.Emplace(TEXT("Serie 2"), TArray<float>{ 8.f, 15.f, 22.f, 18.f, 26.f, 20.f });

View File

@@ -1,4 +1,5 @@
// PS_Charts - base commune histogramme / courbes
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - shared base of bar / line charts
#include "PSCartesianChartBase.h"
void UPSCartesianChartBase::SetCategories(const TArray<FString>& InCategories)

View File

@@ -1,4 +1,5 @@
// PS_Charts - palette et resolution des couleurs
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - palette and color resolution
#include "PSChartTypes.h"
namespace PSCharts

View File

@@ -1,4 +1,5 @@
// PS_Charts - base commune des widgets UMG
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - shared base of the UMG chart widgets
#include "PSChartWidgetBase.h"
#define LOCTEXT_NAMESPACE "PS_Charts"

View File

@@ -1,4 +1,5 @@
// PS_Charts - module runtime
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - runtime module
#include "Modules/ModuleManager.h"
class FPS_ChartsModule : public IModuleInterface

View File

@@ -1,4 +1,5 @@
// PS_Charts - utilitaires de dessin partages
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - painting helpers shared by the Slate widgets
#include "PSChartsPaintUtil.h"
#include "Fonts/FontMeasure.h"
@@ -200,7 +201,7 @@ TArray<FVector2f> SmoothPolyline(const TArray<FVector2f>& Points, int32 Subdivis
const float T = float(Sub) / SubdivisionsPerSegment;
const float T2 = T * T;
const float T3 = T2 * T;
// Catmull-Rom uniforme
// Uniform Catmull-Rom
const FVector2f Point = 0.5f * ((2.f * P1)
+ (-P0 + P2) * T
+ (2.f * P0 - 5.f * P1 + 4.f * P2 - P3) * T2
@@ -367,7 +368,7 @@ FAxisLayout DrawValueAxis(FSlateWindowElementList& OutDrawElements, int32& Layer
TSharedRef<FSlateFontMeasure> FontMeasure = GetFontMeasure();
const float FontHeight = float(FontMeasure->GetMaxCharacterHeight(Font));
// Graduations
// Ticks
TArray<float> TickValues;
for (int32 Tick = 0; Tick <= 64; ++Tick)
{
@@ -401,7 +402,7 @@ FAxisLayout DrawValueAxis(FSlateWindowElementList& OutDrawElements, int32& Layer
}
Layout.bValid = true;
// Grille + etiquettes de graduations
// Grid lines + tick labels
for (int32 Index = 0; Index < TickValues.Num(); ++Index)
{
const float Y = Layout.ValueToY(TickValues[Index]);
@@ -421,7 +422,7 @@ FAxisLayout DrawValueAxis(FSlateWindowElementList& OutDrawElements, int32& Layer
FVector2f(LabelWidth, FontHeight), TickLabels[Index], Font, TextColor, DrawEffects);
}
// Axe Y (gauche)
// Y axis (left)
{
TArray<FVector2f> AxisPoints;
AxisPoints.Add(FVector2f(Layout.PlotRect.Left, Layout.PlotRect.Top));
@@ -430,7 +431,7 @@ FAxisLayout DrawValueAxis(FSlateWindowElementList& OutDrawElements, int32& Layer
MoveTemp(AxisPoints), DrawEffects, Axis.AxisColor, false, 1.f);
}
// Axe X (bas) et ligne du zero si necessaire
// X axis (bottom) and zero line when needed
{
TArray<FVector2f> AxisPoints;
AxisPoints.Add(FVector2f(Layout.PlotRect.Left, Layout.PlotRect.Bottom));
@@ -475,7 +476,7 @@ void DrawCategoryLabels(FSlateWindowElementList& OutDrawElements, int32 LayerId,
MaxLabelWidth = FMath::Max(MaxLabelWidth, Width);
}
// Saute des etiquettes si elles ne tiennent pas dans la largeur d'un emplacement
// Skip labels when they cannot fit within one slot width
const int32 SkipStep = (SlotWidth > 1.f) ? FMath::Max(1, FMath::CeilToInt((MaxLabelWidth + 6.f) / SlotWidth)) : 1;
for (int32 Index = 0; Index < Labels.Num(); ++Index)

View File

@@ -1,4 +1,5 @@
// PS_Charts - utilitaires de dessin partages entre les widgets Slate
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - painting helpers shared by the Slate widgets
#pragma once
#include "CoreMinimal.h"
@@ -14,7 +15,7 @@ namespace PSChartsPaint
FLinearColor Color;
};
/** Resultat du trace de l'axe des valeurs. */
/** Result of the value axis painting. */
struct FAxisLayout
{
bool bValid = false;
@@ -34,61 +35,61 @@ namespace PSChartsPaint
FSlateFontInfo GetFont(float Size, bool bBold = false);
/** Point sur un cercle ; angle 0 = midi, sens horaire, en radians. */
/** Point on a circle; angle 0 = twelve o'clock, clockwise, in radians. */
FVector2f PolarPoint(const FVector2f& Center, float Radius, float AngleRad);
/** Ajoute un secteur annulaire (part de camembert / donut) au buffer de vertex. */
/** Appends an annular sector (pie / donut slice) to the vertex buffer. */
void AddArcSector(TArray<FSlateVertex>& Verts, TArray<SlateIndex>& Indices,
const FSlateRenderTransform& RenderTransform, const FVector2f& AtlasUV,
const FVector2f& Center, float OuterRadius, float InnerRadius,
float StartAngleRad, float EndAngleRad, const FColor& Color);
/** Ajoute un disque plein (marqueur de point) au buffer de vertex. */
/** Appends a filled disc (point marker) to the vertex buffer. */
void AddCircle(TArray<FSlateVertex>& Verts, TArray<SlateIndex>& Indices,
const FSlateRenderTransform& RenderTransform, const FVector2f& AtlasUV,
const FVector2f& Center, float Radius, const FColor& Color, int32 NumSegments = 20);
/** UV du centre de la texture blanche dans son atlas. */
/** UV of the center of the white texture inside its atlas. */
FVector2f GetAtlasUV(const FSlateResourceHandle& Handle);
/** Echelle "propre" (bornes et pas arrondis) pour l'axe des valeurs. */
/** "Nice" scale (rounded bounds and step) for the value axis. */
void ComputeNiceAxis(float DataMin, float DataMax, int32 TargetTicks, float& OutMin, float& OutMax, float& OutStep);
/** Formate une valeur en supprimant les zeros inutiles. */
/** Formats a value, trimming useless zeros. */
FString FormatValue(float Value, int32 MaxDecimals = 2);
/** Formate une valeur de graduation selon le pas de l'axe. */
/** Formats an axis tick value according to the axis step. */
FString FormatAxisValue(float Value, float Step);
/** Interpolation Catmull-Rom d'une polyligne. */
/** Catmull-Rom interpolation of a polyline. */
TArray<FVector2f> SmoothPolyline(const TArray<FVector2f>& Points, int32 SubdivisionsPerSegment = 12);
void DrawBackground(FSlateWindowElementList& OutDrawElements, int32& LayerId, const FGeometry& Geometry,
const FLinearColor& Color, ESlateDrawEffect DrawEffects);
/** Dessine le titre centre en haut et retourne le rect restant. */
/** Draws the title centered at the top and returns the remaining rect. */
FSlateRect DrawTitle(FSlateWindowElementList& OutDrawElements, int32& LayerId, const FGeometry& Geometry,
const FSlateRect& Rect, const FText& Title, const FLinearColor& Color, float FontSize, ESlateDrawEffect DrawEffects);
/** Dessine la legende et retourne le rect restant pour le contenu. */
/** Draws the legend and returns the remaining rect for the content. */
FSlateRect DrawLegend(FSlateWindowElementList& OutDrawElements, int32& LayerId, const FGeometry& Geometry,
const FSlateRect& Rect, const TArray<FLegendEntry>& Entries, EPSChartLegendPosition Position,
const FLinearColor& TextColor, float FontSize, ESlateDrawEffect DrawEffects);
/**
* Calcule l'echelle, dessine grille + graduations + axes, et retourne la zone de trace.
* BottomReserve : hauteur reservee sous la zone de trace (etiquettes de categories).
* Computes the scale, draws grid + ticks + axes, and returns the plot area.
* BottomReserve: height reserved below the plot area (category labels).
*/
FAxisLayout DrawValueAxis(FSlateWindowElementList& OutDrawElements, int32& LayerId, const FGeometry& Geometry,
const FSlateRect& Rect, float BottomReserve, const FPSAxisParams& Axis, float DataMin, float DataMax,
const FLinearColor& TextColor, float FontSize, ESlateDrawEffect DrawEffects);
/** Dessine les etiquettes de categories sous la zone de trace (saute des etiquettes si trop serrees). */
/** Draws the category labels below the plot area (skips labels when too dense). */
void DrawCategoryLabels(FSlateWindowElementList& OutDrawElements, int32 LayerId, const FGeometry& Geometry,
const FAxisLayout& Layout, const TArray<FString>& Labels, TFunctionRef<float(int32)> GetCenterX,
float SlotWidth, const FLinearColor& TextColor, float FontSize, ESlateDrawEffect DrawEffects);
/** Dessine une chaine a une position locale donnee. */
/** Draws a string at a given local position. */
void DrawTextAt(FSlateWindowElementList& OutDrawElements, int32 LayerId, const FGeometry& Geometry,
const FVector2f& Position, const FVector2f& Size, const FString& Text, const FSlateFontInfo& Font,
const FLinearColor& Color, ESlateDrawEffect DrawEffects);

View File

@@ -1,14 +1,15 @@
// PS_Charts - widget UMG courbes
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - UMG line chart widget
#include "PSLineChart.h"
#include "SPSLineChart.h"
UPSLineChart::UPSLineChart()
{
// Pour une courbe, l'echelle automatique colle aux donnees plutot qu'au zero
// For a line chart the automatic scale sticks to the data rather than zero
bIncludeZero = false;
// Donnees d'exemple pour la previsualisation dans le designer UMG
// Sample data for the UMG designer preview
Categories = { TEXT("Jan"), TEXT("Feb"), TEXT("Mar"), TEXT("Apr"), TEXT("May"), TEXT("Jun") };
Series.Emplace(TEXT("Serie 1"), TArray<float>{ 12.f, 25.f, 18.f, 30.f, 22.f, 27.f });
Series.Emplace(TEXT("Serie 2"), TArray<float>{ 8.f, 15.f, 22.f, 18.f, 26.f, 20.f });

View File

@@ -1,11 +1,12 @@
// PS_Charts - widget UMG camembert
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - UMG pie chart widget
#include "PSPieChart.h"
#include "SPSPieChart.h"
UPSPieChart::UPSPieChart()
{
// Donnees d'exemple pour la previsualisation dans le designer UMG
// Sample data for the UMG designer preview
Slices.Emplace(TEXT("Alpha"), 40.f);
Slices.Emplace(TEXT("Beta"), 30.f);
Slices.Emplace(TEXT("Gamma"), 20.f);

View File

@@ -1,4 +1,5 @@
// PS_Charts - histogramme Slate natif
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - native Slate bar chart
#include "SPSBarChart.h"
#include "Fonts/FontMeasure.h"
@@ -59,20 +60,20 @@ int32 SPSBarChart::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeom
DrawBackground(OutDrawElements, Layer, AllottedGeometry, Tinted(Common.BackgroundColor), DrawEffects);
Rect = DrawTitle(OutDrawElements, Layer, AllottedGeometry, Rect, Common.Title, Tinted(Common.TitleColor), Common.TitleFontSize, DrawEffects);
// Legende (noms des series)
// Legend (series names)
if (Common.LegendPosition != EPSChartLegendPosition::None && Series.Num() > 0)
{
TArray<FLegendEntry> Entries;
Entries.Reserve(Series.Num());
for (int32 Index = 0; Index < Series.Num(); ++Index)
{
const FString Name = Series[Index].Name.IsEmpty() ? FString::Printf(TEXT("Serie %d"), Index + 1) : Series[Index].Name;
const FString Name = Series[Index].Name.IsEmpty() ? FString::Printf(TEXT("Series %d"), Index + 1) : Series[Index].Name;
Entries.Add({ Name, Tinted(PSCharts::ResolveColor(Index, Common.Palette, Series[Index].bUseCustomColor, Series[Index].CustomColor)) });
}
Rect = DrawLegend(OutDrawElements, Layer, AllottedGeometry, Rect, Entries, Common.LegendPosition, Tinted(Common.TextColor), Common.FontSize, DrawEffects);
}
// Nombre de points et bornes des donnees
// Point count and data bounds
int32 NumPoints = 0;
float DataMin = TNumericLimits<float>::Max();
float DataMax = TNumericLimits<float>::Lowest();
@@ -106,7 +107,7 @@ int32 SPSBarChart::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeom
return Layer;
}
// Geometrie des barres
// Bar geometry
const float PlotWidth = Layout.PlotRect.GetSize().X;
const float SlotWidth = PlotWidth / NumPoints;
const float InnerWidth = SlotWidth * (1.f - FMath::Clamp(Bar.CategoryGapRatio, 0.f, 0.9f));
@@ -155,7 +156,7 @@ int32 SPSBarChart::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeom
}
Layer += Bar.bShowValueLabels ? 2 : 1;
// Etiquettes de categories
// Category labels
TArray<FString> Labels;
Labels.Reserve(NumPoints);
for (int32 Index = 0; Index < NumPoints; ++Index)

View File

@@ -1,4 +1,5 @@
// PS_Charts - courbes Slate natives
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - native Slate line chart
#include "SPSLineChart.h"
#include "Fonts/FontMeasure.h"
@@ -59,20 +60,20 @@ int32 SPSLineChart::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeo
DrawBackground(OutDrawElements, Layer, AllottedGeometry, Tinted(Common.BackgroundColor), DrawEffects);
Rect = DrawTitle(OutDrawElements, Layer, AllottedGeometry, Rect, Common.Title, Tinted(Common.TitleColor), Common.TitleFontSize, DrawEffects);
// Legende (noms des series)
// Legend (series names)
if (Common.LegendPosition != EPSChartLegendPosition::None && Series.Num() > 0)
{
TArray<FLegendEntry> Entries;
Entries.Reserve(Series.Num());
for (int32 Index = 0; Index < Series.Num(); ++Index)
{
const FString Name = Series[Index].Name.IsEmpty() ? FString::Printf(TEXT("Serie %d"), Index + 1) : Series[Index].Name;
const FString Name = Series[Index].Name.IsEmpty() ? FString::Printf(TEXT("Series %d"), Index + 1) : Series[Index].Name;
Entries.Add({ Name, Tinted(PSCharts::ResolveColor(Index, Common.Palette, Series[Index].bUseCustomColor, Series[Index].CustomColor)) });
}
Rect = DrawLegend(OutDrawElements, Layer, AllottedGeometry, Rect, Entries, Common.LegendPosition, Tinted(Common.TextColor), Common.FontSize, DrawEffects);
}
// Nombre de points et bornes des donnees
// Point count and data bounds
int32 NumPoints = 0;
float DataMin = TNumericLimits<float>::Max();
float DataMax = TNumericLimits<float>::Lowest();
@@ -106,7 +107,7 @@ int32 SPSLineChart::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeo
return Layer;
}
// Position X de chaque point (reparties bord a bord)
// X position of each point (spread edge to edge)
const float PlotWidth = Layout.PlotRect.GetSize().X;
auto PointX = [&Layout, PlotWidth, NumPoints](int32 Index) -> float
{
@@ -117,7 +118,7 @@ int32 SPSLineChart::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeo
return Layout.PlotRect.Left + PlotWidth * Index / (NumPoints - 1);
};
// Courbes
// Lines
const FSlateBrush* WhiteBrush = GetWhiteBrush();
const FSlateResourceHandle& ResourceHandle = WhiteBrush->GetRenderingResource();
const FVector2f AtlasUV = GetAtlasUV(ResourceHandle);
@@ -179,7 +180,7 @@ int32 SPSLineChart::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeo
}
Layer += Line.bShowValueLabels ? 2 : 1;
// Etiquettes de categories
// Category labels
TArray<FString> Labels;
Labels.Reserve(NumPoints);
for (int32 Index = 0; Index < NumPoints; ++Index)

View File

@@ -1,4 +1,5 @@
// PS_Charts - camembert Slate natif
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - native Slate pie chart
#include "SPSPieChart.h"
#include "Fonts/FontMeasure.h"
@@ -52,14 +53,14 @@ int32 SPSPieChart::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeom
DrawBackground(OutDrawElements, Layer, AllottedGeometry, Tinted(Common.BackgroundColor), DrawEffects);
Rect = DrawTitle(OutDrawElements, Layer, AllottedGeometry, Rect, Common.Title, Tinted(Common.TitleColor), Common.TitleFontSize, DrawEffects);
// Total des valeurs positives
// Sum of the positive values
float Total = 0.f;
for (const FPSPieSlice& Slice : Slices)
{
Total += FMath::Max(0.f, Slice.Value);
}
// Legende
// Legend
if (Common.LegendPosition != EPSChartLegendPosition::None && Slices.Num() > 0)
{
TArray<FLegendEntry> Entries;
@@ -76,7 +77,7 @@ int32 SPSPieChart::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeom
return Layer;
}
// Rayon : reserve la place des etiquettes autour du camembert
// Radius: keep room around the pie for the labels
const FSlateFontInfo Font = GetFont(Common.FontSize);
TSharedRef<FSlateFontMeasure> FontMeasure = FSlateApplication::Get().GetRenderer()->GetFontMeasureService();
const float FontHeight = float(FontMeasure->GetMaxCharacterHeight(Font));
@@ -112,12 +113,12 @@ int32 SPSPieChart::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeom
}
float OuterRadius = 0.5f * FMath::Min(Rect.GetSize().X - 2.f * LabelReserveX, Rect.GetSize().Y - 2.f * LabelReserveY);
// Si les etiquettes ne laissent plus de place, on retombe sur un rayon minimal lisible
// When labels leave no room, fall back to a minimal readable radius
OuterRadius = FMath::Max(OuterRadius, 0.25f * FMath::Min(Rect.GetSize().X, Rect.GetSize().Y));
const float InnerRadius = OuterRadius * FMath::Clamp(Pie.InnerRadiusRatio, 0.f, 0.95f);
const FVector2f Center((Rect.Left + Rect.Right) * 0.5f, (Rect.Top + Rect.Bottom) * 0.5f);
// Parts
// Slices
const FSlateBrush* WhiteBrush = GetWhiteBrush();
const FSlateResourceHandle& ResourceHandle = WhiteBrush->GetRenderingResource();
const FVector2f AtlasUV = GetAtlasUV(ResourceHandle);
@@ -157,7 +158,7 @@ int32 SPSPieChart::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeom
++Layer;
}
// Etiquettes
// Labels
if (Pie.LabelType != EPSPieLabelType::None)
{
Angle = FMath::DegreesToRadians(Pie.StartAngleDegrees);
@@ -172,7 +173,7 @@ int32 SPSPieChart::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeom
const float MidAngle = Angle + Sweep * 0.5f;
Angle += Sweep;
// Trop petit pour une etiquette lisible
// Too small for a readable label
if (Slice.Value / Total < 0.01f)
{
continue;

View File

@@ -1,4 +1,5 @@
// PS_Charts - widget UMG histogramme
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - UMG bar chart widget
#pragma once
#include "CoreMinimal.h"
@@ -7,7 +8,7 @@
class SPSBarChart;
/** Histogramme natif (UMG) : barres verticales groupees par categorie. */
/** Native bar chart (UMG): vertical bars grouped by category. */
UCLASS(meta = (DisplayName = "PS Bar Chart"))
class PS_CHARTS_API UPSBarChart : public UPSCartesianChartBase
{
@@ -16,15 +17,15 @@ class PS_CHARTS_API UPSBarChart : public UPSCartesianChartBase
public:
UPSBarChart();
/** Proportion vide entre les categories (0..0.9). */
/** Empty ratio between categories (0..0.9). */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Bar", meta = (ClampMin = 0.0, ClampMax = 0.9))
float CategoryGapRatio = 0.25f;
/** Ecart entre les barres d'une meme categorie (0..0.9). */
/** Gap between the bars of the same category (0..0.9). */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Bar", meta = (ClampMin = 0.0, ClampMax = 0.9))
float BarGapRatio = 0.1f;
/** Affiche la valeur au-dessus de chaque barre. */
/** Displays the value above each bar. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Bar")
bool bShowValueLabels = false;

View File

@@ -1,22 +1,23 @@
// PS_Charts - base commune histogramme / courbes (donnees + axe des valeurs)
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - shared base of bar / line charts (data + value axis)
#pragma once
#include "CoreMinimal.h"
#include "PSChartWidgetBase.h"
#include "PSCartesianChartBase.generated.h"
/** Base des graphiques a axes (histogramme, courbes) : categories, series et axe des valeurs. */
/** Base of the axis-based charts (bar, line): categories, series and value axis. */
UCLASS(Abstract)
class PS_CHARTS_API UPSCartesianChartBase : public UPSChartWidgetBase
{
GENERATED_BODY()
public:
/** Etiquettes de l'axe X (une par point ; complete par des numeros si insuffisant). */
/** X axis labels (one per point; padded with numbers when missing). */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Data")
TArray<FString> Categories;
/** Series de valeurs. */
/** Value series. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Data")
TArray<FPSChartSeries> Series;
@@ -29,11 +30,11 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Axis")
FLinearColor AxisColor = FLinearColor(1.f, 1.f, 1.f, 0.5f);
/** Echelle automatique de l'axe des valeurs. */
/** Automatic scaling of the value axis. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Axis")
bool bAutoRange = true;
/** Force l'inclusion du zero dans l'echelle automatique. */
/** Forces zero into the automatic scale. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Axis", meta = (EditCondition = "bAutoRange"))
bool bIncludeZero = true;
@@ -43,27 +44,27 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Axis", meta = (EditCondition = "!bAutoRange"))
float AxisMaxValue = 100.f;
/** Unite ajoutee aux valeurs de l'axe (ex : " %"). */
/** Unit appended to the axis tick values (e.g. " %"). */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Axis")
FString ValueSuffix;
/** Remplace les etiquettes de l'axe X. */
/** Replaces the X axis labels. */
UFUNCTION(BlueprintCallable, Category = "ASTERION|PS_Charts|Data")
void SetCategories(const TArray<FString>& InCategories);
/** Remplace toutes les series. */
/** Replaces every series. */
UFUNCTION(BlueprintCallable, Category = "ASTERION|PS_Charts|Data")
void SetSeries(const TArray<FPSChartSeries>& InSeries);
/** Remplace les donnees par une serie unique. */
/** Replaces the data with a single series. */
UFUNCTION(BlueprintCallable, Category = "ASTERION|PS_Charts|Data")
void SetSingleSeries(const TArray<float>& InValues, const FString& InName = TEXT(""));
/** Met a jour les valeurs de la serie nommee (la cree si absente). */
/** Updates the values of the named series (creates it when missing). */
UFUNCTION(BlueprintCallable, Category = "ASTERION|PS_Charts|Data")
void SetSeriesValues(const FString& InName, const TArray<float>& InValues);
/** Supprime toutes les donnees. */
/** Removes all data. */
UFUNCTION(BlueprintCallable, Category = "ASTERION|PS_Charts|Data")
void ClearData();

View File

@@ -1,25 +1,26 @@
// PS_Charts - types partages entre les widgets Slate et UMG
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - types shared between the Slate and UMG widgets
#pragma once
#include "CoreMinimal.h"
#include "PSChartTypes.generated.h"
/** Position de la legende autour du graphique. */
/** Legend position around the chart. */
UENUM(BlueprintType)
enum class EPSChartLegendPosition : uint8
{
None UMETA(DisplayName = "Masquee"),
None UMETA(DisplayName = "Hidden"),
Top,
Bottom,
Left,
Right
};
/** Contenu des etiquettes affichees a cote des parts du camembert. */
/** Content of the labels displayed next to the pie slices. */
UENUM(BlueprintType)
enum class EPSPieLabelType : uint8
{
None UMETA(DisplayName = "Masquees"),
None UMETA(DisplayName = "Hidden"),
Name,
Value,
Percent,
@@ -27,7 +28,7 @@ enum class EPSPieLabelType : uint8
NamePercent
};
/** Une part de camembert. */
/** A single pie slice. */
USTRUCT(BlueprintType)
struct FPSPieSlice
{
@@ -39,7 +40,7 @@ struct FPSPieSlice
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart")
float Value = 0.f;
/** Si false, la couleur est prise automatiquement dans la palette du graphique. */
/** When false, the color is picked automatically from the chart palette. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart")
bool bUseCustomColor = false;
@@ -52,7 +53,7 @@ struct FPSPieSlice
{}
};
/** Une serie de valeurs (histogramme ou courbe). */
/** A series of values (bar or line chart). */
USTRUCT(BlueprintType)
struct FPSChartSeries
{
@@ -64,7 +65,7 @@ struct FPSChartSeries
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart")
TArray<float> Values;
/** Si false, la couleur est prise automatiquement dans la palette du graphique. */
/** When false, the color is picked automatically from the chart palette. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart")
bool bUseCustomColor = false;
@@ -78,10 +79,10 @@ struct FPSChartSeries
};
// ---------------------------------------------------------------------------
// Parametres passes des widgets UMG aux widgets Slate (non exposes a l'UHT)
// Parameters passed from the UMG widgets to the Slate widgets (not UHT-exposed)
// ---------------------------------------------------------------------------
/** Parametres communs a tous les graphiques. */
/** Parameters shared by every chart. */
struct FPSChartCommonParams
{
FText Title;
@@ -94,17 +95,17 @@ struct FPSChartCommonParams
FLinearColor BackgroundColor = FLinearColor::Transparent;
};
/** Parametres specifiques au camembert. */
/** Pie chart specific parameters. */
struct FPSPieParams
{
float InnerRadiusRatio = 0.f; // 0 = camembert plein, >0 = donut
float StartAngleDegrees = 0.f; // 0 = midi, sens horaire
float GapAngleDegrees = 0.f; // ecart angulaire entre les parts
float InnerRadiusRatio = 0.f; // 0 = full pie, >0 = donut
float StartAngleDegrees = 0.f; // 0 = twelve o'clock, clockwise
float GapAngleDegrees = 0.f; // angular gap between slices
EPSPieLabelType LabelType = EPSPieLabelType::NamePercent;
FString ValueSuffix; // unite ajoutee aux valeurs (ex : " %")
FString ValueSuffix; // unit appended to values (e.g. " %")
};
/** Parametres de l'axe des valeurs (histogramme / courbe). */
/** Value axis parameters (bar / line chart). */
struct FPSAxisParams
{
bool bShowGrid = true;
@@ -114,18 +115,18 @@ struct FPSAxisParams
bool bIncludeZero = true;
float MinValue = 0.f;
float MaxValue = 100.f;
FString ValueSuffix; // unite ajoutee aux valeurs de l'axe
FString ValueSuffix; // unit appended to the axis tick values
};
/** Parametres specifiques a l'histogramme. */
/** Bar chart specific parameters. */
struct FPSBarParams
{
float CategoryGapRatio = 0.25f; // proportion vide entre les categories
float BarGapRatio = 0.1f; // ecart entre les barres d'une meme categorie
float CategoryGapRatio = 0.25f; // empty ratio between categories
float BarGapRatio = 0.1f; // gap between bars of the same category
bool bShowValueLabels = false;
};
/** Parametres specifiques aux courbes. */
/** Line chart specific parameters. */
struct FPSLineParams
{
float Thickness = 2.f;
@@ -137,9 +138,9 @@ struct FPSLineParams
namespace PSCharts
{
/** Palette par defaut (10 couleurs). */
/** Default palette (10 colors). */
PS_CHARTS_API const TArray<FLinearColor>& DefaultPalette();
/** Couleur effective d'une part / serie selon la palette. */
/** Effective color of a slice / series based on the palette. */
PS_CHARTS_API FLinearColor ResolveColor(int32 Index, const TArray<FLinearColor>& Palette, bool bUseCustom, const FLinearColor& Custom);
}

View File

@@ -1,4 +1,5 @@
// PS_Charts - base commune des widgets UMG
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - shared base of the UMG chart widgets
#pragma once
#include "CoreMinimal.h"
@@ -6,7 +7,7 @@
#include "PSChartTypes.h"
#include "PSChartWidgetBase.generated.h"
/** Base commune des graphiques UMG : titre, palette, legende, couleurs de texte. */
/** Shared base of the UMG charts: title, palette, legend, text colors. */
UCLASS(Abstract)
class PS_CHARTS_API UPSChartWidgetBase : public UWidget
{
@@ -15,7 +16,7 @@ class PS_CHARTS_API UPSChartWidgetBase : public UWidget
public:
UPSChartWidgetBase();
/** Titre affiche en haut du graphique (vide = pas de titre). */
/** Title displayed at the top of the chart (empty = no title). */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Style")
FText Title;
@@ -25,29 +26,29 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Style", meta = (ClampMin = 6, ClampMax = 64))
float TitleFontSize = 16.f;
/** Couleur du texte (etiquettes, axes, legende). */
/** Text color (labels, axes, legend). */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Style")
FLinearColor TextColor = FLinearColor(0.9f, 0.9f, 0.9f);
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Style", meta = (ClampMin = 6, ClampMax = 32))
float FontSize = 11.f;
/** Couleurs attribuees automatiquement aux parts / series. */
/** Colors automatically assigned to slices / series. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Style")
TArray<FLinearColor> Palette;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Style")
EPSChartLegendPosition LegendPosition = EPSChartLegendPosition::Bottom;
/** Couleur de fond (transparent par defaut). */
/** Background color (transparent by default). */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Style")
FLinearColor BackgroundColor = FLinearColor::Transparent;
/** Change le titre du graphique. */
/** Changes the chart title. */
UFUNCTION(BlueprintCallable, Category = "ASTERION|PS_Charts|Style")
void SetChartTitle(FText InTitle);
/** Repousse toutes les proprietes vers le rendu (a appeler apres modification directe des proprietes en Blueprint). */
/** Pushes every property back to the rendering (call after editing properties directly in Blueprint). */
UFUNCTION(BlueprintCallable, Category = "ASTERION|PS_Charts|Style")
void Refresh();
@@ -58,7 +59,7 @@ public:
#endif
protected:
/** Pousse toutes les proprietes vers le widget Slate. */
/** Pushes every property to the Slate widget. */
virtual void ApplyToSlate() {}
FPSChartCommonParams MakeCommonParams() const;

View File

@@ -1,4 +1,5 @@
// PS_Charts - widget UMG courbes
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - UMG line chart widget
#pragma once
#include "CoreMinimal.h"
@@ -7,7 +8,7 @@
class SPSLineChart;
/** Graphique en courbes natif (UMG), multi-series. */
/** Native line chart (UMG), multi-series. */
UCLASS(meta = (DisplayName = "PS Line Chart"))
class PS_CHARTS_API UPSLineChart : public UPSCartesianChartBase
{
@@ -16,22 +17,22 @@ class PS_CHARTS_API UPSLineChart : public UPSCartesianChartBase
public:
UPSLineChart();
/** Epaisseur des courbes. */
/** Line thickness. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Line", meta = (ClampMin = 0.5, ClampMax = 16))
float Thickness = 2.f;
/** Affiche un point a chaque valeur. */
/** Displays a marker at each value. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Line")
bool bShowPoints = true;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Line", meta = (ClampMin = 1, ClampMax = 16, EditCondition = "bShowPoints"))
float PointRadius = 3.5f;
/** Lisse les courbes (interpolation Catmull-Rom). */
/** Smooths the lines (Catmull-Rom interpolation). */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Line")
bool bSmooth = false;
/** Affiche la valeur au-dessus de chaque point. */
/** Displays the value above each point. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Line")
bool bShowValueLabels = false;

View File

@@ -1,4 +1,5 @@
// PS_Charts - widget UMG camembert
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - UMG pie chart widget
#pragma once
#include "CoreMinimal.h"
@@ -7,7 +8,7 @@
class SPSPieChart;
/** Camembert / donut natif (UMG). */
/** Native pie / donut chart (UMG). */
UCLASS(meta = (DisplayName = "PS Pie Chart"))
class PS_CHARTS_API UPSPieChart : public UPSChartWidgetBase
{
@@ -16,43 +17,43 @@ class PS_CHARTS_API UPSPieChart : public UPSChartWidgetBase
public:
UPSPieChart();
/** Parts du camembert. */
/** Pie slices. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Data")
TArray<FPSPieSlice> Slices;
/** 0 = camembert plein, >0 = donut. */
/** 0 = full pie, >0 = donut. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Pie", meta = (ClampMin = 0.0, ClampMax = 0.9))
float InnerRadiusRatio = 0.f;
/** Angle de depart en degres (0 = midi, sens horaire). */
/** Start angle in degrees (0 = twelve o'clock, clockwise). */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Pie")
float StartAngleDegrees = 0.f;
/** Ecart angulaire entre les parts, en degres. */
/** Angular gap between slices, in degrees. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Pie", meta = (ClampMin = 0, ClampMax = 20))
float GapAngleDegrees = 0.f;
/** Contenu des etiquettes autour du camembert. */
/** Content of the labels around the pie. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Pie")
EPSPieLabelType LabelType = EPSPieLabelType::NamePercent;
/** Unite ajoutee aux valeurs (ex : " %"). */
/** Unit appended to values (e.g. " %"). */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Chart|Pie")
FString ValueSuffix;
/** Remplace toutes les parts. */
/** Replaces every slice. */
UFUNCTION(BlueprintCallable, Category = "ASTERION|PS_Charts|Data")
void SetSlices(const TArray<FPSPieSlice>& InSlices);
/** Remplace les parts a partir d'une map libelle -> valeur (couleurs automatiques). */
/** Replaces the slices from a label -> value map (automatic colors). */
UFUNCTION(BlueprintCallable, Category = "ASTERION|PS_Charts|Data")
void SetValues(const TMap<FString, float>& InValues);
/** Met a jour la valeur d'une part (la cree si absente). */
/** Updates the value of one slice (creates it when missing). */
UFUNCTION(BlueprintCallable, Category = "ASTERION|PS_Charts|Data")
void SetSliceValue(const FString& InLabel, float InValue);
/** Supprime toutes les parts. */
/** Removes every slice. */
UFUNCTION(BlueprintCallable, Category = "ASTERION|PS_Charts|Data")
void ClearData();

View File

@@ -1,11 +1,12 @@
// PS_Charts - histogramme Slate natif
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - native Slate bar chart
#pragma once
#include "CoreMinimal.h"
#include "Widgets/SLeafWidget.h"
#include "PSChartTypes.h"
/** Histogramme (barres verticales groupees) dessine entierement en Slate. */
/** Bar chart (grouped vertical bars) drawn entirely with Slate. */
class PS_CHARTS_API SPSBarChart : public SLeafWidget
{
public:

View File

@@ -1,11 +1,12 @@
// PS_Charts - courbes Slate natives
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - native Slate line chart
#pragma once
#include "CoreMinimal.h"
#include "Widgets/SLeafWidget.h"
#include "PSChartTypes.h"
/** Graphique en courbes (multi-series) dessine entierement en Slate. */
/** Line chart (multi-series) drawn entirely with Slate. */
class PS_CHARTS_API SPSLineChart : public SLeafWidget
{
public:

View File

@@ -1,11 +1,12 @@
// PS_Charts - camembert Slate natif
// Copyright ASTERION VR. All Rights Reserved.
// PS_Charts - native Slate pie chart
#pragma once
#include "CoreMinimal.h"
#include "Widgets/SLeafWidget.h"
#include "PSChartTypes.h"
/** Camembert / donut dessine entierement en Slate (aucune texture ni navigateur). */
/** Pie / donut chart drawn entirely with Slate (no texture, no web browser). */
class PS_CHARTS_API SPSPieChart : public SLeafWidget
{
public: