Debian Codegraph @

src/scene/x3d/auto_generated_node_helpers/x3dnodes_sphere.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 GetRadius: Single;
28 procedure SetRadius(const Value: Single);
29 function GetTexCoord: TX3DNode;
30 procedure SetTexCoord(const Value: TX3DNode);
31 function GetSlices: Integer;
32 procedure SetSlices(const Value: Integer);
33 function GetStacks: Integer;
34 procedure SetStacks(const Value: Integer);
35 public
36 { Create node fields and events. }
37 procedure CreateNode; override;
38 class function ClassX3DType: String; override;
39
40 strict private FFdRadius: TSFFloat;
41 { Internal wrapper for property @code(Radius). This wrapper API may change, we advise to access simpler @code(Radius) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
42 public property FdRadius: TSFFloat read FFdRadius;
43 { }
44 property Radius: Single read GetRadius write SetRadius;
45
46 strict private FFdSolid: TSFBool;
47 { Internal wrapper for property @code(Solid). This wrapper API may change, we advise to access simpler @code(Solid) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
48 public property FdSolid: TSFBool read FFdSolid;
49
50 strict private FFdTexCoord: TSFNode;
51 { Internal wrapper for property @code(TexCoord). This wrapper API may change, we advise to access simpler @code(TexCoord) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
52 public property FdTexCoord: TSFNode read FFdTexCoord;
53 { }
54 property TexCoord: TX3DNode read GetTexCoord write SetTexCoord;
55
56 strict private FFdSlices: TSFInt32;
57 { Internal wrapper for property @code(Slices). This wrapper API may change, we advise to access simpler @code(Slices) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
58 public property FdSlices: TSFInt32 read FFdSlices;
59 { How many "slices" to use to approximate the sphere. The sphere is rendered using polygons (triangles and quads) that approximate the sphere shape. The more slices, the more the sphere will look like a sphere. Slices divide the objects like slices of a pizza. The default value of 0 means to follow global variable @link(DefaultTriangulationSlices). }
60 property Slices: Integer read GetSlices write SetSlices;
61
62 strict private FFdStacks: TSFInt32;
63 { Internal wrapper for property @code(Stacks). This wrapper API may change, we advise to access simpler @code(Stacks) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
64 public property FdStacks: TSFInt32 read FFdStacks;
65 { How many "stacks" to use to approximate the sphere. The sphere is rendered using polygons (triangles and quads) that approximate the sphere shape. The more stacks, the more the sphere will look like a sphere. Stacks divide the objects like stacks of a tower. The default value of 0 means to follow global variable @link(DefaultTriangulationStacks). }
66 property Stacks: Integer read GetStacks write SetStacks;
67
68 {$endif read_interface}
69
70 {$ifdef read_implementation}
71
72 { TSphereNode ----------------------------------------------- }
73
74 function TSphereNode.GetRadius: Single;
75 begin
76 Result := FdRadius.Value;
77 end;
78
79 procedure TSphereNode.SetRadius(const Value: Single);
80 begin
81 FdRadius.Send(Value);
82 end;
83
84 function TSphereNode.GetTexCoord: TX3DNode;
85 begin
86 if FdTexCoord.Value is TX3DNode then
87 Result := TX3DNode(FdTexCoord.Value)
88 else
89 Result := nil;
90 end;
91
92 procedure TSphereNode.SetTexCoord(const Value: TX3DNode);
93 begin
94 FdTexCoord.Send(Value);
95 end;
96
97 function TSphereNode.GetSlices: Integer;
98 begin
99 Result := FdSlices.Value;
100 end;
101
102 procedure TSphereNode.SetSlices(const Value: Integer);
103 begin
104 FdSlices.Send(Value);
105 end;
106
107 function TSphereNode.GetStacks: Integer;
108 begin
109 Result := FdStacks.Value;
110 end;
111
112 procedure TSphereNode.SetStacks(const Value: Integer);
113 begin
114 FdStacks.Send(Value);
115 end;
116
117 class function TSphereNode.ClassX3DType: String;
118 begin
119 Result := 'Sphere';
120 end;
121
122 procedure TSphereNode.CreateNode;
123 begin
124 inherited;
125
126 FFdRadius := TSFFloat.Create(Self, False, 'radius', 1);
127 FdRadius.ChangeAlways := chGeometry;
128 FdRadius.MustBeNonnegative := true;
129 AddField(FFdRadius);
130
131 FFdSolid := TSFBool.Create(Self, False, 'solid', true);
132 FdSolid.ChangeAlways := chGeometry;
133 AddField(FFdSolid);
134
135 FFdTexCoord := TSFNode.Create(Self, True, 'texCoord', [TTextureCoordinateGeneratorNode, TProjectedTextureCoordinateNode, TMultiGeneratedTextureCoordinateNode]);
136 FdTexCoord.ChangeAlways := chGeometry;
137 FdTexCoord.OnBeforeValueChange := {$ifdef FPC}@{$endif}MoveShapeAssociations;
138 AddField(FFdTexCoord);
139
140 FFdSlices := TSFInt32.Create(Self, True, 'slices', 0);
141 FdSlices.ChangeAlways := chGeometry;
142 AddField(FFdSlices);
143
144 FFdStacks := TSFInt32.Create(Self, True, 'stacks', 0);
145 FdStacks.ChangeAlways := chGeometry;
146 AddField(FFdStacks);
147 end;
148
149 {$endif read_implementation}