PyVRML97 2.3.4b3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,648 @@
1
+ """Base VRML97 node prototypes"""
2
+ from vrml.vrml97 import nodetypes, transformmatrix
3
+ from vrml import node, field, fieldtypes, cache
4
+ class Anchor( nodetypes.Children, nodetypes.Grouping, node.Node ):
5
+ PROTO = 'Anchor'
6
+ #Fields
7
+ url = field.newField( 'url', 'MFString', 1, list)
8
+ description = field.newField( 'description', 'SFString', 1, '')
9
+ bboxCenter = field.newField( 'bboxCenter', 'SFVec3f', 0, [0.0, 0.0, 0.0])
10
+ parameter = field.newField( 'parameter', 'MFString', 1, list)
11
+ children = field.newField( 'children', 'MFNode', 1, list)
12
+ bboxSize = field.newField( 'bboxSize', 'SFVec3f', 0, [-1.0, -1.0, -1.0])
13
+ #Events
14
+ removeChildren = field.newEvent( 'removeChildren', 'MFNode', 0)
15
+ addChildren = field.newEvent( 'addChildren', 'MFNode', 0)
16
+
17
+ class Appearance( node.Node ):
18
+ PROTO = 'Appearance'
19
+ #Fields
20
+ material = field.newField( 'material', 'SFNode', 1, node.NULL)
21
+ texture = field.newField( 'texture', 'SFNode', 1, node.NULL)
22
+ textureTransform = field.newField( 'textureTransform', 'SFNode', 1, node.NULL)
23
+ #Events
24
+
25
+
26
+ class AudioClip( nodetypes.Auditory, nodetypes.TimeDependent, node.Node ):
27
+ PROTO = 'AudioClip'
28
+ #Fields
29
+ stopTime = field.newField( 'stopTime', 'SFTime', 1, 0.0)
30
+ description = field.newField( 'description', 'SFString', 1, '')
31
+ startTime = field.newField( 'startTime', 'SFTime', 1, 0.0)
32
+ pitch = field.newField( 'pitch', 'SFFloat', 1, 1.0)
33
+ url = field.newField( 'url', 'MFString', 1, list)
34
+ loop = field.newField( 'loop', 'SFBool', 1, 0)
35
+ #Events
36
+ duration_changed = field.newEvent( 'duration_changed', 'SFTime', 1)
37
+ isActive = field.newEvent( 'isActive', 'SFBool', 1)
38
+
39
+ class Background( nodetypes.Children, nodetypes.Background, node.Node ):
40
+ PROTO = 'Background'
41
+ #Fields
42
+ groundAngle = field.newField( 'groundAngle', 'MFFloat', 1, list)
43
+ rightUrl = field.newField( 'rightUrl', 'MFString', 1, list)
44
+ topUrl = field.newField( 'topUrl', 'MFString', 1, list)
45
+ backUrl = field.newField( 'backUrl', 'MFString', 1, list)
46
+ groundColor = field.newField( 'groundColor', 'MFColor', 1, list)
47
+ leftUrl = field.newField( 'leftUrl', 'MFString', 1, list)
48
+ frontUrl = field.newField( 'frontUrl', 'MFString', 1, list)
49
+ bottomUrl = field.newField( 'bottomUrl', 'MFString', 1, list)
50
+ skyColor = field.newField( 'skyColor', 'MFColor', 1, [[0.0, 0.0, 0.0]])
51
+ skyAngle = field.newField( 'skyAngle', 'MFFloat', 1, list)
52
+ #Events
53
+ set_bind = field.newEvent( 'set_bind', 'SFBool', 0)
54
+ isBound = field.newEvent( 'isBound', 'SFBool', 1)
55
+
56
+ class Billboard( nodetypes.Children, nodetypes.Transforming, node.Node ):
57
+ PROTO = 'Billboard'
58
+ #Fields
59
+ bboxCenter = field.newField( 'bboxCenter', 'SFVec3f', 0, [0.0, 0.0, 0.0])
60
+ axisOfRotation = field.newField( 'axisOfRotation', 'SFVec3f', 1, [0.0, 1.0, 0.0])
61
+ children = field.newField( 'children', 'MFNode', 1, list)
62
+ bboxSize = field.newField( 'bboxSize', 'SFVec3f', 0, [-1.0, -1.0, -1.0])
63
+ #Events
64
+ removeChildren = field.newEvent( 'removeChildren', 'MFNode', 0)
65
+ addChildren = field.newEvent( 'addChildren', 'MFNode', 0)
66
+
67
+ class Box( nodetypes.Geometry, node.Node ):
68
+ PROTO = 'Box'
69
+ #Fields
70
+ size = field.newField( 'size', 'SFVec3f', 0, [2.0, 2.0, 2.0])
71
+ #Events
72
+
73
+
74
+ class Collision( nodetypes.Children, nodetypes.Grouping, node.Node ):
75
+ PROTO = 'Collision'
76
+ #Fields
77
+ bboxCenter = field.newField( 'bboxCenter', 'SFVec3f', 0, [0.0, 0.0, 0.0])
78
+ collide = field.newField( 'collide', 'SFBool', 1, 1)
79
+ proxy = field.newField( 'proxy', 'SFNode', 0, node.NULL)
80
+ bboxSize = field.newField( 'bboxSize', 'SFVec3f', 0, [-1.0, -1.0, -1.0])
81
+ children = field.newField( 'children', 'MFNode', 1, list)
82
+ #Events
83
+ removeChildren = field.newEvent( 'removeChildren', 'MFNode', 0)
84
+ collideTime = field.newEvent( 'collideTime', 'SFTime', 1)
85
+ addChildren = field.newEvent( 'addChildren', 'MFNode', 0)
86
+
87
+ class Color( node.Node ):
88
+ PROTO = 'Color'
89
+ #Fields
90
+ color = field.newField( 'color', 'MFColor', 1, list)
91
+ #Events
92
+
93
+
94
+ class ColorInterpolator( nodetypes.Children, nodetypes.Interpolator, node.Node ):
95
+ PROTO = 'ColorInterpolator'
96
+ #Fields
97
+ keyValue = field.newField( 'keyValue', 'MFColor', 1, list)
98
+ key = field.newField( 'key', 'MFFloat', 1, list)
99
+ #Events
100
+ set_fraction = field.newEvent( 'set_fraction', 'SFFloat', 0)
101
+ value_changed = field.newEvent( 'value_changed', 'SFColor', 1)
102
+
103
+ class Cone( nodetypes.Geometry, node.Node ):
104
+ PROTO = 'Cone'
105
+ #Fields
106
+ bottom = field.newField( 'bottom', 'SFBool', 0, 1)
107
+ side = field.newField( 'side', 'SFBool', 0, 1)
108
+ bottomRadius = field.newField( 'bottomRadius', 'SFFloat', 0, 1.0)
109
+ height = field.newField( 'height', 'SFFloat', 0, 2.0)
110
+ #Events
111
+
112
+
113
+ class Coordinate( node.Node ):
114
+ PROTO = 'Coordinate'
115
+ #Fields
116
+ point = field.newField( 'point', 'MFVec3f', 1, list)
117
+ #Events
118
+
119
+
120
+ class CoordinateInterpolator( nodetypes.Children, nodetypes.Interpolator, node.Node ):
121
+ PROTO = 'CoordinateInterpolator'
122
+ #Fields
123
+ keyValue = field.newField( 'keyValue', 'MFVec3f', 1, list)
124
+ key = field.newField( 'key', 'MFFloat', 1, list)
125
+ #Events
126
+ set_fraction = field.newEvent( 'set_fraction', 'SFFloat', 0)
127
+ value_changed = field.newEvent( 'value_changed', 'MFVec3f', 1)
128
+
129
+ class Cylinder( nodetypes.Geometry, node.Node ):
130
+ PROTO = 'Cylinder'
131
+ #Fields
132
+ top = field.newField( 'top', 'SFBool', 0, 1)
133
+ bottom = field.newField( 'bottom', 'SFBool', 0, 1)
134
+ radius = field.newField( 'radius', 'SFFloat', 0, 1.0)
135
+ side = field.newField( 'side', 'SFBool', 0, 1)
136
+ height = field.newField( 'height', 'SFFloat', 0, 2.0)
137
+ #Events
138
+
139
+
140
+ class CylinderSensor( nodetypes.Children, nodetypes.PointingSensor, node.Node ):
141
+ PROTO = 'CylinderSensor'
142
+ #Fields
143
+ minAngle = field.newField( 'minAngle', 'SFFloat', 1, 0.0)
144
+ offset = field.newField( 'offset', 'SFFloat', 1, 0.0)
145
+ diskAngle = field.newField( 'diskAngle', 'SFFloat', 1, 0.26200000000000001)
146
+ enabled = field.newField( 'enabled', 'SFBool', 1, 1)
147
+ autoOffset = field.newField( 'autoOffset', 'SFBool', 1, 1)
148
+ maxAngle = field.newField( 'maxAngle', 'SFFloat', 1, -1.0)
149
+ #Events
150
+ rotation_changed = field.newEvent( 'rotation_changed', 'SFRotation', 1)
151
+ isActive = field.newEvent( 'isActive', 'SFBool', 1)
152
+ trackPoint_changed = field.newEvent( 'trackPoint_changed', 'SFVec3f', 1)
153
+
154
+ class DirectionalLight( nodetypes.Children, nodetypes.Light, node.Node ):
155
+ PROTO = 'DirectionalLight'
156
+ #Fields
157
+ color = field.newField( 'color', 'SFColor', 1, [1.0, 1.0, 1.0])
158
+ on = field.newField( 'on', 'SFBool', 1, 1)
159
+ intensity = field.newField( 'intensity', 'SFFloat', 1, 1.0)
160
+ ambientIntensity = field.newField( 'ambientIntensity', 'SFFloat', 1, 0.0)
161
+ direction = field.newField( 'direction', 'SFVec3f', 1, [0.0, 0.0, -1.0])
162
+ #Events
163
+
164
+
165
+ class ElevationGrid( nodetypes.Geometry, node.Node ):
166
+ PROTO = 'ElevationGrid'
167
+ #Fields
168
+ zDimension = field.newField( 'zDimension', 'SFInt32', 0, 0)
169
+ xSpacing = field.newField( 'xSpacing', 'SFFloat', 0, 0.0)
170
+ creaseAngle = field.newField( 'creaseAngle', 'SFFloat', 0, 0.0)
171
+ normal = field.newField( 'normal', 'SFNode', 1, node.NULL)
172
+ solid = field.newField( 'solid', 'SFBool', 0, 1)
173
+ ccw = field.newField( 'ccw', 'SFBool', 0, 1)
174
+ texCoord = field.newField( 'texCoord', 'SFNode', 1, node.NULL)
175
+ height = field.newField( 'height', 'MFFloat', 0, list)
176
+ color = field.newField( 'color', 'SFNode', 1, node.NULL)
177
+ colorPerVertex = field.newField( 'colorPerVertex', 'SFBool', 0, 1)
178
+ xDimension = field.newField( 'xDimension', 'SFInt32', 0, 0)
179
+ zSpacing = field.newField( 'zSpacing', 'SFFloat', 0, 0.0)
180
+ normalPerVertex = field.newField( 'normalPerVertex', 'SFBool', 0, 1)
181
+ #Events
182
+ set_height = field.newEvent( 'set_height', 'MFFloat', 0)
183
+
184
+ class Extrusion( nodetypes.Geometry, node.Node ):
185
+ PROTO = 'Extrusion'
186
+ #Fields
187
+ beginCap = field.newField( 'beginCap', 'SFBool', 0, 1)
188
+ scale = field.newField( 'scale', 'MFVec2f', 0, [[1.0, 1.0]])
189
+ creaseAngle = field.newField( 'creaseAngle', 'SFFloat', 0, 0.0)
190
+ convex = field.newField( 'convex', 'SFBool', 0, 1)
191
+ spine = field.newField( 'spine', 'MFVec3f', 0, [[0.0, 0.0, 0.0], [0.0, 1.0, 0.0]])
192
+ crossSection = field.newField( 'crossSection', 'MFVec2f', 0, [[1.0, 1.0], [1.0, -1.0], [-1.0, -1.0], [-1.0, 1.0], [1.0, 1.0]])
193
+ ccw = field.newField( 'ccw', 'SFBool', 0, 1)
194
+ solid = field.newField( 'solid', 'SFBool', 0, 1)
195
+ endCap = field.newField( 'endCap', 'SFBool', 0, 1)
196
+ orientation = field.newField( 'orientation', 'MFRotation', 0, [[0.0, 0.0, 1.0, 0.0]])
197
+ #Events
198
+ set_crossSection = field.newEvent( 'set_crossSection', 'MFVec2f', 0)
199
+ set_orientation = field.newEvent( 'set_orientation', 'MFRotation', 0)
200
+ set_scale = field.newEvent( 'set_scale', 'MFVec2f', 0)
201
+ set_spine = field.newEvent( 'set_spine', 'MFVec3f', 0)
202
+
203
+ class Fog( nodetypes.Fog, nodetypes.Children, node.Node ):
204
+ PROTO = 'Fog'
205
+ #Fields
206
+ color = field.newField( 'color', 'SFColor', 1, [1.0, 1.0, 1.0])
207
+ visibilityRange = field.newField( 'visibilityRange', 'SFFloat', 1, 0.0)
208
+ fogType = field.newField( 'fogType', 'SFString', 1, 'LINEAR')
209
+ #Events
210
+ set_bind = field.newEvent( 'set_bind', 'SFBool', 0)
211
+ isBound = field.newEvent( 'isBound', 'SFBool', 1)
212
+
213
+ class FontStyle( node.Node ):
214
+ PROTO = 'FontStyle'
215
+ #Fields
216
+ style = field.newField( 'style', 'SFString', 0, 'PLAIN')
217
+ topToBottom = field.newField( 'topToBottom', 'SFBool', 0, 1)
218
+ family = field.newField( 'family', 'MFString', 0, 'SERIF')
219
+ language = field.newField( 'language', 'SFString', 0, '')
220
+ horizontal = field.newField( 'horizontal', 'SFBool', 0, 1)
221
+ justify = field.newField( 'justify', 'MFString', 0, ['BEGIN'])
222
+ spacing = field.newField( 'spacing', 'SFFloat', 0, 1.0)
223
+ leftToRight = field.newField( 'leftToRight', 'SFBool', 0, 1)
224
+ size = field.newField( 'size', 'SFFloat', 0, 1.0)
225
+
226
+ #Events
227
+
228
+
229
+ class Group( nodetypes.Children, nodetypes.Grouping, node.Node ):
230
+ PROTO = 'Group'
231
+ #Fields
232
+ bboxCenter = field.newField( 'bboxCenter', 'SFVec3f', 0, [0.0, 0.0, 0.0])
233
+ children = field.newField( 'children', 'MFNode', 1, list)
234
+ bboxSize = field.newField( 'bboxSize', 'SFVec3f', 0, [-1.0, -1.0, -1.0])
235
+ #Events
236
+ removeChildren = field.newEvent( 'removeChildren', 'MFNode', 0)
237
+ addChildren = field.newEvent( 'addChildren', 'MFNode', 0)
238
+
239
+ class ImageTexture( nodetypes.Texture, node.Node ):
240
+ PROTO = 'ImageTexture'
241
+ #Fields
242
+ url = field.newField( 'url', 'MFString', 1, list)
243
+ repeatS = field.newField( 'repeatS', 'SFBool', 0, 1)
244
+ repeatT = field.newField( 'repeatT', 'SFBool', 0, 1)
245
+ #Events
246
+
247
+
248
+ class IndexedFaceSet( nodetypes.Geometry, node.Node ):
249
+ PROTO = 'IndexedFaceSet'
250
+ #Fields
251
+ colorIndex = field.newField( 'colorIndex', 'MFInt32', 0, list)
252
+ normal = field.newField( 'normal', 'SFNode', 1, node.NULL)
253
+ solid = field.newField( 'solid', 'SFBool', 0, 1)
254
+ ccw = field.newField( 'ccw', 'SFBool', 0, 1)
255
+ coordIndex = field.newField( 'coordIndex', 'MFInt32', 0, list)
256
+ texCoord = field.newField( 'texCoord', 'SFNode', 1, node.NULL)
257
+ normalPerVertex = field.newField( 'normalPerVertex', 'SFBool', 0, 1)
258
+ color = field.newField( 'color', 'SFNode', 1, node.NULL)
259
+ colorPerVertex = field.newField( 'colorPerVertex', 'SFBool', 0, 1)
260
+ coord = field.newField( 'coord', 'SFNode', 1, node.NULL)
261
+ convex = field.newField( 'convex', 'SFBool', 0, 1)
262
+ normalIndex = field.newField( 'normalIndex', 'MFInt32', 0, list)
263
+ texCoordIndex = field.newField( 'texCoordIndex', 'MFInt32', 0, list)
264
+ creaseAngle = field.newField( 'creaseAngle', 'SFFloat', 0, 0.0)
265
+ #Events
266
+ set_coordIndex = field.newEvent( 'set_coordIndex', 'MFInt32', 0)
267
+ set_texCoordIndex = field.newEvent( 'set_texCoordIndex', 'MFInt32', 0)
268
+ set_colorIndex = field.newEvent( 'set_colorIndex', 'MFInt32', 0)
269
+ set_normalIndex = field.newEvent( 'set_normalIndex', 'MFInt32', 0)
270
+
271
+ class IndexedLineSet( nodetypes.Geometry, node.Node ):
272
+ PROTO = 'IndexedLineSet'
273
+ #Fields
274
+ color = field.newField( 'color', 'SFNode', 1, node.NULL)
275
+ colorPerVertex = field.newField( 'colorPerVertex', 'SFBool', 0, 1)
276
+ colorIndex = field.newField( 'colorIndex', 'MFInt32', 0, list)
277
+ coord = field.newField( 'coord', 'SFNode', 1, node.NULL)
278
+ coordIndex = field.newField( 'coordIndex', 'MFInt32', 0, list)
279
+ #Events
280
+ set_coordIndex = field.newEvent( 'set_coordIndex', 'MFInt32', 0)
281
+ set_colorIndex = field.newEvent( 'set_colorIndex', 'MFInt32', 0)
282
+
283
+ class Inline( nodetypes.Children, nodetypes.Traversable, node.Node ):
284
+ PROTO = 'Inline'
285
+ #Fields
286
+ url = field.newField( 'url', 'MFString', 1, list)
287
+ bboxCenter = field.newField( 'bboxCenter', 'SFVec3f', 0, [0.0, 0.0, 0.0])
288
+ bboxSize = field.newField( 'bboxSize', 'SFVec3f', 0, [-1.0, -1.0, -1.0])
289
+ #Events
290
+
291
+
292
+ class LOD( nodetypes.Children, nodetypes.Traversable, node.Node ):
293
+ PROTO = 'LOD'
294
+ #Fields
295
+ range = field.newField( 'range', 'MFFloat', 0, list)
296
+ center = field.newField( 'center', 'SFVec3f', 0, [0.0, 0.0, 0.0])
297
+ level = field.newField( 'level', 'MFNode', 1, list)
298
+ #Events
299
+
300
+
301
+ class Material( node.Node ):
302
+ PROTO = 'Material'
303
+ #Fields
304
+ specularColor = field.newField( 'specularColor', 'SFColor', 1, [0.0, 0.0, 0.0])
305
+ emissiveColor = field.newField( 'emissiveColor', 'SFColor', 1, [0.0, 0.0, 0.0])
306
+ transparency = field.newField( 'transparency', 'SFFloat', 1, 0.0)
307
+ diffuseColor = field.newField( 'diffuseColor', 'SFColor', 1, [0.80000000000000004, 0.80000000000000004, 0.80000000000000004])
308
+ ambientIntensity = field.newField( 'ambientIntensity', 'SFFloat', 1, 0.20000000000000001)
309
+ shininess = field.newField( 'shininess', 'SFFloat', 1, 0.20000000000000001)
310
+ #Events
311
+
312
+
313
+ class MovieTexture( nodetypes.Auditory, nodetypes.Texture, nodetypes.TimeDependent, node.Node ):
314
+ PROTO = 'MovieTexture'
315
+ #Fields
316
+ stopTime = field.newField( 'stopTime', 'SFTime', 1, 0.0)
317
+ startTime = field.newField( 'startTime', 'SFTime', 1, 0.0)
318
+ url = field.newField( 'url', 'MFString', 1, list)
319
+ speed = field.newField( 'speed', 'SFFloat', 1, 1.0)
320
+ repeatS = field.newField( 'repeatS', 'SFBool', 0, 1)
321
+ repeatT = field.newField( 'repeatT', 'SFBool', 0, 1)
322
+ loop = field.newField( 'loop', 'SFBool', 1, 0)
323
+ #Events
324
+ duration_changed = field.newEvent( 'duration_changed', 'SFFloat', 1)
325
+ isActive = field.newEvent( 'isActive', 'SFBool', 1)
326
+
327
+ class NavigationInfo( nodetypes.Children, nodetypes.NavigationInfo, node.Node ):
328
+ PROTO = 'NavigationInfo'
329
+ #Fields
330
+ speed = field.newField( 'speed', 'SFFloat', 1, 1.0)
331
+ avatarSize = field.newField( 'avatarSize', 'MFFloat', 1, [0.25, 1.6000000000000001, 0.75])
332
+ headlight = field.newField( 'headlight', 'SFBool', 1, 1)
333
+ type = field.newField( 'type', 'MFString', 1, ['WALK'])
334
+ visibilityLimit = field.newField( 'visibilityLimit', 'SFFloat', 1, 0.0)
335
+ #Events
336
+ set_bind = field.newEvent( 'set_bind', 'SFBool', 0)
337
+ isBound = field.newEvent( 'isBound', 'SFBool', 1)
338
+
339
+ class Normal( node.Node ):
340
+ PROTO = 'Normal'
341
+ #Fields
342
+ vector = field.newField( 'vector', 'MFVec3f', 1, list)
343
+ #Events
344
+
345
+
346
+ class NormalInterpolator( nodetypes.Children, nodetypes.Interpolator, node.Node ):
347
+ PROTO = 'NormalInterpolator'
348
+ #Fields
349
+ keyValue = field.newField( 'keyValue', 'MFVec3f', 1, list)
350
+ key = field.newField( 'key', 'MFFloat', 1, list)
351
+ #Events
352
+ set_fraction = field.newEvent( 'set_fraction', 'SFFloat', 0)
353
+ value_changed = field.newEvent( 'value_changed', 'MFVec3f', 1)
354
+
355
+ class OrientationInterpolator( nodetypes.Children, nodetypes.Interpolator, node.Node ):
356
+ PROTO = 'OrientationInterpolator'
357
+ #Fields
358
+ keyValue = field.newField( 'keyValue', 'MFRotation', 1, list)
359
+ key = field.newField( 'key', 'MFFloat', 1, list)
360
+ #Events
361
+ set_fraction = field.newEvent( 'set_fraction', 'SFFloat', 0)
362
+ value_changed = field.newEvent( 'value_changed', 'SFRotation', 1)
363
+
364
+ class PixelTexture( nodetypes.Texture, node.Node ):
365
+ PROTO = 'PixelTexture'
366
+ #Fields
367
+ image = field.newField( 'image', 'SFImage', 1, [0, 0, 0])
368
+ repeatS = field.newField( 'repeatS', 'SFBool', 0, 1)
369
+ repeatT = field.newField( 'repeatT', 'SFBool', 0, 1)
370
+ #Events
371
+
372
+
373
+ class PlaneSensor( nodetypes.Children, nodetypes.PointingSensor, node.Node ):
374
+ PROTO = 'PlaneSensor'
375
+ #Fields
376
+ maxPosition = field.newField( 'maxPosition', 'SFVec2f', 1, [-1.0, -1.0])
377
+ enabled = field.newField( 'enabled', 'SFBool', 1, 1)
378
+ autoOffset = field.newField( 'autoOffset', 'SFBool', 1, 1)
379
+ minPosition = field.newField( 'minPosition', 'SFVec2f', 1, [0.0, 0.0])
380
+ offset = field.newField( 'offset', 'SFVec3f', 1, [0.0, 0.0, 0.0])
381
+ #Events
382
+ translation_changed = field.newEvent( 'translation_changed', 'SFVec3f', 1)
383
+ isActive = field.newEvent( 'isActive', 'SFBool', 1)
384
+ trackPoint_changed = field.newEvent( 'trackPoint_changed', 'SFVec3f', 1)
385
+
386
+ class PointLight( nodetypes.Children, nodetypes.Light, node.Node ):
387
+ PROTO = 'PointLight'
388
+ #Fields
389
+ on = field.newField( 'on', 'SFBool', 1, 1)
390
+ intensity = field.newField( 'intensity', 'SFFloat', 1, 1.0)
391
+ attenuation = field.newField( 'attenuation', 'SFVec3f', 1, [1.0, 0.0, 0.0])
392
+ radius = field.newField( 'radius', 'SFFloat', 1, 100.0)
393
+ location = field.newField( 'location', 'SFVec3f', 1, [0.0, 0.0, 0.0])
394
+ color = field.newField( 'color', 'SFColor', 1, [1.0, 1.0, 1.0])
395
+ ambientIntensity = field.newField( 'ambientIntensity', 'SFFloat', 1, 0.0)
396
+ #Events
397
+
398
+
399
+ class PointSet( nodetypes.Geometry, node.Node ):
400
+ PROTO = 'PointSet'
401
+ #Fields
402
+ color = field.newField( 'color', 'SFNode', 1, node.NULL)
403
+ coord = field.newField( 'coord', 'SFNode', 1, node.NULL)
404
+
405
+ size = field.newField( 'size','SFFloat',1, 1.0 )
406
+ minSize = field.newField( 'minSize','SFFloat',1, 0.0 )
407
+ maxSize = field.newField( 'maxSize','SFFloat',1, 1.0 )
408
+ attenuation = field.newField( 'attenuation','SFVec3f',1,[1.0,0.0,0.0])
409
+
410
+
411
+ class PositionInterpolator( nodetypes.Children, nodetypes.Interpolator, node.Node ):
412
+ PROTO = 'PositionInterpolator'
413
+ #Fields
414
+ keyValue = field.newField( 'keyValue', 'MFVec3f', 1, list)
415
+ key = field.newField( 'key', 'MFFloat', 1, list)
416
+ #Events
417
+ set_fraction = field.newEvent( 'set_fraction', 'SFFloat', 0)
418
+ value_changed = field.newEvent( 'value_changed', 'SFVec3f', 1)
419
+
420
+ class ProximitySensor( nodetypes.Sensor, nodetypes.Children, node.Node ):
421
+ PROTO = 'ProximitySensor'
422
+ #Fields
423
+ enabled = field.newField( 'enabled', 'SFBool', 1, 1)
424
+ center = field.newField( 'center', 'SFVec3f', 1, [0.0, 0.0, 0.0])
425
+ size = field.newField( 'size', 'SFVec3f', 1, [0.0, 0.0, 0.0])
426
+ #Events
427
+ position_changed = field.newEvent( 'position_changed', 'SFVec3f', 1)
428
+ enterTime = field.newEvent( 'enterTime', 'SFTime', 1)
429
+ exitTime = field.newEvent( 'exitTime', 'SFTime', 1)
430
+ orientation_changed = field.newEvent( 'orientation_changed', 'SFRotation', 1)
431
+ isActive = field.newEvent( 'isActive', 'SFBool', 1)
432
+
433
+ class ScalarInterpolator( nodetypes.Children, nodetypes.Interpolator, node.Node ):
434
+ PROTO = 'ScalarInterpolator'
435
+ #Fields
436
+ keyValue = field.newField( 'keyValue', 'MFFloat', 1, list)
437
+ key = field.newField( 'key', 'MFFloat', 1, list)
438
+ #Events
439
+ set_fraction = field.newEvent( 'set_fraction', 'SFFloat', 0)
440
+ value_changed = field.newEvent( 'value_changed', 'SFFloat', 1)
441
+
442
+ class Shape( nodetypes.Children, nodetypes.Rendering, node.Node ):
443
+ PROTO = 'Shape'
444
+ #Fields
445
+ geometry = field.newField( 'geometry', 'SFNode', 1, node.NULL)
446
+ appearance = field.newField( 'appearance', 'SFNode', 1, node.NULL)
447
+ #Events
448
+
449
+
450
+ class Sound( nodetypes.Auditory, nodetypes.Children, node.Node ):
451
+ PROTO = 'Sound'
452
+ #Fields
453
+ priority = field.newField( 'priority', 'SFFloat', 1, 0.0)
454
+ minFront = field.newField( 'minFront', 'SFFloat', 1, 1.0)
455
+ intensity = field.newField( 'intensity', 'SFFloat', 1, 1.0)
456
+ location = field.newField( 'location', 'SFVec3f', 1, [0.0, 0.0, 0.0])
457
+ source = field.newField( 'source', 'SFNode', 1, node.NULL)
458
+ maxBack = field.newField( 'maxBack', 'SFFloat', 1, 10.0)
459
+ minBack = field.newField( 'minBack', 'SFFloat', 1, 1.0)
460
+ maxFront = field.newField( 'maxFront', 'SFFloat', 1, 10.0)
461
+ spatialize = field.newField( 'spatialize', 'SFBool', 0, 1)
462
+ direction = field.newField( 'direction', 'SFVec3f', 1, [0.0, 0.0, 1.0])
463
+ #Events
464
+
465
+
466
+ class Sphere( nodetypes.Geometry, node.Node ):
467
+ PROTO = 'Sphere'
468
+ #Fields
469
+ radius = field.newField( 'radius', 'SFFloat', 0, 1.0)
470
+ #Events
471
+
472
+
473
+ class SphereSensor( nodetypes.Children, nodetypes.PointingSensor, node.Node ):
474
+ PROTO = 'SphereSensor'
475
+ #Fields
476
+ enabled = field.newField( 'enabled', 'SFBool', 1, 1)
477
+ autoOffset = field.newField( 'autoOffset', 'SFBool', 1, 1)
478
+ offset = field.newField( 'offset', 'SFRotation', 1, [0.0, 1.0, 0.0, 0.0])
479
+ #Events
480
+ rotation_changed = field.newEvent( 'rotation_changed', 'SFRotation', 1)
481
+ isActive = field.newEvent( 'isActive', 'SFBool', 1)
482
+ trackPoint_changed = field.newEvent( 'trackPoint_changed', 'SFVec3f', 1)
483
+
484
+ class SpotLight( nodetypes.Children, nodetypes.Light, node.Node ):
485
+ PROTO = 'SpotLight'
486
+ #Fields
487
+ on = field.newField( 'on', 'SFBool', 1, 1)
488
+ direction = field.newField( 'direction', 'SFVec3f', 1, [0.0, 0.0, -1.0])
489
+ attenuation = field.newField( 'attenuation', 'SFVec3f', 1, [1.0, 0.0, 0.0])
490
+ radius = field.newField( 'radius', 'SFFloat', 1, 100.0)
491
+ location = field.newField( 'location', 'SFVec3f', 1, [0.0, 0.0, 0.0])
492
+ intensity = field.newField( 'intensity', 'SFFloat', 1, 1.0)
493
+ color = field.newField( 'color', 'SFColor', 1, [1.0, 1.0, 1.0])
494
+ ambientIntensity = field.newField( 'ambientIntensity', 'SFFloat', 1, 0.0)
495
+ beamWidth = field.newField( 'beamWidth', 'SFFloat', 1, 1.5707960000000001)
496
+ cutOffAngle = field.newField( 'cutOffAngle', 'SFFloat', 1, 0.78539800000000004)
497
+ #Events
498
+
499
+
500
+ class Switch( nodetypes.Children, nodetypes.Traversable, node.Node ):
501
+ PROTO = 'Switch'
502
+ #Fields
503
+ whichChoice = field.newField( 'whichChoice', 'SFInt32', 1, -1)
504
+ choice = field.newField( 'choice', 'MFNode', 1, list)
505
+ #Events
506
+
507
+
508
+ class Text( nodetypes.Geometry, node.Node ):
509
+ PROTO = 'Text'
510
+ #Fields
511
+ length = field.newField( 'length', 'MFFloat', 1, list)
512
+ fontStyle = field.newField( 'fontStyle', 'SFNode', 1, node.NULL)
513
+ string = field.newField( 'string', 'MFString', 1, list)
514
+ maxExtent = field.newField( 'maxExtent', 'SFFloat', 1, 0.0)
515
+ #Events
516
+
517
+
518
+ class TextureCoordinate( node.Node ):
519
+ PROTO = 'TextureCoordinate'
520
+ #Fields
521
+ point = field.newField( 'point', 'MFVec2f', 1, list)
522
+ #Events
523
+
524
+
525
+ class TextureTransform( node.Node ):
526
+ PROTO = 'TextureTransform'
527
+ #Fields
528
+ rotation = field.newField( 'rotation', 'SFFloat', 1, 0.0)
529
+ scale = field.newField( 'scale', 'SFVec2f', 1, [1.0, 1.0])
530
+ translation = field.newField( 'translation', 'SFVec2f', 1, [0.0, 0.0])
531
+ center = field.newField( 'center', 'SFVec2f', 1, [0.0, 0.0])
532
+ #Events
533
+
534
+
535
+ class TimeSensor( nodetypes.Sensor, nodetypes.Children, nodetypes.TimeDependent, node.Node ):
536
+ PROTO = 'TimeSensor'
537
+ #Fields
538
+ cycleInterval = field.newField( 'cycleInterval', 'SFTime', 1, 1.0)
539
+ stopTime = field.newField( 'stopTime', 'SFTime', 1, 0.0)
540
+ enabled = field.newField( 'enabled', 'SFBool', 1, 1)
541
+ loop = field.newField( 'loop', 'SFBool', 1, 0)
542
+ startTime = field.newField( 'startTime', 'SFTime', 1, 0.0)
543
+ #Events
544
+ fraction_changed = field.newEvent( 'fraction_changed', 'SFFloat', 1)
545
+ cycleTime = field.newEvent( 'cycleTime', 'SFTime', 1)
546
+ isActive = field.newEvent( 'isActive', 'SFBool', 1)
547
+ time = field.newEvent( 'time', 'SFTime', 1)
548
+
549
+ class TouchSensor( nodetypes.Children, nodetypes.PointingSensor, node.Node ):
550
+ PROTO = 'TouchSensor'
551
+ #Fields
552
+ enabled = field.newField( 'enabled', 'SFBool', 1, 1)
553
+ #Events
554
+ isOver = field.newEvent( 'isOver', 'SFBool', 1)
555
+ hitTexCoord_changed = field.newEvent( 'hitTexCoord_changed', 'SFVec2f', 1)
556
+ hitNormal_changed = field.newEvent( 'hitNormal_changed', 'SFVec3f', 1)
557
+ hitPoint_changed = field.newEvent( 'hitPoint_changed', 'SFVec3f', 1)
558
+ touchTime = field.newEvent( 'touchTime', 'SFTime', 1)
559
+ isActive = field.newEvent( 'isActive', 'SFBool', 1)
560
+
561
+ class Transform( nodetypes.Children, nodetypes.Transforming, node.Node ):
562
+ PROTO = 'Transform'
563
+ #Fields
564
+ scale = field.newField( 'scale', 'SFVec3f', 1, [1.0, 1.0, 1.0])
565
+ center = field.newField( 'center', 'SFVec3f', 1, [0.0, 0.0, 0.0])
566
+ bboxCenter = field.newField( 'bboxCenter', 'SFVec3f', 0, [0.0, 0.0, 0.0])
567
+ translation = field.newField( 'translation', 'SFVec3f', 1, [0.0, 0.0, 0.0])
568
+ scaleOrientation = field.newField( 'scaleOrientation', 'SFRotation', 1, [0.0, 0.0, 1.0, 0.0])
569
+ rotation = field.newField( 'rotation', 'SFRotation', 1, [0.0, 0.0, 1.0, 0.0])
570
+ bboxSize = field.newField( 'bboxSize', 'SFVec3f', 0, [-1.0, -1.0, -1.0])
571
+ children = field.newField( 'children', 'MFNode', 1, list)
572
+ #Events
573
+ removeChildren = field.newEvent( 'removeChildren', 'MFNode', 0)
574
+ addChildren = field.newEvent( 'addChildren', 'MFNode', 0)
575
+ def localMatrices( self, translate=True,scale=True,rotate=True ):
576
+ """Calculate/lookup our local matrices
577
+
578
+ Certain operations want, e.g. just the rotation of an item,
579
+ so we actually can store 2**3 possible variations of the local
580
+ matrices. In practice we only see a very small number.
581
+
582
+ returns holder, where holder.data == (forward,inverse) matrix
583
+ for the local node, each of which can be None
584
+ """
585
+ key=('local_matrices',translate,scale,rotate)
586
+ holder = cache.CACHE.getHolder( self, key=key )
587
+ if holder is None:
588
+ doConnect = True
589
+ holder = cache.CACHE.holder( self, None, key=key )
590
+ mHolder = None
591
+ else:
592
+ doConnect = False
593
+ mHolder = holder.data
594
+ if mHolder is None:
595
+ matrix = None
596
+ fields = []
597
+ if translate:
598
+ fields.append( 'translation' )
599
+ if scale or rotate:
600
+ fields.append( 'center' )
601
+ if scale:
602
+ fields.append( 'scale' )
603
+ fields.append( 'scaleOrientation' )
604
+ if rotate:
605
+ fields.append( 'rotation' )
606
+ d = self.__dict__
607
+ forward,inverse = transformmatrix.localMatrices(
608
+ **dict([(k,d.get(k)) for k in fields] )
609
+ )
610
+ if doConnect:
611
+ for k in fields:
612
+ holder.depend( self, k )
613
+ holder.data = (forward,inverse)
614
+ return holder
615
+
616
+ class Viewpoint( nodetypes.Children, nodetypes.Viewpoint, node.Node ):
617
+ PROTO = 'Viewpoint'
618
+ #Fields
619
+ jump = field.newField( 'jump', 'SFBool', 1, 1)
620
+ position = field.newField( 'position', 'SFVec3f', 1, [0.0, 0.0, 10.0])
621
+ fieldOfView = field.newField( 'fieldOfView', 'SFFloat', 1, 0.78539800000000004)
622
+ orientation = field.newField( 'orientation', 'SFRotation', 1, [0.0, 0.0, 1.0, 0.0])
623
+ description = field.newField( 'description', 'SFString', 0, '')
624
+ #Events
625
+ set_bind = field.newEvent( 'set_bind', 'SFBool', 0)
626
+ bindTime = field.newEvent( 'bindTime', 'SFTime', 1)
627
+ isBound = field.newEvent( 'isBound', 'SFBool', 1)
628
+
629
+ class VisibilitySensor( nodetypes.Sensor, nodetypes.Children, node.Node ):
630
+ PROTO = 'VisibilitySensor'
631
+ #Fields
632
+ enabled = field.newField( 'enabled', 'SFBool', 1, 1)
633
+ center = field.newField( 'center', 'SFVec3f', 1, [0.0, 0.0, 0.0])
634
+ size = field.newField( 'size', 'SFVec3f', 1, [0.0, 0.0, 0.0])
635
+ #Events
636
+ exitTime = field.newEvent( 'exitTime', 'SFTime', 1)
637
+ enterTime = field.newEvent( 'enterTime', 'SFTime', 1)
638
+ isActive = field.newEvent( 'isActive', 'SFBool', 1)
639
+
640
+ class WorldInfo( nodetypes.Children, node.Node ):
641
+ PROTO = 'WorldInfo'
642
+ #Fields
643
+ info = field.newField( 'info', 'MFString', 0, list)
644
+ title = field.newField( 'title', 'SFString', 0, '')
645
+ #Events
646
+
647
+ # clean up namespace
648
+ del field, node, nodetypes