Debian Codegraph @

src/scene/x3d/auto_generated_node_helpers/x3dnodes_x3dnode.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 GetMetadata: TAbstractMetadataNode;
29 procedure SetMetadata(const Value: TAbstractMetadataNode);
30 {$endif not CASTLE_SLIM_NODES}
31 public
32 { Create node fields and events. }
33 procedure CreateNode; override;
34 class function ClassX3DType: String; override;
35
36 {$ifndef CASTLE_SLIM_NODES}
37 strict private FFdMetadata: TSFNode;
38 { Internal wrapper for property @code(Metadata). This wrapper API may change, we advise to access simpler @code(Metadata) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
39 public property FdMetadata: TSFNode read FFdMetadata;
40 {$endif not CASTLE_SLIM_NODES}
41 {$ifndef CASTLE_SLIM_NODES}
42 { }
43 property Metadata: TAbstractMetadataNode read GetMetadata write SetMetadata;
44 {$endif not CASTLE_SLIM_NODES}
45
46 {$endif read_interface}
47
48 {$ifdef read_implementation}
49
50 { TAbstractNode ----------------------------------------------- }
51
52 {$ifndef CASTLE_SLIM_NODES}
53 function TAbstractNode.GetMetadata: TAbstractMetadataNode;
54 begin
55 if FdMetadata.Value is TAbstractMetadataNode then
56 Result := TAbstractMetadataNode(FdMetadata.Value)
57 else
58 Result := nil;
59 end;
60
61 procedure TAbstractNode.SetMetadata(const Value: TAbstractMetadataNode);
62 begin
63 FdMetadata.Send(Value);
64 end;
65
66 {$endif not CASTLE_SLIM_NODES}
67 class function TAbstractNode.ClassX3DType: String;
68 begin
69 Result := 'X3DNode';
70 end;
71
72 procedure TAbstractNode.CreateNode;
73 begin
74 inherited;
75
76 {$ifndef CASTLE_SLIM_NODES}
77 FFdMetadata := TSFNode.Create(Self, True, 'metadata', [TAbstractMetadataNode]);
78 FdMetadata.ChangeAlways := chNone;
79 AddField(FFdMetadata);
80 {$endif not CASTLE_SLIM_NODES}
81 end;
82
83 {$endif read_implementation}