[x3d-public] More Object Model Work: indicating nodes and statements for each profile within object model and X3DJSAIL

John Carlson yottzumm at gmail.com
Thu Aug 31 05:44:20 PDT 2017


Don, is there anything in the object model for relationships between
profiles?   Thanks!

John

On Aug 31, 2017 3:48 AM, "Don Brutzman" <brutzman at nps.edu> wrote:

On 8/30/2017 10:23 AM, John Carlson wrote:

> Looks okay to me.
>

Thanks for double checks.

On Aug 30, 2017 12:47 PM, "Don Brutzman" <brutzman at nps.edu <mailto:
> brutzman at nps.edu>> wrote:
>
>     OK, have amended X3D XML Schema to include allowed nodes under each
> profile.  Also added allowed X3D statements under Core profile.
>
>     Documentation at
>     http://www.web3d.org/specifications/X3dSchemaDocumentation3.
> 3/x3d-3.3_profileNames.html#LinkDC <http://www.web3d.org/specific
> ations/X3dSchemaDocumentation3.3/x3d-3.3_profileNames.html#LinkDC>
>
>
>     Next: have extracted these node and statement lists for inclusion in
> the X3D Unified Object Model profile information.
>
>     Result excerpt follows.  Please look at syntax, hope it looks OK.  As
> this gets integrated, will next apply by generating profile-validation
> tests in source code for X3DJSAIL.[...]
>

OK have taken the next step: added validation of profile and component
information for each node in the respective validate() methods.

Example excerpt from AnchorObject follows, where Anchor-specific values for
profiles/component/level get plugged in from entries in
X3DObjectModel-3.3.xml:

// profile validation test, if connected to full scene
if (findAncestorX3DObject() != null)
{
        String     modelProfile = findAncestorX3DObject().getProfile();
        headObject modelHead    = findAncestorX3DObject().getHead();
        ArrayList<componentObject> sceneComponentsList = new ArrayList<>();
        if (modelHead != null)
                sceneComponentsList = modelHead.getComponentList();
        boolean hasSatisfactoryComponent = false;
        for (componentObject nextComponent : sceneComponentsList)
        {
                if ( nextComponent.getName().equals("Networking") &&
                        (nextComponent.getLevel() >= 2))
                        hasSatisfactoryComponent = true;
        }
        if (!hasSatisfactoryComponent &&
                !modelProfile.equals("CADInterchange") &&
                !modelProfile.equals("Interactive") &&
                !modelProfile.equals("Immersive") &&
                !modelProfile.equals("MedicalInterchange") &&
                !modelProfile.equals("MPEG4Interactive") &&
                !modelProfile.equals("Full"))
        {
                String errorNotice =
ConfigurationProperties.ERROR_ILLEGAL_VALUE
+
                        ": invalid X3D profile='" +
getContainerFieldOverride() +
                        "' for parent X3D model, add element <componentInfo
name='Networking' level='2'/> or assignment " +
                        "' findAncestorX3DObject().getHea
d().addComponentInfo(\"Networking\").setLevel(2);";
                validationResult.append(errorNotice).append("\n");
                throw new InvalidFieldException(errorNotice); // report
error
        }
}

Tested satisfactorily on HelloWorldProgram.java which indeed self-diagnosed
itself to reveal a missing component entry for Layering level 1.

Test program runs satisfactorily, a few other quirks appear to be
adjusted/fixed.  Now running recently released Java JDK version "1.8.0_141".

Updates now uploading, autogeneration stylesheet changes and smoke tests
checked in, this new release should be available in about an hour.

        http://www.web3d.org/specifications/java/X3DJSAIL.html

Looking things over, will probably add class constants for minimum
COMPONENT and LEVEL later to simplify programmer access.


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170831/0ec02e78/attachment.html>


More information about the x3d-public mailing list