[x3d-public] LoadSensor completion of loading - extended discussion
Christoph Valentin
christoph.valentin at gmx.at
Wed Dec 21 14:02:53 PST 2022
Hi Andreas,
May I try to sketch the problem again, from my perspective?
We try to achieve a better control by the author, whether the LoadSensor will wait for subsequent level inlines or just for the next level inlines. Hence you requested more strict rules from the X3D standard.
1) First question: shall the LoadSensor work recursive or not - that was your original question
Discussion: if the LoadSensor supervises only the next level of inlines,
then the scene that contains the LoadSensor does not "know",
if the subsequent levels of inlines have actually been loaded
or not.
I see two implications: a) rendering b) event routing
a) Rendering: here the parent scene should have control over next level
and all subsequent levels (that's my gut feeling, nothing more)
b) Event Routing: imho, this is a topic to be solved "level by level".
I.e. the parent level accesses the next level, but the
next level has to decide, whether the subsequent level(s)
can be accessed or not (even by the parent level)
2) First conclusion: there is no general answer, whether recursive action is good or bad,
hence the author should have some control
3) Second conclusion: Regarding Event Routing, the next level should decide, whether the
subsequent level(s) are accessible and shall be accessed (by the
next level or by the parent level).
4) First Suggestion: This could be achieved by a field "SFBool forwardIsLoaded"
in the next level LoadSensor.
When this field is set to TRUE, then all parent level LoadSensors
would accept the next level inline only as loaded, if all LoadSensors
in the next level inline (that have this flag set) have already issued
the "isLoaded" event
5) Second Suggestion: The field "SFBool forwardIsActive" could be superseded by a field
"SFBool recursive" in the parent level LoadSensor.
This is equivalent to having set the "forwardIsLoaded" field in all
next level and subsequent LoadSensors
KR,
Christoph
Gesendet: Mittwoch, 21. Dezember 2022 um 21:26 Uhr
Von: "Andreas Plesch" <andreasplesch at gmail.com>
An: "Christoph Valentin" <christoph.valentin at gmx.at>
Cc: "X3D Graphics public mailing list" <x3d-public at web3d.org>
Betreff: Re: [x3d-public] LoadSensor completion of loading
Hi Christoph,
I think the idea could be sketched as:
<Scene>
<Inline Outer/>
<IMPORT LSForInner />
Do something after LSForInner fires
..
Inline Outer:
<Scene>
<LoadSensor DEF="LSForInner">
<Inline Inner/>
</>
<EXPORT LSForInner/>
..
That flexibility would favor the option to generate the event before
downloading of inner content. The potential downside is that it
assumes that the outer Inline has such an exported LoadSensor which
may not be the case or even be under the author's control. Also, for
more complex scenes it can become a lot of logic for the author to
deal with.
In any case, to avoid surprises with that option it would be even more
important to point out in the spec. when the isLoaded event is
generated, eg. that nested LoadSensors may be needed.
-Andreas
On Wed, Dec 21, 2022 at 2:42 PM Christoph Valentin
<christoph.valentin at gmx.at> wrote:
>
> Hi Andreas,
>
> Just one neuron firing now: what about leaving the decision to the author?
>
> Somehow "nesting" the LoadSensor. One LoadSensor in the scene, reporting about the inline. Another LoadSensor in the inline, reporting about the second level inline. And so on.
>
> --
> Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.
> Am 21.12.22, 17:51 schrieb Andreas Plesch <andreasplesch at gmail.com>:
>>
>> It is useful to be notified after an Inline has completed loading.
>> This is especially true for external access to the scene if the Inline
>> has exports (or dom style access is used).
>> A LoadSensor generates such an event:
>>
>> https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/components/networking.html#LoadSensor
>>
>> "The isLoaded field generates events when loading of the LoadSensor's
>> children has completed."
>>
>> However, in the case that the Inline contains another Inline itself a
>> question came up. Is loading considered complete when the outer Inline
>> xml/json/.. is completely downloaded but still has only a url
>> reference to the inner Inline ? That typically would happen before
>> also the inner Inline is completely downloaded. Or should the event be
>> generated only after the inner Inline (and all of its content) is also
>> completely downloaded ?
>>
>> The second option is more useful, especially for web use where loading
>> generally occurs asynchronously and such events are often used to
>> initiate processing of downloaded content.
>>
>> For generic X3D use, one could imagine a situation where a LoadSensor
>> triggers something which assumes that the scene is fully rendered
>> before an Inline is actually rendered.
>>
>> It is also related to how EXPORT/IMPORT works. One could probably
>> construct a situation where a LoadSensor triggers access to an
>> EXPORTed node from an inner Inline before it is available.
>>
>> Is a tightening of the language necessary ? Perhaps there is already a
>> more precise definition of 'loading' in the spec. somewhere else ?
>>
>> -Andreas
>> --
>> Andreas Plesch
>> Waltham, MA 02453
>>
>> _______________________________________________
>> x3d-public mailing list
>> x3d-public at web3d.org
>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org[http://web3d.org/mailman/listinfo/x3d-public_web3d.org]
--
Andreas Plesch
Waltham, MA 02453
More information about the x3d-public
mailing list