UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Progress.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "Core/Types.h"
5
6namespace UE::CADKernel
7{
8class FProgress;
9class FProgressBase;
10
12{
13 friend class FProgress;
14
15protected:
16
19
21 {
22 return RootProgress;
23 }
24
25 virtual void ActivateProgressBar(bool bActive)
26 {}
27
31 virtual void Update()
32 {}
33
34 double GetProgression() const;
35
39 virtual FString GetCurrentStep() const;
40
41 virtual void SetCurrentProgress(FProgress* InProgress);
42
44 {
45 return CurrentProgress;
46 }
47
48public:
50 : RootProgress(nullptr)
51 , CurrentProgress(nullptr)
52 {}
53};
54
56{
57 friend class FProgressManager;
58private:
59 FString Name;
60
61 FProgress* Parent = nullptr;
62 FProgress* UnderlyingProgress = nullptr;
63
64 int32 StepCount;
65 int32 Progression = 0;
66
67public:
68 FProgress(int32 InStepCount, const FString& InStepName = FString());
69
70 FProgress(const FString& StepName = FString())
71 : FProgress(1, StepName)
72 {
73 }
74
75 virtual ~FProgress();
76
77 const FString& GetName()
78 {
79 return Name;
80 }
81
83 {
84 return Parent;
85 }
86
90 void Increase(int32 StepSize = 1);
91
92protected:
93
94 bool IsRoot() const
95 {
96 return Parent == nullptr;
97 }
98
99 void AddUnderlying(FProgress* Progress)
100 {
101 UnderlyingProgress = Progress;
102 }
103
105 {
106 Progression++;
107 UnderlyingProgress = nullptr;
108 }
109
110 double GetProgression() const
111 {
112 double Ratio = ((double)Progression / (double)StepCount);
113
114 if (UnderlyingProgress)
115 {
116 Ratio += UnderlyingProgress->GetProgression() / (double)StepCount;
117 }
118 return Ratio;
119 }
120};
121}
122
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition Progress.h:12
FProgress * GetCurrentProgress() const
Definition Progress.h:43
FProgress * GetRoot() const
Definition Progress.h:20
FProgress * RootProgress
Definition Progress.h:17
virtual void Update()
Definition Progress.h:31
FProgressManager()
Definition Progress.h:49
FProgress * CurrentProgress
Definition Progress.h:18
virtual void ActivateProgressBar(bool bActive)
Definition Progress.h:25
Definition Progress.h:56
void AddUnderlying(FProgress *Progress)
Definition Progress.h:99
void UnderlyingFinished(FProgress *Progress)
Definition Progress.h:104
bool IsRoot() const
Definition Progress.h:94
double GetProgression() const
Definition Progress.h:110
FProgress(const FString &StepName=FString())
Definition Progress.h:70
FProgress * GetParent() const
Definition Progress.h:82
const FString & GetName()
Definition Progress.h:77
Definition CADEntity.cpp:23