UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IntervalGizmo.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "InteractiveGizmo.h"
13#include "BoxTypes.h"
14#include "IntervalGizmo.generated.h"
15
24
25
34UCLASS(Transient, NotPlaceable, Hidden, NotBlueprintable, NotBlueprintType, MinimalAPI)
36{
38public:
39
41
42public:
43
44 UPROPERTY()
45 TObjectPtr<UGizmoLineHandleComponent> UpIntervalComponent = nullptr;
46
47 UPROPERTY()
48 TObjectPtr<UGizmoLineHandleComponent> DownIntervalComponent = nullptr;
49
50 UPROPERTY()
51 TObjectPtr<UGizmoLineHandleComponent> ForwardIntervalComponent = nullptr;
52
53 UPROPERTY()
54 TObjectPtr<UGizmoLineHandleComponent> BackwardIntervalComponent = nullptr;
55
56 UPROPERTY()
57 TObjectPtr<UGizmoLineHandleComponent> RightIntervalComponent = nullptr;
58
59 UPROPERTY()
60 TObjectPtr<UGizmoLineHandleComponent> LeftIntervalComponent = nullptr;
61
62public:
68 UGizmoViewContext* GizmoViewContext);
69
70};
71
72
85{
86public:
91
100
101protected:
106 UGizmoViewContext* GizmoViewContext = nullptr;
107};
108
109
110
111UCLASS(MinimalAPI)
146
147
148UCLASS(MinimalAPI)
150{
152
153public:
154
156
157 INTERACTIVETOOLSFRAMEWORK_API virtual void SetWorld(UWorld* WorldIn);
158 INTERACTIVETOOLSFRAMEWORK_API virtual void SetGizmoActorBuilder(TSharedPtr<FIntervalGizmoActorFactory> Builder);
159 INTERACTIVETOOLSFRAMEWORK_API virtual void SetUpdateHoverFunction(TFunction<void(UPrimitiveComponent*, bool)> HoverFunction);
160 INTERACTIVETOOLSFRAMEWORK_API virtual void SetUpdateCoordSystemFunction(TFunction<void(UPrimitiveComponent*, EToolContextCoordinateSystem)> CoordSysFunction);
161
162 // UInteractiveGizmo overrides
163 INTERACTIVETOOLSFRAMEWORK_API virtual void Setup() override;
164 INTERACTIVETOOLSFRAMEWORK_API virtual void Shutdown() override;
165 INTERACTIVETOOLSFRAMEWORK_API virtual void Tick(float DeltaTime) override;
166
168 {
169 // Init all interval ranges to [0, +/- FLT_MAX] in the axis direction
170 HalfRange,
171 // Init all interval ranges to [-FLT_MAX, FLT_MAX]
172 FullRange,
173 // Init interval ranges to 'half range' if 'matched' by the opposite interval on the same axis, or 'full range' otherwise
174 HalfIfMatched
175 };
176
177 // Input parameter sources and related configuration
179 {
180 // +/- X axis parameter sources
181 UGizmoLocalFloatParameterSource* RightInterval = nullptr;
182 UGizmoLocalFloatParameterSource* LeftInterval = nullptr;
183 // +/- Y axis parameter sources
184 UGizmoLocalFloatParameterSource* ForwardInterval = nullptr;
185 UGizmoLocalFloatParameterSource* BackwardInterval = nullptr;
186 // +/- Z axis parameter sources
187 UGizmoLocalFloatParameterSource* UpInterval = nullptr;
188 UGizmoLocalFloatParameterSource* DownInterval = nullptr;
189
190 EDefaultParameterRanges InitParameterRanges = EDefaultParameterRanges::HalfIfMatched;
191
192 };
193
195 IToolContextTransactionProvider* TransactionProvider = nullptr);
197 IToolContextTransactionProvider* TransactionProvider = nullptr);
198
200 INTERACTIVETOOLSFRAMEWORK_API virtual void SetWorldAlignmentFunctions(
201 TUniqueFunction<bool()>&& ShouldAlignDestination,
202 TUniqueFunction<bool(const FRay&, FVector&)>&& DestinationAlignmentRayCaster
203 );
204
206 virtual void BeginEditSequence() { OnBeginIntervalGizmoEdit.Broadcast(this); }
207 virtual void EndEditSequence() { OnEndIntervalGizmoEdit.Broadcast(this); }
208
212 INTERACTIVETOOLSFRAMEWORK_API virtual void ClearSources();
213
217 INTERACTIVETOOLSFRAMEWORK_API virtual void ClearActiveTarget();
218
222 INTERACTIVETOOLSFRAMEWORK_API virtual FTransform GetGizmoTransform() const;
223
225 INTERACTIVETOOLSFRAMEWORK_API virtual void SetVisibility(bool bVisible);
226
228 UPROPERTY()
230
236 FOnIntervalChanged OnIntervalChanged;
237
240 FOnBeginIntervalEdit OnBeginIntervalGizmoEdit;
241
244 FOnEndIntervalEdit OnEndIntervalGizmoEdit;
246
248 UPROPERTY()
250
251 UPROPERTY()
252 TObjectPtr<AIntervalGizmoActor> GizmoActor = nullptr;
253
255 UPROPERTY()
256 TObjectPtr<UTransformProxy> TransformProxy = nullptr;
257
259 UPROPERTY()
260 TArray<TObjectPtr<UPrimitiveComponent>> ActiveComponents;
261
263 UPROPERTY()
265
266 // +/- Z axis parameter sources
267 UPROPERTY()
268 TObjectPtr<UGizmoLocalFloatParameterSource> UpIntervalSource = nullptr;
269 UPROPERTY()
270 TObjectPtr<UGizmoLocalFloatParameterSource> DownIntervalSource = nullptr;
271 // +/- Y axis parameter sources
272 UPROPERTY()
273 TObjectPtr<UGizmoLocalFloatParameterSource> ForwardIntervalSource = nullptr;
274 UPROPERTY()
275 TObjectPtr<UGizmoLocalFloatParameterSource> BackwardIntervalSource = nullptr;
276 // +/- X axis parameter sources
277 UPROPERTY()
278 TObjectPtr<UGizmoLocalFloatParameterSource> RightIntervalSource = nullptr;
279 UPROPERTY()
280 TObjectPtr<UGizmoLocalFloatParameterSource> LeftIntervalSource = nullptr;
281
283 UPROPERTY()
284 TObjectPtr<UGizmoComponentAxisSource> AxisXSource = nullptr;
285
287 UPROPERTY()
288 TObjectPtr<UGizmoComponentAxisSource> AxisYSource = nullptr;
289
291 UPROPERTY()
292 TObjectPtr<UGizmoComponentAxisSource> AxisZSource = nullptr;
293
296
297 // This function is called on each active GizmoActor Component to update it's hover state.
298 // If the Component is not a UGizmoBaseCmponent, the client needs to provide a different implementation
299 // of this function via the ToolBuilder
300 TFunction<void(UPrimitiveComponent*, bool)> UpdateHoverFunction;
301
302 // This function is called on each active GizmoActor Component to update it's coordinate system (eg world/local).
303 // If the Component is not a UGizmoBaseCmponent, the client needs to provide a different implementation
304 // of this function via the ToolBuilder
305 TFunction<void(UPrimitiveComponent*, EToolContextCoordinateSystem)> UpdateCoordSystemFunction;
306
307 TUniqueFunction<bool()> ShouldAlignDestination = []() { return false; };
308 TUniqueFunction<bool(const FRay&, FVector&)> DestinationAlignmentRayCaster = [](const FRay&, FVector&) {return false; };
309protected:
310
312 INTERACTIVETOOLSFRAMEWORK_API virtual UInteractiveGizmo* AddIntervalHandleGizmo(
313 USceneComponent* RootComponent,
314 UPrimitiveComponent* HandleComponent,
315 IGizmoAxisSource* AxisSource,
316 IGizmoFloatParameterSource* FloatParameterSource,
317 float MinParameter,
318 float MaxParameter,
320
321private:
322
323 // Valid ranges for intervals
324 UE::Geometry::FInterval1f UpIntervalRange, DownIntervalRange, ForwardIntervalRange, BackwardIntervalRange, RightIntervalRange, LeftIntervalRange;
325
326 // Call IterFn on each Source/Component combination where the Source is not null. Note IterFn will still be called if the component and/or axis are null.
328
329 // Call IterFn on each interval Component (including those without a Source)
331};
332
340UCLASS(MinimalAPI)
342{
344public:
345 INTERACTIVETOOLSFRAMEWORK_API virtual float GetParameter() const override;
346
347 INTERACTIVETOOLSFRAMEWORK_API virtual void SetParameter(float NewValue) override;
348
349 INTERACTIVETOOLSFRAMEWORK_API virtual void BeginModify();
350
351 INTERACTIVETOOLSFRAMEWORK_API virtual void EndModify();
352
353
354public:
355
356 UPROPERTY()
358
359public:
360
361 UPROPERTY()
362 float MinParameter;
363
364 UPROPERTY()
365 float MaxParameter;
366
367public:
368
374 float ParameterMin = -FLT_MAX,
375 float ParameterMax = FLT_MAX,
377};
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_MULTICAST_DELEGATE_ThreeParams(DelegateName, Param1Type, Param2Type, Param3Type)
Definition DelegateCombinations.h:67
#define DECLARE_MULTICAST_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:49
const bool
Definition NetworkReplayStreaming.h:178
UPackage * GetTransientPackage()
Definition Obj.cpp:5819
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UCLASS(...)
Definition ObjectMacros.h:776
void Construct(const FArguments &InArgs)
EToolContextCoordinateSystem
Definition ToolContextInterfaces.h:130
Definition GizmoActor.h:24
Definition IntervalGizmo.h:36
static INTERACTIVETOOLSFRAMEWORK_API AIntervalGizmoActor * ConstructDefaultIntervalGizmo(UWorld *World, UGizmoViewContext *GizmoViewContext)
Definition IntervalGizmo.cpp:143
Definition IntervalGizmo.h:85
virtual AIntervalGizmoActor * CreateNewGizmoActor(UWorld *World) const
Definition IntervalGizmo.h:96
FIntervalGizmoActorFactory(UGizmoViewContext *GizmoViewContextIn)
Definition IntervalGizmo.h:87
Definition GizmoInterfaces.h:64
Definition GizmoInterfaces.h:301
Definition GizmoInterfaces.h:272
Definition GizmoInterfaces.h:37
Definition InteractiveToolChange.h:39
Definition Array.h:670
Definition AssetRegistryState.h:50
Definition AndroidPlatformMisc.h:14
Definition ScriptInterface.h:139
Definition SharedPointer.h:692
Definition FunctionFwd.h:19
Definition IntervalGizmo.h:342
Definition ParameterSourcesFloat.h:49
Definition AxisSources.h:144
Definition GizmoLineHandleComponent.h:17
Definition ParameterSourcesFloat.h:87
Definition StateTargets.h:168
Definition GizmoViewContext.h:20
Definition InteractiveGizmoBuilder.h:19
Definition InteractiveGizmoManager.h:40
Definition InteractiveGizmo.h:29
Definition IntervalGizmo.h:113
TFunction< void(UPrimitiveComponent *, EToolContextCoordinateSystem)> UpdateCoordSystemFunction
Definition IntervalGizmo.h:141
TSharedPtr< FIntervalGizmoActorFactory > GizmoActorBuilder
Definition IntervalGizmo.h:121
TFunction< void(UPrimitiveComponent *, bool)> UpdateHoverFunction
Definition IntervalGizmo.h:131
Definition IntervalGizmo.h:150
virtual void EndEditSequence()
Definition IntervalGizmo.h:207
EDefaultParameterRanges
Definition IntervalGizmo.h:168
static INTERACTIVETOOLSFRAMEWORK_API FString GizmoName
Definition IntervalGizmo.h:155
virtual void BeginEditSequence()
Definition IntervalGizmo.h:206
Definition Object.h:95
Definition TransformProxy.h:40
Definition World.h:918
Definition ToolContextInterfaces.h:50
Definition ObjectPtr.h:488
Definition IntervalGizmo.h:179