Debian Codegraph @

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