[Source] Extrusion diagnostics improved; how to get the DEF name of a node?

Don Brutzman brutzman at nps.edu
Mon Aug 20 22:17:10 PDT 2012


On 8/20/2012 9:46 PM, Alan Hudson wrote:
> On 8/20/2012 12:43 PM, Don Brutzman wrote:
>> [..]
>> What should be an FAQ: how to get the DEF name of a node?
>> It doesn't appear that this important value is saved as part of
>> a node's base class information.  Not having it greatly obscures
>> diagnostic and error output.
>>
>> Example reference or snippet to getDEF from within OGLExtrusion
>> would be appreciated.

> You can't.  The information is only contained at the scene level not per node.  We decided the memory overhead of having an pointer per node was not worth it.

I'm afraid that approach is simply insufficient for proper testing.
We must be able to test and diagnose Xj3D with nontrivial X3D content.
You can't just guess which node (among dozens or hundreds) causes an
Xj3D error when debugging unit-test content.

Minimum approach:  utility method that somehow looks up DEF name from
a table or hashmap, if you are already keeping it there.  (Presumably
DEF info is kept somewhere, otherwise you can't add a ROUTE at runtime.)

Simple, typical approach:  add DEF string to base class for all nodes.
Provide get/set accessor methods similar to other fields.

Optimization decision guidance:
a. Necessary functionality first.
b. Use monitoring and metrics (e.g. Netbeans profiler or other tools) to
	make tradeoff decisions about performance and memory footprint.
c.  Performance metrics may differ depending on end-use case (e.g. X3D
	profile support, desktop/mobile/embedded application/JNLP/etc.)

Did I miss anything?  Articulating best practice would seem to be valuable
to capture in the Xj3D developer documentation.

BTW another thumbrule:  developer time is more valuable that computer time!

It is quite a picture puzzle debugging the Extrusion anomalies, as you
might expect from the scene and console outputs provided.  The current
text console output (after manually removing "System.out: " distractors)
is 1724 lines long for 10 Extrusion nodes.  Not having a positive DEF indication
of which node is which consumes further developer time for each trace attempt.

> OGLExtrusion diagnostics are improved in NPS branch.
>
> Corresponding new example test scene and console output can be found at
> http://x3d.svn.sourceforge.net/viewvc/x3d/www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/GeometricShapes/ExtrusionExamplesTest.x3d?view=log
> http://x3d.svn.sourceforge.net/viewvc/x3d/www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/GeometricShapes/ExtrusionExamplesTestXj3dConsoleOutput.txt?view=log 

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the Source mailing list