#X3D V3.0 utf8
# X3D-to-ClassicVRML XSL translation autogenerated by X3dToVrml97.xslt
# https://www.web3d.org/x3d/content/X3dToVrml97.xslt
# Generated using XSLT processor: Saxonica
PROFILE Immersive
# [X3D] version=3.0
# [X3D] noNamespaceSchemaLocation=https://www.web3d.org/specifications/x3d-3.0.xsd
# [head]
META "title" "SceneNodePrototype.x3d"
META "creator" "Don Brutzman"
META "created" "19 December 2000"
META "modified" "20 October 2019"
META "description" "Expose functionality of Browser class in Java/ECMAscript annexes of VRML 97 specification. Consider promotion to a native node in X3D/VRML 200x scenes."
META "warning" "Under development, many of these exposed attributes will be eliminated. Scene node will not be used in X3D proper, but may become a valuable prototype via SAI scripting."
META "identifier" "https://www.web3d.org/x3d/content/examples/Basic/development/SceneNodePrototype.x3d"
META "generator" "X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit"
META "license" "../license.html"
# [Scene] ========== ========== ==========
NavigationInfo { type [ "EXAMINE" "ANY" ] } ### Default X3D NavigationInfo
WorldInfo {
title "SceneNodePrototype.x3d"
}
PROTO Scene [
# Standard browser attributes exposed via VRML 97 Script annexes
inputOnly SFString createVrmlFromString
inputOnly SFString createVrmlFromURL
outputOnly MFNode createdVrmlNodes
outputOnly SFFloat currentFrameRate
outputOnly SFFloat currentSpeed
inputOnly SFString description
inputOnly SFBool evaluate
inputOnly SFString loadUrl
inputOnly SFString loadUrlParameter
outputOnly SFString name
inputOnly MFNode replaceWorld
outputOnly SFString version
outputOnly SFString worldUrl
inputOnly SFBool addRoute
inputOnly SFBool deleteRoute
inputOnly SFNode fromNode
inputOnly SFString fromEventOut
inputOnly SFNode toNode
inputOnly SFString toEventIn
# Candidate additions
### Warning: ProtoInterface is unreferenced in ProtoBody with no corresponding IS/connect/@protoField
outputOnly SFNode boundBackground
### Warning: ProtoInterface is unreferenced in ProtoBody with no corresponding IS/connect/@protoField
outputOnly SFNode boundFog
### Warning: ProtoInterface is unreferenced in ProtoBody with no corresponding IS/connect/@protoField
outputOnly SFNode boundGeoViewpoint
### Warning: ProtoInterface is unreferenced in ProtoBody with no corresponding IS/connect/@protoField
outputOnly SFNode boundNavigationInfo
### Warning: ProtoInterface is unreferenced in ProtoBody with no corresponding IS/connect/@protoField
outputOnly SFNode boundViewpoint
outputOnly MFString response
### Warning: ProtoInterface is unreferenced in ProtoBody with no corresponding IS/connect/@protoField
inputOutput SFBool dashboardVisible TRUE
### Warning: ProtoInterface is unreferenced in ProtoBody with no corresponding IS/connect/@protoField
inputOutput SFInt32 pixelWidth -1
### Warning: ProtoInterface is unreferenced in ProtoBody with no corresponding IS/connect/@protoField
inputOutput SFInt32 pixelHeight -1
] {
DEF BrowserScript Script {
inputOnly SFString createVrmlFromString IS createVrmlFromString
inputOnly SFString createVrmlFromURL IS createVrmlFromURL
outputOnly MFNode createdVrmlNodes IS createdVrmlNodes
outputOnly SFFloat currentFrameRate IS currentFrameRate
outputOnly SFFloat currentSpeed IS currentSpeed
inputOnly SFString description IS description
inputOnly SFBool evaluate IS evaluate
inputOnly SFString loadUrl IS loadUrl
inputOnly SFString loadUrlParameter IS loadUrlParameter
outputOnly SFString name IS name
inputOnly MFNode replaceWorld IS replaceWorld
outputOnly SFString version IS version
outputOnly SFString worldUrl IS worldUrl
inputOnly SFBool addRoute IS addRoute
inputOnly SFBool deleteRoute IS deleteRoute
inputOnly SFNode fromNode IS fromNode
inputOnly SFString fromEventOut IS fromEventOut
inputOnly SFNode toNode IS toNode
inputOnly SFString toEventIn IS toEventIn
outputOnly MFString response IS response
directOutput TRUE
### Warning: Script outputOnly field 'response' has no assignment statement such as 'response[someIndex]=(someMFStringExpression);' in contained ecmascript: code
url [ "ecmascript: // ### X3D Browser.print() not supported by all VRML97 viewers, instead simply using print()
function evaluate (inputValue, timeStamp)
{
if (inputValue) // Boolean
{
currentFrameRate = Browser.getCurrentFrameRate ();
currentSpeed = Browser.getCurrentSpeed ();
version = Browser.getVersion ();
name = Browser.getName ();
worldUrl = Browser.getWorldURL ();
Browser.println ('currentFrameRate = ' + currentFrameRate);
Browser.println ('currentSpeed = ' + currentSpeed);
Browser.println ('version = ' + version);
Browser.println ('name = ' + name);
Browser.println ('worldUrl = ' + worldUrl);
}
}
function createVrmlFromString (inputValue, timeStamp)
{
// note VRML 97 method name didn't follow capitalization convention
createdVrmlNodes = Browser.createVrmlFromString (inputValue);
}
function createVrmlFromUrl (inputValue, timeStamp)
{
// note VRML 97 method name didn't follow capitalization convention
createdVrmlNodes = Browser.createVrmlFromURL (inputValue);
}
function description (inputValue, timeStamp)
{
Browser.println ('description = ' + inputValue);
Browser.setDescription (inputValue);
}
function replaceWorld (inputValue, timeStamp)
{
Browser.replaceWorld (inputValue);
}
function addRoute (inputValue, timeStamp)
{
if (inputValue) // Boolean
{
Browser.addRoute (fromNode, fromEventOut, toNode, toEventIn);
}
}
function deleteRoute (inputValue, timeStamp)
{
if (inputValue) // Boolean
{
Browser.deleteRoute (fromNode, fromEventOut, toNode, toEventIn);
}
}
function loadURL (inputValue, timeStamp)
{
Browser.println ('loadURL = ' + inputValue);
Browser.println ('loadUrlParameter = ' + loadUrlParameter);
Browser.loadURL (inputValue, loadUrlParameter);
}
function createVrmlFromURL (SFStringValue, timestamp)
{
}
function loadUrl (SFStringValue, timestamp)
{
}
function loadUrlParameter (SFStringValue, timestamp)
{
}
function fromNode (SFNodeValue, timestamp)
{
}
function fromEventOut (SFStringValue, timestamp)
{
}
function toNode (SFNodeValue, timestamp)
{
}
function toEventIn (SFStringValue, timestamp)
{
}
" ]
}
}
# Example invocation
DEF SceneNode Scene {
}
Shape {
geometry DEF Output3dText Text {
string [ "Click text for partial Scene node test" ]
fontStyle FontStyle {
justify [ "MIDDLE" "MIDDLE" ]
size 0.5
}
}
appearance Appearance {
material Material {
diffuseColor 0 0.6 0.6
}
}
}
DEF ClickTextSensor TouchSensor {
description "Click text for partial Scene node test"
}
DEF AssembleBrowserOutputText Script {
inputOnly SFFloat currentFrameRate
inputOnly SFFloat currentSpeed
inputOnly SFString name
inputOnly SFString version
inputOnly SFString worldUrl
outputOnly MFString evaluatedResult
url [ "ecmascript:
function initialize ()
{
evaluatedResult = new MFString (
'Click for partial Scene node test:',
' ', ' ', ' ', ' ', ' ', ' ', ' ');
}
function currentFrameRate (inputValue, timeStamp)
{
evaluatedResult [2] = 'currentFrameRate=' + inputValue;
}
function currentSpeed (inputValue, timeStamp)
{
evaluatedResult [3] = 'currentSpeed=' + inputValue;
}
function version (inputValue, timeStamp)
{
evaluatedResult [4] = 'version=' + inputValue;
}
function name (inputValue, timeStamp)
{
evaluatedResult [5] = 'name=' + inputValue;
}
function worldUrl (inputValue, timeStamp)
{
evaluatedResult [6] = 'worldUrl=';
evaluatedResult [7] = inputValue;
}
" ]
}
ROUTE ClickTextSensor.isActive TO SceneNode.evaluate
ROUTE SceneNode.currentFrameRate TO AssembleBrowserOutputText.currentFrameRate
ROUTE SceneNode.currentSpeed TO AssembleBrowserOutputText.currentSpeed
ROUTE SceneNode.version TO AssembleBrowserOutputText.version
ROUTE SceneNode.name TO AssembleBrowserOutputText.name
ROUTE SceneNode.worldUrl TO AssembleBrowserOutputText.worldUrl
ROUTE AssembleBrowserOutputText.evaluatedResult TO Output3dText.string