[x3d-public] [x3dom-users] inline access from dom

Andreas Plesch andreasplesch at gmail.com
Sun Oct 2 05:43:23 PDT 2016


Hi Leonard,

I guess I am looking for guidance and a discussion on how ideally content
internal to Inlines should be identified. I do like the CSS selector
approach because if does not involve adding an additional namespacename
field to Inline. But there may be other approaches.

What would it take to adopt the selector approach in x3dom ? So you can do
this:

SceneElement.querySelector("Inline[DEF='arrow']
Material[DEF='arrowheadmat']).setAttribute("diffuseColor","1 0 0")

-Andreas

On Sat, Oct 1, 2016 at 11:54 PM, Leonard Daly <web3d at realism.com> wrote:

> Andreas,
>
> I am not sure if you are looking for comments, advice, discussion, or just
> posting a notice. I don't want to go off on a tangent here. I am rather
> familiar with how and almost why X3DOM does it.
>
>
> Leonard Daly
>
>
> I am working on adding DOM access to inline scenes for my Cobweb DOM
> bridge:
>
> https://andreasplesch.github.io/cobweb_dom/tests/inline_in_inline.xhtml
>
> The idea is to add the external inline scene DOMs to the main scene DOM as
> children of the Inline elements. Once added, the mutation observer picks up
> modifications of these children and does not need to do anything other than
> it already does for the main scene.
>
> It works well although I do not know how web browsers deal with large
> combined DOMs. Also, a small addition to Cobweb.js is currently needed.
>
> One effect is that one can use CSS selectors with querySelector to drill
> down to specific elements in inline scenes, even through hierarchies of
> inlined inlines. See example. This way the DEF names can be used even if
> they are identical across scenes. X3D semantics and functioning is not
> affected.
>
> X3dom uses a different approach of prefixes to id/DEF attributes to enable
> access to elements in inlines. Not sure if x3dom could use instead or in
> addition Selectors ? This would require adding the Inline DOMs to the main
> DOM but perhaps this is already almost done ?
>
> So I am considering also adding the same option of a namespacename prefix
> to element IDs but the effort would be really for compatibility. Thinking
> about it, while possible probably not a priority unless there is a
> compelling use case.
>
> X3D has EXPORT/IMPORT to deal with accessing nodes in inlines. I think the
> SAI equivalent is roughly that all nodes are EXPORTed by default and that
> in addition to a DEF name it becomes possible to address a node by its path
> in the scene hierarchy. Perhaps something to consider for the standard: X3D
> selectors.
>
> Andreas
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>
>
>
> _______________________________________________
> X3dom-users mailing listX3dom-users at lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/x3dom-users
>
>
>
>
> --
> *Leonard Daly*
> 3D Systems Architect & Cloud Consultant
> President, Daly Realism - *Creating the Future*
>



-- 
Andreas Plesch
39 Barbara Rd.
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20161002/99e33f0c/attachment.html>


More information about the x3d-public mailing list