Debian Codegraph @

src/scene/x3d/auto_generated_node_helpers/x3dnodes_staticgroup.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 GetBBox: TBox3D;
28 procedure SetBBox(const Value: TBox3D);
29 public
30 { Create node fields and events. }
31 procedure CreateNode; override;
32 class function ClassX3DType: String; override;
33
34 strict private FFdChildren: TMFNode;
35 { Internal wrapper for property @code(Children). This wrapper API may change, we advise to access simpler @code(Children) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
36 public property FdChildren: TMFNode read FFdChildren;
37 { }
38 procedure SetChildren(const Value: array of TAbstractChildNode);
39
40 strict private FFdBboxCenter: TSFVec3f;
41 { Internal wrapper for property @code(BboxCenter). This wrapper API may change, we advise to access simpler @code(BboxCenter) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
42 public property FdBboxCenter: TSFVec3f read FFdBboxCenter;
43 { }
44 property BBox: TBox3D read GetBBox write SetBBox;
45
46 strict private FFdBboxSize: TSFVec3f;
47 { Internal wrapper for property @code(BboxSize). This wrapper API may change, we advise to access simpler @code(BboxSize) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
48 public property FdBboxSize: TSFVec3f read FFdBboxSize;
49
50 {$endif read_interface}
51
52 {$ifdef read_implementation}
53
54 { TStaticGroupNode ----------------------------------------------- }
55
56 procedure TStaticGroupNode.SetChildren(const Value: array of TAbstractChildNode);
57 var
58 L: Integer;
59 A: array of TX3DNode;
60 begin
61 L := High(Value) + 1;
62 SetLength(A, L);
63 if L > 0 then
64 Move(Value[0], A[0], L * SizeOf(TAbstractChildNode));
65 FdChildren.Send(A);
66 end;
67
68 function TStaticGroupNode.GetBBox: TBox3D;
69 begin
70 Result := TBox3D.FromCenterSize(FdBBoxCenter.Value, FdBBoxSize.Value);
71 end;
72
73 procedure TStaticGroupNode.SetBBox(const Value: TBox3D);
74 var
75 ValueCenter, ValueSize: TVector3;
76 begin
77 Value.ToCenterSize(ValueCenter, ValueSize);
78 FdBBoxCenter.Send(ValueCenter);
79 FdBBoxSize.Send(ValueSize);
80 end;
81
82 class function TStaticGroupNode.ClassX3DType: String;
83 begin
84 Result := 'StaticGroup';
85 end;
86
87 procedure TStaticGroupNode.CreateNode;
88 begin
89 inherited;
90
91 FFdChildren := TMFNode.Create(Self, False, 'children', [TAbstractChildNode]);
92 FdChildren.ChangeAlways := chGroupChildren;
93 AddField(FFdChildren);
94
95 FFdBboxCenter := TSFVec3f.Create(Self, False, 'bboxCenter', Vector3(0, 0, 0));
96 FdBboxCenter.ChangeAlways := chVisibleNonGeometry;
97 AddField(FFdBboxCenter);
98
99 FFdBboxSize := TSFVec3f.Create(Self, False, 'bboxSize', Vector3(-1, -1, -1));
100 FdBboxSize.ChangeAlways := chVisibleNonGeometry;
101 AddField(FFdBboxSize);
102 end;
103
104 {$endif read_implementation}