UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GizmoElementLineBase.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"
10#include "GizmoElementLineBase.generated.h"
11
16UCLASS(Transient, Abstract, MinimalAPI)
18{
20public:
21
22 // Get line thickness for based on current element interaction state and view
23 INTERACTIVETOOLSFRAMEWORK_API virtual float GetCurrentLineThickness(bool bPerspectiveView, float InViewFOV) const;
24
25 // Line thickness when rendering lines, 0.0 is valid and will render thinnest line
26 INTERACTIVETOOLSFRAMEWORK_API virtual void SetLineThickness(float InLineThickness);
27 INTERACTIVETOOLSFRAMEWORK_API virtual float GetLineThickness() const;
28
29 // Multiplier applied to line thickness when hovering
30 INTERACTIVETOOLSFRAMEWORK_API virtual void SetHoverLineThicknessMultiplier(float InHoverLineThicknessMultiplier);
31 INTERACTIVETOOLSFRAMEWORK_API virtual float GetHoverLineThicknessMultiplier() const;
32
33 // Multiplier applied to line thickness when interacting
34 INTERACTIVETOOLSFRAMEWORK_API virtual void SetInteractLineThicknessMultiplier(float InInteractLineThicknessMultiplier);
35 INTERACTIVETOOLSFRAMEWORK_API virtual float GetInteractLineThicknessMultiplier() const;
36
37 // Multiplier applied to line thickness when selected
38 INTERACTIVETOOLSFRAMEWORK_API virtual void SetSelectLineThicknessMultiplier(float InSelectLineThicknessMultiplier);
39 INTERACTIVETOOLSFRAMEWORK_API virtual float GetSelectLineThicknessMultiplier() const;
40
41 // Multiplier applied to line thickness when subdued
42 INTERACTIVETOOLSFRAMEWORK_API virtual void SetSubdueLineThicknessMultiplier(float InSubdueLineThicknessMultiplier);
43 INTERACTIVETOOLSFRAMEWORK_API virtual float GetSubdueLineThicknessMultiplier() const;
44
45 // Whether line thickness is in screen space
46 INTERACTIVETOOLSFRAMEWORK_API virtual void SetScreenSpaceLine(bool bInScreenSpaceLine);
47 INTERACTIVETOOLSFRAMEWORK_API virtual bool GetScreenSpaceLine() const;
48
49 //
50 // Methods for managing line state attributes: LineColor, HoverLineColor, InteractLineColor, SelectLineColor, SubdueLineColor
51 //
52 // State inheritance works as follows:
53 // - Gizmo element state that is not set inherits from the corresponding state in the current render traversal.
54 // - Gizmo element state that is set replaces the corresponding state in the current render traversal, except in the case of overrides.
55 // - Gizmo element state that is set to override, will override any corresponding state in children.
56 //
57
58 // Set line render state line color attribute.
59 // @param InMaterial - line color to be set
60 // @param InOverridesChildState - when true, this line color will override the line color of all child elements.
61 INTERACTIVETOOLSFRAMEWORK_API virtual void SetLineColor(FLinearColor InColor, bool InOverridesChildState = false);
62
63 // Get line render state line color attribute's value.
64 INTERACTIVETOOLSFRAMEWORK_API virtual FLinearColor GetLineColor() const;
65
66 // Returns true if line render state line color attribute has been set.
67 INTERACTIVETOOLSFRAMEWORK_API virtual bool HasLineColor() const;
68
69 // Get line render state line color attribute's override setting.
70 INTERACTIVETOOLSFRAMEWORK_API virtual bool DoesLineColorOverrideChildState() const;
71
72 // Clear line render state line color attribute.
73 INTERACTIVETOOLSFRAMEWORK_API virtual void ClearLineColor();
74
75 // Set line render state hover line color attribute.
76 // @param InMaterial - hover line color to be set
77 // @param InOverridesChildState - when true, this hover line color will override the line color of all child elements.
78 INTERACTIVETOOLSFRAMEWORK_API virtual void SetHoverLineColor(FLinearColor InColor, bool InOverridesChildState = false);
79
80 // Get line render state hover line color attribute's value.
81 INTERACTIVETOOLSFRAMEWORK_API virtual FLinearColor GetHoverLineColor() const;
82
83 // Returns true if line render state hover line color attribute has been set.
84 INTERACTIVETOOLSFRAMEWORK_API virtual bool HasHoverLineColor() const;
85
86 // Get line render state hover line color attribute's override setting.
87 INTERACTIVETOOLSFRAMEWORK_API virtual bool DoesHoverLineColorOverrideChildState() const;
88
89 // Clear line render state hover line color attribute.
90 INTERACTIVETOOLSFRAMEWORK_API virtual void ClearHoverLineColor();
91
92 // Set line render state interact line color attribute.
93 // @param InMaterial - interact line color to be set
94 // @param InOverridesChildState - when true, this interact line color will override the line color of all child elements.
95 INTERACTIVETOOLSFRAMEWORK_API virtual void SetInteractLineColor(FLinearColor InColor, bool InOverridesChildState = false);
96
97 // Get line render state interact line color attribute's value.
98 INTERACTIVETOOLSFRAMEWORK_API virtual FLinearColor GetInteractLineColor() const;
99
100 // Returns true if line render state interact line color attribute has been set.
101 INTERACTIVETOOLSFRAMEWORK_API virtual bool HasInteractLineColor() const;
102
103 // Get line render state interact line color attribute's override setting.
104 INTERACTIVETOOLSFRAMEWORK_API virtual bool DoesInteractLineColorOverrideChildState() const;
105
106 // Clear line render state interact line color attribute.
107 INTERACTIVETOOLSFRAMEWORK_API virtual void ClearInteractLineColor();
108
109 // Set line render state Select line color attribute.
110 // @param InColor - Select line color to be set
111 // @param InOverridesChildState - when true, this Select line color will override the line color of all child elements.
112 INTERACTIVETOOLSFRAMEWORK_API virtual void SetSelectLineColor(FLinearColor InColor, bool InOverridesChildState = false);
113
114 // Get line render state interact line color attribute's value.
115 INTERACTIVETOOLSFRAMEWORK_API virtual FLinearColor GetSelectLineColor() const;
116
117 // Returns true if line render state interact line color attribute has been set.
118 INTERACTIVETOOLSFRAMEWORK_API virtual bool HasSelectLineColor() const;
119
120 // Get line render state interact line color attribute's override setting.
121 INTERACTIVETOOLSFRAMEWORK_API virtual bool DoesSelectLineColorOverrideChildState() const;
122
123 // Clear line render state interact line color attribute.
124 INTERACTIVETOOLSFRAMEWORK_API virtual void ClearSelectLineColor();
125
126 // Set line render state subdue line color attribute.
127 // @param InColor - subdue line color to be set
128 // @param InOverridesChildState - when true, this subdue line color will override the line color of all child elements.
129 INTERACTIVETOOLSFRAMEWORK_API virtual void SetSubdueLineColor(FLinearColor InColor, bool InOverridesChildState = false);
130
131 // Get line render state interact line color attribute's value.
132 INTERACTIVETOOLSFRAMEWORK_API virtual FLinearColor GetSubdueLineColor() const;
133
134 // Returns true if line render state interact line color attribute has been set.
135 INTERACTIVETOOLSFRAMEWORK_API virtual bool HasSubdueLineColor() const;
136
137 // Get line render state interact line color attribute's override setting.
138 INTERACTIVETOOLSFRAMEWORK_API virtual bool DoesSubdueLineColorOverrideChildState() const;
139
140 // Clear line render state interact line color attribute.
141 INTERACTIVETOOLSFRAMEWORK_API virtual void ClearSubdueLineColor();
142
143protected:
144
145 // Line render state attributes for this element
146 UPROPERTY()
148
149 // Line thickness when rendering lines, must be >= 0.0, value of 0.0 will render thinnest line
150 UPROPERTY()
151 float LineThickness = 0.0;
152
153 // Whether line thickness is in screen space
154 UPROPERTY()
155 bool bScreenSpaceLine = true;
156
157 // Multiplier applied to line thickness when hovering
158 UPROPERTY(EditAnywhere, Category = Options)
159 float HoverLineThicknessMultiplier = 2.0f;
160
161 // Multiplier applied to line thickness when interacting
162 UPROPERTY(EditAnywhere, Category = Options)
163 float InteractLineThicknessMultiplier = 2.0f;
164
165 // Multiplier applied to line thickness when selected
166 UPROPERTY(EditAnywhere, Category = Options)
167 float SelectLineThicknessMultiplier = 2.0f;
168
169 // Multiplier applied to line thickness when subdued
170 UPROPERTY(EditAnywhere, Category = Options)
171 float SubdueLineThicknessMultiplier = 1.0f;
172
173 // Update render state during render traversal, determines the current render state for this element
174 // @return view dependent visibility, true if this element is visible in the current view.
176};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition ToolContextInterfaces.h:427
Definition GizmoElementBase.h:26
Definition GizmoElementLineBase.h:18
Definition GizmoElementRenderState.h:164
Definition Color.h:48
Definition GizmoElementBase.h:52