<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p><span style="font-family:monospace"><span
style="background-color: rgb(255, 255, 255);">Don, you may
want to create a Geometry class in x3d.py like:</span></span></p>
<p><span style="font-family:monospace"><span
style="background-color: rgb(255, 255, 255);">class</span><span
style="background-color: rgb(255, 255, 255);"> </span><span
style="font-weight: bold; background-color: rgb(255, 255,
255);">Geometry</span><span style="background-color: rgb(255,
255, 255);">(</span><span style="background-color: rgb(255,
255, 84);">_X3D</span><span style="background-color: rgb(255,
255, 255);">GeometryNode):
</span><span style="font-weight: bold; background-color:
rgb(255, 255, 255);"></span><span style="background-color:
rgb(255, 255, 255);"></span><br>
<span style="background-color: rgb(255, 255, 255);">def</span><span
style="background-color: rgb(255, 255, 255);"> </span><span
style="font-weight: bold; background-color: rgb(255, 255,
255);">FIELD_DECLARATIONS</span><span style="background-color:
rgb(255, 255, 255);">(cls):
</span><br>
<span style="background-color: rgb(255, 255, 255);">return</span><span
style="background-color: rgb(255, 255, 255);"> []
</span><span style="background-color: rgb(255, 255, 255);"></span><br>
<span style="background-color: rgb(255, 255, 255);">def</span><span
style="background-color: rgb(255, 255, 255);"> </span><span
style="font-weight: bold; background-color: rgb(255, 255,
255);">JSON</span><span style="background-color: rgb(255, 255,
255);">(self):
</span><br>
<span style="background-color: rgb(255, 255, 255);">return</span><span
style="background-color: rgb(255, 255, 255);">
self.geometry.JSON();
</span><br>
<span style="background-color: rgb(255, 255, 255);">def</span><span
style="background-color: rgb(255, 255, 255);"> </span><span
style="font-weight: bold; background-color: rgb(255, 255,
255);">XML</span><span style="background-color: rgb(255, 255,
255);">(self):
</span><br>
<span style="background-color: rgb(255, 255, 255);">return</span><span
style="background-color: rgb(255, 255, 255);">
self.geometry.XML();</span></span></p>
<p><span style="font-family:monospace"><span
style="background-color: rgb(255, 255, 255);"><br>
</span></span></p>
<p><span style="font-family:monospace"><span
style="background-color: rgb(255, 255, 255);">Also, we would
have to provide parsers to fill in self.geometry.</span></span></p>
<p><span style="font-family:monospace"><span
style="background-color: rgb(255, 255, 255);">Or test for
self.geometry in the JSON and XML methods, or add a
constructor.</span></span></p>
<p><span style="font-family:monospace"><span
style="background-color: rgb(255, 255, 255);">This is mainly
for loading the -geometry field.</span></span></p>
<p><span style="font-family:monospace"><span
style="background-color: rgb(255, 255, 255);">It could be
handled in the Shape class, with eval() figuring out which
geometry constructor to call. That is okay with me!</span></span></p>
<p><span style="font-family:monospace"><span
style="background-color: rgb(255, 255, 255);">Obviously, eval
is a tiny bit dangerous, even if only resolving a class. I
recommend creating a regexp that matches all node and
statement names.</span></span></p>
<p><span style="font-family:monospace"><span
style="background-color: rgb(255, 255, 255);">I'm going to
proceed with eval in the Shape class for now.<br>
</span></span></p>
<p><span style="font-family:monospace"><span
style="background-color: rgb(255, 255, 255);">Thanks!</span></span></p>
<p><span style="font-family:monospace"><span
style="background-color: rgb(255, 255, 255);">John<br>
</span></span></p>
</body>
</html>