Debian Codegraph @

src/scene/x3d/auto_generated_node_helpers/x3dnodes_appearance.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 {$ifndef CASTLE_SLIM_NODES}
28 function GetFillProperties: TFillPropertiesNode;
29 procedure SetFillProperties(const Value: TFillPropertiesNode);
30 {$endif not CASTLE_SLIM_NODES}
31 function GetLineProperties: TLinePropertiesNode;
32 procedure SetLineProperties(const Value: TLinePropertiesNode);
33 function GetMaterial: TAbstractMaterialNode;
34 procedure SetMaterial(const Value: TAbstractMaterialNode);
35 function GetTexture: TAbstractTextureNode;
36 procedure SetTexture(const Value: TAbstractTextureNode);
37 function GetTextureTransform: TAbstractTextureTransformNode;
38 procedure SetTextureTransform(const Value: TAbstractTextureTransformNode);
39 function GetBackMaterial: TAbstractOneSidedMaterialNode;
40 procedure SetBackMaterial(const Value: TAbstractOneSidedMaterialNode);
41 function GetAlphaMode: TAlphaMode;
42 procedure SetAlphaMode(const Value: TAlphaMode);
43 function GetAlphaCutoff: Single;
44 procedure SetAlphaCutoff(const Value: Single);
45 function GetShadowCaster: Boolean;
46 procedure SetShadowCaster(const Value: Boolean);
47 function GetNormalMap: TAbstractTexture2DNode;
48 procedure SetNormalMap(const Value: TAbstractTexture2DNode);
49 {$ifndef CASTLE_SLIM_NODES}
50 function GetHeightMap: TAbstractTexture2DNode;
51 procedure SetHeightMap(const Value: TAbstractTexture2DNode);
52 {$endif not CASTLE_SLIM_NODES}
53 function GetHeightMapScale: Single;
54 procedure SetHeightMapScale(const Value: Single);
55 function GetBlendMode: TBlendModeNode;
56 procedure SetBlendMode(const Value: TBlendModeNode);
57 function GetAlphaChannel: TAutoAlphaChannel;
58 procedure SetAlphaChannel(const Value: TAutoAlphaChannel);
59 public
60 { Create node fields and events. }
61 procedure CreateNode; override;
62 class function ClassX3DType: String; override;
63
64 {$ifndef CASTLE_SLIM_NODES}
65 strict private FFdFillProperties: TSFNode;
66 { Internal wrapper for property @code(FillProperties). This wrapper API may change, we advise to access simpler @code(FillProperties) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
67 public property FdFillProperties: TSFNode read FFdFillProperties;
68 {$endif not CASTLE_SLIM_NODES}
69 {$ifndef CASTLE_SLIM_NODES}
70 { }
71 property FillProperties: TFillPropertiesNode read GetFillProperties write SetFillProperties;
72 {$endif not CASTLE_SLIM_NODES}
73
74 strict private FFdLineProperties: TSFNode;
75 { Internal wrapper for property @code(LineProperties). This wrapper API may change, we advise to access simpler @code(LineProperties) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
76 public property FdLineProperties: TSFNode read FFdLineProperties;
77 { Properties how to display line geometry (line width and such). }
78 property LineProperties: TLinePropertiesNode read GetLineProperties write SetLineProperties;
79
80 strict private FFdMaterial: TSFNode;
81 { Internal wrapper for property @code(Material). This wrapper API may change, we advise to access simpler @code(Material) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
82 public property FdMaterial: TSFNode read FFdMaterial;
83 { Material determines how the shape looks, and how it interacts with lighting. }
84 property Material: TAbstractMaterialNode read GetMaterial write SetMaterial;
85
86 strict private FFdShaders: TMFNode;
87 { Internal wrapper for property @code(Shaders). This wrapper API may change, we advise to access simpler @code(Shaders) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
88 public property FdShaders: TMFNode read FFdShaders;
89 { Override shaders used for rendering this shape. Instead of this, it is usually better to use @link(SetEffects) -- the effects set that way are easier, cooperate with CGE built-in rendering features, and one code is more portable to both mobile and desktop. }
90 procedure SetShaders(const Value: array of TAbstractShaderNode);
91
92 strict private FFdTexture: TSFNode;
93 { Internal wrapper for property @code(Texture). This wrapper API may change, we advise to access simpler @code(Texture) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
94 public property FdTexture: TSFNode read FFdTexture;
95 { Main texture used by this appearance (diffuse texture for Phong lighting model, base texture for physical lighting model, emissive texture for the unlit lighting model). @deprecated It is more flexible to set the relevant texture inside material node, like @link(TMaterialNode.DiffuseTexture), @link(TPhysicalMaterialNode.BaseTexture), @link(TAbstractOneSidedMaterialNode.EmissiveTexture TUnlitMaterialNode.EmissiveTexture). }
96 property Texture: TAbstractTextureNode read GetTexture write SetTexture;
97
98 strict private FFdTextureTransform: TSFNode;
99 { Internal wrapper for property @code(TextureTransform). This wrapper API may change, we advise to access simpler @code(TextureTransform) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
100 public property FdTextureTransform: TSFNode read FFdTextureTransform;
101 { Texture transformation. }
102 property TextureTransform: TAbstractTextureTransformNode read GetTextureTransform write SetTextureTransform;
103
104 strict private FFdBackMaterial: TSFNode;
105 { Internal wrapper for property @code(BackMaterial). This wrapper API may change, we advise to access simpler @code(BackMaterial) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
106 public property FdBackMaterial: TSFNode read FFdBackMaterial;
107 { Alternative material to use for back faces (@italic(not implemented)). }
108 property BackMaterial: TAbstractOneSidedMaterialNode read GetBackMaterial write SetBackMaterial;
109
110 strict private FFdAlphaMode: TSFStringEnum;
111 { Internal wrapper for property @code(AlphaMode). This wrapper API may change, we advise to access simpler @code(AlphaMode) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
112 public property FdAlphaMode: TSFStringEnum read FFdAlphaMode;
113 { }
114 property AlphaMode: TAlphaMode read GetAlphaMode write SetAlphaMode;
115
116 strict private FFdAlphaCutoff: TSFFloat;
117 { Internal wrapper for property @code(AlphaCutoff). This wrapper API may change, we advise to access simpler @code(AlphaCutoff) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
118 public property FdAlphaCutoff: TSFFloat read FFdAlphaCutoff;
119 { }
120 property AlphaCutoff: Single read GetAlphaCutoff write SetAlphaCutoff;
121
122 strict private FFdReceiveShadows: TMFNode;
123 { Internal wrapper for property @code(ReceiveShadows). This wrapper API may change, we advise to access simpler @code(ReceiveShadows) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
124 public property FdReceiveShadows: TMFNode read FFdReceiveShadows;
125 { }
126 procedure SetReceiveShadows(const Value: array of TAbstractPunctualLightNode);
127
128 strict private FFdShadowCaster: TSFBool;
129 { Internal wrapper for property @code(ShadowCaster). This wrapper API may change, we advise to access simpler @code(ShadowCaster) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
130 public property FdShadowCaster: TSFBool read FFdShadowCaster;
131 { }
132 property ShadowCaster: Boolean read GetShadowCaster write SetShadowCaster;
133
134 strict private FFdNormalMap: TSFNode;
135 { Internal wrapper for property @code(NormalMap). This wrapper API may change, we advise to access simpler @code(NormalMap) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
136 public property FdNormalMap: TSFNode read FFdNormalMap;
137 { Normal map of this appearance. See https://castle-engine.io/x3d_implementation_texturing_extensions.php }
138 property NormalMap: TAbstractTexture2DNode read GetNormalMap write SetNormalMap;
139
140 {$ifndef CASTLE_SLIM_NODES}
141 strict private FFdHeightMap: TSFNode;
142 { Internal wrapper for property @code(HeightMap). This wrapper API may change, we advise to access simpler @code(HeightMap) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
143 public property FdHeightMap: TSFNode read FFdHeightMap;
144 {$endif not CASTLE_SLIM_NODES}
145 {$ifndef CASTLE_SLIM_NODES}
146 { Height map of this appearance. See https://castle-engine.io/x3d_implementation_texturing_extensions.php }
147 property HeightMap: TAbstractTexture2DNode read GetHeightMap write SetHeightMap;
148 {$endif not CASTLE_SLIM_NODES}
149
150 strict private FFdHeightMapScale: TSFFloat;
151 { Internal wrapper for property @code(HeightMapScale). This wrapper API may change, we advise to access simpler @code(HeightMapScale) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
152 public property FdHeightMapScale: TSFFloat read FFdHeightMapScale;
153 { }
154 property HeightMapScale: Single read GetHeightMapScale write SetHeightMapScale;
155
156 strict private FFdBlendMode: TSFNode;
157 { Internal wrapper for property @code(BlendMode). This wrapper API may change, we advise to access simpler @code(BlendMode) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
158 public property FdBlendMode: TSFNode read FFdBlendMode;
159 { Determines the exact blending equation used, in case @link(AlphaMode) indicates blending. See https://castle-engine.io/x3d_extensions.php }
160 property BlendMode: TBlendModeNode read GetBlendMode write SetBlendMode;
161
162 strict private FFdEffects: TMFNode;
163 { Internal wrapper for property @code(Effects). This wrapper API may change, we advise to access simpler @code(Effects) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
164 public property FdEffects: TMFNode read FFdEffects;
165 { Additional shader code for rendering this shape. See https://castle-engine.io/compositing_shaders.php . The shader effects they are easy to use, cooperate with CGE built-in rendering features, and one code is more portable to both mobile and desktop. }
166 procedure SetEffects(const Value: array of TEffectNode);
167
168 strict private FFdAlphaChannel: TSFStringEnum;
169 { Internal wrapper for property @code(AlphaChannel). This wrapper API may change, we advise to access simpler @code(AlphaChannel) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
170 public property FdAlphaChannel: TSFStringEnum read FFdAlphaChannel;
171 { }
172 property AlphaChannel: TAutoAlphaChannel read GetAlphaChannel write SetAlphaChannel;
173
174 {$endif read_interface}
175
176 {$ifdef read_implementation}
177
178 { TAppearanceNode ----------------------------------------------- }
179
180 {$ifndef CASTLE_SLIM_NODES}
181 function TAppearanceNode.GetFillProperties: TFillPropertiesNode;
182 begin
183 if FdFillProperties.Value is TFillPropertiesNode then
184 Result := TFillPropertiesNode(FdFillProperties.Value)
185 else
186 Result := nil;
187 end;
188
189 procedure TAppearanceNode.SetFillProperties(const Value: TFillPropertiesNode);
190 begin
191 FdFillProperties.Send(Value);
192 end;
193
194 {$endif not CASTLE_SLIM_NODES}
195 function TAppearanceNode.GetLineProperties: TLinePropertiesNode;
196 begin
197 if FdLineProperties.Value is TLinePropertiesNode then
198 Result := TLinePropertiesNode(FdLineProperties.Value)
199 else
200 Result := nil;
201 end;
202
203 procedure TAppearanceNode.SetLineProperties(const Value: TLinePropertiesNode);
204 begin
205 FdLineProperties.Send(Value);
206 end;
207
208 function TAppearanceNode.GetMaterial: TAbstractMaterialNode;
209 begin
210 if FdMaterial.Value is TAbstractMaterialNode then
211 Result := TAbstractMaterialNode(FdMaterial.Value)
212 else
213 Result := nil;
214 end;
215
216 procedure TAppearanceNode.SetMaterial(const Value: TAbstractMaterialNode);
217 begin
218 FdMaterial.Send(Value);
219 end;
220
221 procedure TAppearanceNode.SetShaders(const Value: array of TAbstractShaderNode);
222 var
223 L: Integer;
224 A: array of TX3DNode;
225 begin
226 L := High(Value) + 1;
227 SetLength(A, L);
228 if L > 0 then
229 Move(Value[0], A[0], L * SizeOf(TAbstractShaderNode));
230 FdShaders.Send(A);
231 end;
232
233 function TAppearanceNode.GetTexture: TAbstractTextureNode;
234 begin
235 if FdTexture.Value is TAbstractTextureNode then
236 Result := TAbstractTextureNode(FdTexture.Value)
237 else
238 Result := nil;
239 end;
240
241 procedure TAppearanceNode.SetTexture(const Value: TAbstractTextureNode);
242 begin
243 FdTexture.Send(Value);
244 end;
245
246 function TAppearanceNode.GetTextureTransform: TAbstractTextureTransformNode;
247 begin
248 if FdTextureTransform.Value is TAbstractTextureTransformNode then
249 Result := TAbstractTextureTransformNode(FdTextureTransform.Value)
250 else
251 Result := nil;
252 end;
253
254 procedure TAppearanceNode.SetTextureTransform(const Value: TAbstractTextureTransformNode);
255 begin
256 FdTextureTransform.Send(Value);
257 end;
258
259 function TAppearanceNode.GetBackMaterial: TAbstractOneSidedMaterialNode;
260 begin
261 if FdBackMaterial.Value is TAbstractOneSidedMaterialNode then
262 Result := TAbstractOneSidedMaterialNode(FdBackMaterial.Value)
263 else
264 Result := nil;
265 end;
266
267 procedure TAppearanceNode.SetBackMaterial(const Value: TAbstractOneSidedMaterialNode);
268 begin
269 FdBackMaterial.Send(Value);
270 end;
271
272 function TAppearanceNode.GetAlphaMode: TAlphaMode;
273 begin
274 Result := TAlphaMode(FdAlphaMode.EnumValue);
275 end;
276
277 procedure TAppearanceNode.SetAlphaMode(const Value: TAlphaMode);
278 begin
279 FdAlphaMode.SendEnumValue(Ord(Value));
280 end;
281
282 function TAppearanceNode.GetAlphaCutoff: Single;
283 begin
284 Result := FdAlphaCutoff.Value;
285 end;
286
287 procedure TAppearanceNode.SetAlphaCutoff(const Value: Single);
288 begin
289 FdAlphaCutoff.Send(Value);
290 end;
291
292 procedure TAppearanceNode.SetReceiveShadows(const Value: array of TAbstractPunctualLightNode);
293 var
294 L: Integer;
295 A: array of TX3DNode;
296 begin
297 L := High(Value) + 1;
298 SetLength(A, L);
299 if L > 0 then
300 Move(Value[0], A[0], L * SizeOf(TAbstractPunctualLightNode));
301 FdReceiveShadows.Send(A);
302 end;
303
304 function TAppearanceNode.GetShadowCaster: Boolean;
305 begin
306 Result := FdShadowCaster.Value;
307 end;
308
309 procedure TAppearanceNode.SetShadowCaster(const Value: Boolean);
310 begin
311 FdShadowCaster.Send(Value);
312 end;
313
314 function TAppearanceNode.GetNormalMap: TAbstractTexture2DNode;
315 begin
316 if FdNormalMap.Value is TAbstractTexture2DNode then
317 Result := TAbstractTexture2DNode(FdNormalMap.Value)
318 else
319 Result := nil;
320 end;
321
322 procedure TAppearanceNode.SetNormalMap(const Value: TAbstractTexture2DNode);
323 begin
324 FdNormalMap.Send(Value);
325 end;
326
327 {$ifndef CASTLE_SLIM_NODES}
328 function TAppearanceNode.GetHeightMap: TAbstractTexture2DNode;
329 begin
330 if FdHeightMap.Value is TAbstractTexture2DNode then
331 Result := TAbstractTexture2DNode(FdHeightMap.Value)
332 else
333 Result := nil;
334 end;
335
336 procedure TAppearanceNode.SetHeightMap(const Value: TAbstractTexture2DNode);
337 begin
338 FdHeightMap.Send(Value);
339 end;
340
341 {$endif not CASTLE_SLIM_NODES}
342 function TAppearanceNode.GetHeightMapScale: Single;
343 begin
344 Result := FdHeightMapScale.Value;
345 end;
346
347 procedure TAppearanceNode.SetHeightMapScale(const Value: Single);
348 begin
349 FdHeightMapScale.Send(Value);
350 end;
351
352 function TAppearanceNode.GetBlendMode: TBlendModeNode;
353 begin
354 if FdBlendMode.Value is TBlendModeNode then
355 Result := TBlendModeNode(FdBlendMode.Value)
356 else
357 Result := nil;
358 end;
359
360 procedure TAppearanceNode.SetBlendMode(const Value: TBlendModeNode);
361 begin
362 FdBlendMode.Send(Value);
363 end;
364
365 procedure TAppearanceNode.SetEffects(const Value: array of TEffectNode);
366 var
367 L: Integer;
368 A: array of TX3DNode;
369 begin
370 L := High(Value) + 1;
371 SetLength(A, L);
372 if L > 0 then
373 Move(Value[0], A[0], L * SizeOf(TEffectNode));
374 FdEffects.Send(A);
375 end;
376
377 function TAppearanceNode.GetAlphaChannel: TAutoAlphaChannel;
378 begin
379 Result := TAutoAlphaChannel(FdAlphaChannel.EnumValue);
380 end;
381
382 procedure TAppearanceNode.SetAlphaChannel(const Value: TAutoAlphaChannel);
383 begin
384 FdAlphaChannel.SendEnumValue(Ord(Value));
385 end;
386
387 class function TAppearanceNode.ClassX3DType: String;
388 begin
389 Result := 'Appearance';
390 end;
391
392 procedure TAppearanceNode.CreateNode;
393 begin
394 inherited;
395
396 {$ifndef CASTLE_SLIM_NODES}
397 FFdFillProperties := TSFNode.Create(Self, True, 'fillProperties', [TFillPropertiesNode]);
398 FdFillProperties.ChangeAlways := chVisibleNonGeometry;
399 AddField(FFdFillProperties);
400 {$endif not CASTLE_SLIM_NODES}
401
402 FFdLineProperties := TSFNode.Create(Self, True, 'lineProperties', [TLinePropertiesNode]);
403 FdLineProperties.ChangeAlways := chVisibleNonGeometry;
404 AddField(FFdLineProperties);
405
406 FFdMaterial := TSFNode.Create(Self, True, 'material', [TAbstractMaterialNode]);
407 FdMaterial.ChangeAlways := chEverything;
408 FdMaterial.OnBeforeValueChange := {$ifdef FPC}@{$endif}MoveShapeAssociations;
409 AddField(FFdMaterial);
410
411 FFdShaders := TMFNode.Create(Self, True, 'shaders', [TAbstractShaderNode]);
412 FdShaders.ChangeAlways := chEverything;
413 AddField(FFdShaders);
414
415 FFdTexture := TSFNode.Create(Self, True, 'texture', [TAbstractTextureNode]);
416 FdTexture.ChangeAlways := chEverything;
417 AddField(FFdTexture);
418
419 FFdTextureTransform := TSFNode.Create(Self, True, 'textureTransform', [TAbstractTextureTransformNode]);
420 FdTextureTransform.ChangeAlways := chEverything;
421 AddField(FFdTextureTransform);
422
423 FFdBackMaterial := TSFNode.Create(Self, True, 'backMaterial', [TAbstractOneSidedMaterialNode]);
424 FdBackMaterial.ChangeAlways := chNone;
425 AddField(FFdBackMaterial);
426
427 FFdAlphaMode := TSFStringEnum.Create(Self, True, 'alphaMode', @AlphaModeToString, Ord(High(AlphaModeToString)) + 1, Ord(amAuto));
428 FdAlphaMode.ChangeAlways := chVisibleNonGeometry;
429 AddField(FFdAlphaMode);
430
431 FFdAlphaCutoff := TSFFloat.Create(Self, True, 'alphaCutoff', 0.5);
432 FdAlphaCutoff.ChangeAlways := chVisibleNonGeometry;
433 FdAlphaCutoff.MustBeNonnegative := true;
434 AddField(FFdAlphaCutoff);
435
436 FFdReceiveShadows := TMFNode.Create(Self, False, 'receiveShadows', [TAbstractPunctualLightNode]);
437 FdReceiveShadows.ChangeAlways := chShadowMaps;
438 AddField(FFdReceiveShadows);
439
440 FFdShadowCaster := TSFBool.Create(Self, True, 'shadowCaster', true);
441 FdShadowCaster.ChangeAlways := chShadowCasters;
442 AddField(FFdShadowCaster);
443
444 FFdNormalMap := TSFNode.Create(Self, True, 'normalMap', [TAbstractTexture2DNode]);
445 FdNormalMap.ChangeAlways := chEverything;
446 AddField(FFdNormalMap);
447
448 {$ifndef CASTLE_SLIM_NODES}
449 FFdHeightMap := TSFNode.Create(Self, True, 'heightMap', [TAbstractTexture2DNode]);
450 FdHeightMap.ChangeAlways := chVisibleNonGeometry;
451 AddField(FFdHeightMap);
452 {$endif not CASTLE_SLIM_NODES}
453
454 FFdHeightMapScale := TSFFloat.Create(Self, True, 'heightMapScale', 0.01);
455 FdHeightMapScale.ChangeAlways := chVisibleNonGeometry;
456 AddField(FFdHeightMapScale);
457
458 FFdBlendMode := TSFNode.Create(Self, True, 'blendMode', [TBlendModeNode]);
459 FdBlendMode.ChangeAlways := chEverything;
460 AddField(FFdBlendMode);
461
462 FFdEffects := TMFNode.Create(Self, False, 'effects', [TEffectNode]);
463 FdEffects.ChangeAlways := chEverything;
464 AddField(FFdEffects);
465
466 FFdAlphaChannel := TSFStringEnum.Create(Self, True, 'alphaChannel', @AlphaToString, Ord(High(AlphaToString)) + 1, Ord(acAuto));
467 FdAlphaChannel.ChangeAlways := chVisibleNonGeometry;
468 AddField(FFdAlphaChannel);
469
470 DefaultContainerField := 'appearance';
471 end;
472
473 {$endif read_implementation}