Debian Codegraph @

src/scene/x3d/auto_generated_node_helpers/x3dnodes_lineset.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 GetColor: TAbstractColorNode;
28 procedure SetColor(const Value: TAbstractColorNode);
29 function GetCoord: TAbstractCoordinateNode;
30 procedure SetCoord(const Value: TAbstractCoordinateNode);
31 {$ifndef CASTLE_SLIM_NODES}
32 function GetFogCoord: TFogCoordinateNode;
33 procedure SetFogCoord(const Value: TFogCoordinateNode);
34 {$endif not CASTLE_SLIM_NODES}
35 function GetMode: TLineMode;
36 procedure SetMode(const Value: TLineMode);
37 public
38 { Create node fields and events. }
39 procedure CreateNode; override;
40 class function ClassX3DType: String; override;
41
42 {$ifndef CASTLE_SLIM_NODES}
43 strict private FFdAttrib: TMFNode;
44 { Internal wrapper for property @code(Attrib). This wrapper API may change, we advise to access simpler @code(Attrib) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
45 public property FdAttrib: TMFNode read FFdAttrib;
46 {$endif not CASTLE_SLIM_NODES}
47 {$ifndef CASTLE_SLIM_NODES}
48 { }
49 procedure SetAttrib(const Value: array of TAbstractVertexAttributeNode);
50 {$endif not CASTLE_SLIM_NODES}
51
52 strict private FFdColor: TSFNode;
53 { Internal wrapper for property @code(Color). This wrapper API may change, we advise to access simpler @code(Color) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
54 public property FdColor: TSFNode read FFdColor;
55 { }
56 property Color: TAbstractColorNode read GetColor write SetColor;
57
58 strict private FFdCoord: TSFNode;
59 { Internal wrapper for property @code(Coord). This wrapper API may change, we advise to access simpler @code(Coord) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
60 public property FdCoord: TSFNode read FFdCoord;
61 { }
62 property Coord: TAbstractCoordinateNode read GetCoord write SetCoord;
63
64 {$ifndef CASTLE_SLIM_NODES}
65 strict private FFdFogCoord: TSFNode;
66 { Internal wrapper for property @code(FogCoord). This wrapper API may change, we advise to access simpler @code(FogCoord) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
67 public property FdFogCoord: TSFNode read FFdFogCoord;
68 {$endif not CASTLE_SLIM_NODES}
69 {$ifndef CASTLE_SLIM_NODES}
70 { }
71 property FogCoord: TFogCoordinateNode read GetFogCoord write SetFogCoord;
72 {$endif not CASTLE_SLIM_NODES}
73
74 strict private FFdVertexCount: TMFInt32;
75 { Internal wrapper for property @code(VertexCount). This wrapper API may change, we advise to access simpler @code(VertexCount) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
76 public property FdVertexCount: TMFInt32 read FFdVertexCount;
77 { Array of counts that split the line vertexes. Exact interpretation depends on the @link(Mode) value:
78
79 @definitionList(
80 @itemLabel lmStrip
81 @item(Render a number of line strips.
82 Each count on this array is the count of vertexes in a line strip.
83 Each line strip is a polyline, i.e. a sequence of lines from the first vertex
84 (in given line strip) to the last vertex (again, in given line strip).)
85
86 @itemLabel lmLoop
87 @item(Render a number of line loops.
88 Each count on this array is the number of vertexes in a line loop.
89 Each line loop is a closed polyline, i.e. a sequence of lines from the first vertex
90 (in given line loop)
91 to the last vertex (again, in given line loop).
92 Moreover, within each line loop, there's a closing line from last vertex
93 to the first.)
94
95 @itemLabel lmPair
96 @item(Render a number of line segments.
97 Counts of this array are ignored, so there's not much point in calling SetVertexCount.
98 In this mode, every 2 vertexes define a line segment.)
99 ) }
100 procedure SetVertexCount(const Value: array of Int32); overload;
101 { Array of counts that split the line vertexes. Exact interpretation depends on the @link(Mode) value:
102
103 @definitionList(
104 @itemLabel lmStrip
105 @item(Render a number of line strips.
106 Each count on this array is the count of vertexes in a line strip.
107 Each line strip is a polyline, i.e. a sequence of lines from the first vertex
108 (in given line strip) to the last vertex (again, in given line strip).)
109
110 @itemLabel lmLoop
111 @item(Render a number of line loops.
112 Each count on this array is the number of vertexes in a line loop.
113 Each line loop is a closed polyline, i.e. a sequence of lines from the first vertex
114 (in given line loop)
115 to the last vertex (again, in given line loop).
116 Moreover, within each line loop, there's a closing line from last vertex
117 to the first.)
118
119 @itemLabel lmPair
120 @item(Render a number of line segments.
121 Counts of this array are ignored, so there's not much point in calling SetVertexCount.
122 In this mode, every 2 vertexes define a line segment.)
123 ) }
124 procedure SetVertexCount(const Value: TInt32List); overload;
125
126 strict private FFdMode: TSFStringEnum;
127 { Internal wrapper for property @code(Mode). This wrapper API may change, we advise to access simpler @code(Mode) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
128 public property FdMode: TSFStringEnum read FFdMode;
129 { How to interpret the vertexes: as a set of strips (connected line segments), loops (connected line segments with additional segment to form a loop), or just pairs of vertexes (each pair defines a line segment). See possible @link(TLineMode) values for details. }
130 property Mode: TLineMode read GetMode write SetMode;
131
132 {$endif read_interface}
133
134 {$ifdef read_implementation}
135
136 { TLineSetNode ----------------------------------------------- }
137
138 {$ifndef CASTLE_SLIM_NODES}
139 procedure TLineSetNode.SetAttrib(const Value: array of TAbstractVertexAttributeNode);
140 var
141 L: Integer;
142 A: array of TX3DNode;
143 begin
144 L := High(Value) + 1;
145 SetLength(A, L);
146 if L > 0 then
147 Move(Value[0], A[0], L * SizeOf(TAbstractVertexAttributeNode));
148 FdAttrib.Send(A);
149 end;
150
151 {$endif not CASTLE_SLIM_NODES}
152 function TLineSetNode.GetColor: TAbstractColorNode;
153 begin
154 if FdColor.Value is TAbstractColorNode then
155 Result := TAbstractColorNode(FdColor.Value)
156 else
157 Result := nil;
158 end;
159
160 procedure TLineSetNode.SetColor(const Value: TAbstractColorNode);
161 begin
162 FdColor.Send(Value);
163 end;
164
165 function TLineSetNode.GetCoord: TAbstractCoordinateNode;
166 begin
167 if FdCoord.Value is TAbstractCoordinateNode then
168 Result := TAbstractCoordinateNode(FdCoord.Value)
169 else
170 Result := nil;
171 end;
172
173 procedure TLineSetNode.SetCoord(const Value: TAbstractCoordinateNode);
174 begin
175 FdCoord.Send(Value);
176 end;
177
178 {$ifndef CASTLE_SLIM_NODES}
179 function TLineSetNode.GetFogCoord: TFogCoordinateNode;
180 begin
181 if FdFogCoord.Value is TFogCoordinateNode then
182 Result := TFogCoordinateNode(FdFogCoord.Value)
183 else
184 Result := nil;
185 end;
186
187 procedure TLineSetNode.SetFogCoord(const Value: TFogCoordinateNode);
188 begin
189 FdFogCoord.Send(Value);
190 end;
191
192 {$endif not CASTLE_SLIM_NODES}
193 procedure TLineSetNode.SetVertexCount(const Value: array of Int32);
194 begin
195 FdVertexCount.Send(Value);
196 end;
197
198 procedure TLineSetNode.SetVertexCount(const Value: TInt32List);
199 begin
200 FdVertexCount.Send(Value);
201 end;
202
203 function TLineSetNode.GetMode: TLineMode;
204 begin
205 Result := TLineMode(FdMode.EnumValue);
206 end;
207
208 procedure TLineSetNode.SetMode(const Value: TLineMode);
209 begin
210 FdMode.SendEnumValue(Ord(Value));
211 end;
212
213 class function TLineSetNode.ClassX3DType: String;
214 begin
215 Result := 'LineSet';
216 end;
217
218 procedure TLineSetNode.CreateNode;
219 begin
220 inherited;
221
222 {$ifndef CASTLE_SLIM_NODES}
223 FFdAttrib := TMFNode.Create(Self, True, 'attrib', [TAbstractVertexAttributeNode]);
224 FdAttrib.ChangeAlways := chGeometry;
225 AddField(FFdAttrib);
226 {$endif not CASTLE_SLIM_NODES}
227
228 FFdColor := TSFNode.Create(Self, True, 'color', [TAbstractColorNode]);
229 FdColor.ChangeAlways := chGeometry;
230 FdColor.OnBeforeValueChange := {$ifdef FPC}@{$endif}MoveShapeAssociations;
231 AddField(FFdColor);
232
233 FFdCoord := TSFNode.Create(Self, True, 'coord', [TAbstractCoordinateNode]);
234 FdCoord.ChangeAlways := chGeometry;
235 FdCoord.OnBeforeValueChange := {$ifdef FPC}@{$endif}MoveShapeAssociations;
236 AddField(FFdCoord);
237
238 {$ifndef CASTLE_SLIM_NODES}
239 FFdFogCoord := TSFNode.Create(Self, True, 'fogCoord', [TFogCoordinateNode]);
240 FdFogCoord.ChangeAlways := chGeometry;
241 AddField(FFdFogCoord);
242 {$endif not CASTLE_SLIM_NODES}
243
244 FFdVertexCount := TMFInt32.Create(Self, True, 'vertexCount', []);
245 FdVertexCount.ChangeAlways := chGeometry;
246 AddField(FFdVertexCount);
247
248 FFdMode := TSFStringEnum.Create(Self, False, 'mode', @LineModeNames, Ord(High(LineModeNames)) + 1, Ord(lmStrip));
249 FdMode.ChangeAlways := chGeometry;
250 AddField(FFdMode);
251 end;
252
253 {$endif read_implementation}