Debian Codegraph @

src/scene/x3d/auto_generated_node_helpers/x3dnodes_generatedshadowmap.inc

raw
1 { -*- buffer-read-only: t -*-
2
3 Copyright 2015-2024 Michalis Kamburelis.
4
5 This file is part of "Castle Game Engine".
6
7 "Castle Game Engine" is free software; see the file COPYING.txt,
8 included in this distribution, for details about the copyright.
9
10 "Castle Game Engine" is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
14 ----------------------------------------------------------------------------
15 }
16
17 { Automatically generated node properties.
18
19 Do not edit this file manually!
20 To add new properties:
21 - add them to the text files in tools/internal/x3d-nodes-to-pascal/nodes-specification/ ,
22 - and regenerate include files by running x3d-nodes-to-pascal }
23
24 {$ifdef read_interface}
25
26 strict private
27 function GetUpdate: TTextureUpdate;
28 procedure SetUpdate(const Value: TTextureUpdate);
29 function GetSize: Integer;
30 procedure SetSize(const Value: Integer);
31 function GetLight: TAbstractPunctualLightNode;
32 procedure SetLight(const Value: TAbstractPunctualLightNode);
33 function GetScale: Single;
34 procedure SetScale(const Value: Single);
35 function GetBias: Single;
36 procedure SetBias(const Value: Single);
37 function GetCompareMode: TShadowMapCompareMode;
38 procedure SetCompareMode(const Value: TShadowMapCompareMode);
39 public
40 { Create node fields and events. }
41 procedure CreateNode; override;
42 class function ClassX3DType: String; override;
43
44 strict private FFdUpdate: TSFStringEnum;
45 { Internal wrapper for property @code(Update). This wrapper API may change, we advise to access simpler @code(Update) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
46 public property FdUpdate: TSFStringEnum read FFdUpdate;
47 { When to update the texture contents. }
48 property Update: TTextureUpdate read GetUpdate write SetUpdate;
49
50 strict private FFdSize: TSFInt32;
51 { Internal wrapper for property @code(Size). This wrapper API may change, we advise to access simpler @code(Size) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
52 public property FdSize: TSFInt32 read FFdSize;
53 { }
54 property Size: Integer read GetSize write SetSize;
55
56 strict private FFdLight: TSFNode;
57 { Internal wrapper for property @code(Light). This wrapper API may change, we advise to access simpler @code(Light) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
58 public property FdLight: TSFNode read FFdLight;
59 { @deprecated This field is only used internally by the engine now. You should never specify any light source here. The light source associated with the shadow map is implicit: it is the parent node of this GeneratedShadowMap node, that defined this GeneratedShadowMap node in defaultShadowMap field. }
60 property Light: TAbstractPunctualLightNode read GetLight write SetLight;
61
62 strict private FFdScale: TSFFloat;
63 { Internal wrapper for property @code(Scale). This wrapper API may change, we advise to access simpler @code(Scale) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
64 public property FdScale: TSFFloat read FFdScale;
65 { }
66 property Scale: Single read GetScale write SetScale;
67
68 strict private FFdBias: TSFFloat;
69 { Internal wrapper for property @code(Bias). This wrapper API may change, we advise to access simpler @code(Bias) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
70 public property FdBias: TSFFloat read FFdBias;
71 { }
72 property Bias: Single read GetBias write SetBias;
73
74 strict private FFdCompareMode: TSFStringEnum;
75 { Internal wrapper for property @code(CompareMode). This wrapper API may change, we advise to access simpler @code(CompareMode) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
76 public property FdCompareMode: TSFStringEnum read FFdCompareMode;
77 { @deprecated This is ignored now. It was unportable and complicated to maintain. }
78 property CompareMode: TShadowMapCompareMode read GetCompareMode write SetCompareMode;
79
80 {$endif read_interface}
81
82 {$ifdef read_implementation}
83
84 { TGeneratedShadowMapNode ----------------------------------------------- }
85
86 function TGeneratedShadowMapNode.GetUpdate: TTextureUpdate;
87 begin
88 Result := TTextureUpdate(FdUpdate.EnumValue);
89 end;
90
91 procedure TGeneratedShadowMapNode.SetUpdate(const Value: TTextureUpdate);
92 begin
93 FdUpdate.SendEnumValue(Ord(Value));
94 end;
95
96 function TGeneratedShadowMapNode.GetSize: Integer;
97 begin
98 Result := FdSize.Value;
99 end;
100
101 procedure TGeneratedShadowMapNode.SetSize(const Value: Integer);
102 begin
103 FdSize.Send(Value);
104 end;
105
106 function TGeneratedShadowMapNode.GetLight: TAbstractPunctualLightNode;
107 begin
108 if FdLight.Value is TAbstractPunctualLightNode then
109 Result := TAbstractPunctualLightNode(FdLight.Value)
110 else
111 Result := nil;
112 end;
113
114 procedure TGeneratedShadowMapNode.SetLight(const Value: TAbstractPunctualLightNode);
115 begin
116 FdLight.Send(Value);
117 end;
118
119 function TGeneratedShadowMapNode.GetScale: Single;
120 begin
121 Result := FdScale.Value;
122 end;
123
124 procedure TGeneratedShadowMapNode.SetScale(const Value: Single);
125 begin
126 FdScale.Send(Value);
127 end;
128
129 function TGeneratedShadowMapNode.GetBias: Single;
130 begin
131 Result := FdBias.Value;
132 end;
133
134 procedure TGeneratedShadowMapNode.SetBias(const Value: Single);
135 begin
136 FdBias.Send(Value);
137 end;
138
139 function TGeneratedShadowMapNode.GetCompareMode: TShadowMapCompareMode;
140 begin
141 Result := TShadowMapCompareMode(FdCompareMode.EnumValue);
142 end;
143
144 procedure TGeneratedShadowMapNode.SetCompareMode(const Value: TShadowMapCompareMode);
145 begin
146 FdCompareMode.SendEnumValue(Ord(Value));
147 end;
148
149 class function TGeneratedShadowMapNode.ClassX3DType: String;
150 begin
151 Result := 'GeneratedShadowMap';
152 end;
153
154 procedure TGeneratedShadowMapNode.CreateNode;
155 begin
156 inherited;
157
158 FFdUpdate := TSFStringEnum.Create(Self, True, 'update', @TextureUpdateNames, Ord(High(TextureUpdateNames)) + 1, Ord(upNone));
159 FdUpdate.ChangeAlways := chRedisplay;
160 AddField(FFdUpdate);
161
162 FFdSize := TSFInt32.Create(Self, False, 'size', 128);
163 FdSize.ChangeAlways := chTextureRendererProperties;
164 FdSize.MustBeNonnegative := true;
165 AddField(FFdSize);
166
167 FFdLight := TSFNode.Create(Self, False, 'light', [TAbstractPunctualLightNode]);
168 FdLight.ChangeAlways := chGeneratedTextureUpdateNeeded;
169 FdLight.WeakLink := true;
170 AddField(FFdLight);
171
172 FFdScale := TSFFloat.Create(Self, True, 'scale', DefaultScale);
173 FdScale.ChangeAlways := chGeneratedTextureUpdateNeeded;
174 FdScale.MustBeNonnegative := true;
175 AddField(FFdScale);
176
177 FFdBias := TSFFloat.Create(Self, True, 'bias', DefaultBias);
178 FdBias.ChangeAlways := chGeneratedTextureUpdateNeeded;
179 FdBias.MustBeNonnegative := true;
180 AddField(FFdBias);
181
182 FFdCompareMode := TSFStringEnum.Create(Self, False, 'compareMode', @CompareModeNames, Ord(High(CompareModeNames)) + 1, Ord(smCompareRLEqual));
183 FdCompareMode.ChangeAlways := chTextureRendererProperties;
184 AddField(FFdCompareMode);
185 end;
186
187 {$endif read_implementation}