[x3d-public] possibly missing items from X3D Object Model

yottzumm at gmail.com yottzumm at gmail.com
Fri Mar 10 05:35:38 PST 2017


Don wrote:
Note that the nodes inherit from X3DConcreteNode, statements inherit from X3DConcreteStatement, and everything inherits from X3DConcreteElement.  These abstract superclasses can be helpful when you need to distinguish between discovered objects (such as children nodes/statements).

This is not obvious from looking at the Object Model.  Should it be?  X3DConcrete is not even mentioned in the ObjectModel.

Adding X3DChildNode helped.  Why isn’t this mentioned in the Object Model more often?

Some changes to parseom.py which generates mapToMethod.js.  This is the sort of thing I’d like to see in the ObjectModel so I wouldn’t have to add special cases.

classes["X3DConcreteNode"] = ClassPrinter("X3DConcreteNode", {})
classes["X3DConcreteStatement"] = ClassPrinter("X3DConcreteStatement", {})

cns = soup.find_all("ConcreteNode")
for cn in cns:
    classes[cn['name']] = ClassPrinter(cn, { "X3DConcreteNode" : 1, "X3DChildNode" : 1 })
    classes["X3DConcreteNode"].children.append(cn["name"])
    classes["X3DChildNode"].children.append(cn["name"])

sts = soup.find_all("Statement")
for st in sts:
    classes[st['name']] = ClassPrinter(st, { "X3DConcreteStatement" : 1, "X3DChildNode" : 1 })
    classes["X3DConcreteStatement"].children.append(st["name"])
    classes["X3DChildNode"].children.append(st["name"])

I am not sure all ConcreteNodes and Statements are X3DChildNodes.  If not, I need a way to distinguish them.

John


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170310/ad7c8bb7/attachment.html>


More information about the x3d-public mailing list