#VRML V2.0 utf8 PROTO ACCUMULATOR [ exposedField SFFloat transparency 0.8 field SFVec3f text_position 0 0 0 field MFString name "accumulator" field SFVec3f position 0 0 0 ] { Group { children [ Transform { translation IS position children Billboard { children Transform { translation IS text_position children Shape { geometry Text {string IS name fontStyle FontStyle { size 2 family "SERIF" justify "LEFT" } } } #Shape } #Transform } #Billboard } #Transform Text Transform { translation IS position children Shape { appearance Appearance { material Material { ambientIntensity 0 diffuseColor .3 0.4 .6 specularColor 1 0.94 0.54 emissiveColor 0.4 0.4 0.4 shininess 0 transparency IS transparency } } geometry Sphere {radius 2} } #Shape } #Transform Sphere ] #children } #Group } PROTO OPERATION [ exposedField SFFloat transparency 0.6 field SFVec3f text_position 0 0 0 field MFString name "operation" field SFVec3f position 0 0 0 field SFRotation rotation 0 0 1 0 ] { Group { children [ Transform { translation IS position rotation IS rotation children Shape { appearance Appearance { material Material { ambientIntensity 0 diffuseColor 1 0 0 specularColor 1 0 0 emissiveColor 0 0 0 shininess 0.2 transparency IS transparency } } geometry Box {size 6 6 6} } #Shape } #Transform Transform { translation IS position children Billboard { children Transform { translation IS text_position children Shape { geometry Text {string IS name fontStyle FontStyle { size 4 family "SERIF" justify "LEFT" } } } #Shape } #Transform } #Billboard } #Transform Text ] #children } #Group } PROTO PLACETOTRANSITIONTRACE [ field SFRotation rotation 0 0 0 0 field SFVec3f position 0 0 0 field SFVec3f scale 0 0 0 ] { Transform { rotation IS rotation scale IS scale translation IS position children Transform { } children [ Transform { children Shape { appearance Appearance { material Material { ambientIntensity 0.25 diffuseColor 0.07 0.12 0 specularColor 0.36 0.36 0.36 emissiveColor 0.11 0.19 0 shininess 0.08 } } geometry Sphere { } } } ] } } PROTO TRANSITIONTOPLACETRACE [ field SFRotation rotation 0 0 0 0 field SFVec3f position 0 0 0 field SFVec3f scale 0 0 0 ] { Group { children #[ Transform { translation IS position rotation IS rotation scale IS scale children Transform { } children [ Transform { children Shape { appearance Appearance { material Material { ambientIntensity 0.142857 diffuseColor 0.35 0.1 0.1 specularColor 0.37 0.06 0.06 emissiveColor 0.1 0.03 0.03 shininess 0.06 } } geometry Sphere { } } } ] } } } PROTO TOKEN_STATUS [ field SFInt32 int_value 0 field SFNode itsplace NULL field SFVec3f position 0 0 0 eventIn SFInt32 set_clock field MFString behavior "" field SFNode node NULL ] { Transform { translation IS position children [ Billboard { axisOfRotation 0 0 0 children [ Shape { appearance Appearance { material DEF Mat Material {diffuseColor 1 1 0}} geometry DEF Token_Status_Display Text { string "" length 4 fontStyle FontStyle { family "SANS" justify "MIDDLE" horizontal TRUE leftToRight TRUE size 2.5 spacing 1.2 style "BOLD" } #FontStyle length 0 } #geometry } #Shape ] #children } #Billboard DEF Tokenstatus Script { eventIn SFInt32 set_clock IS set_clock field SFInt32 int_value IS int_value eventOut MFString set_string field SFNode itsplace IS itsplace field SFNode node IS node # url IS behavior url "javascript: function set_clock(value,ts) { node = itsplace.geometry[0]; int_value = itsplace.tokencount; if (itsplace.tokencount == 0) node.set_transparency = .7; else node.set_transparency = .3; set_string = new MFString(new String(int_value)); } " } #Script ] } #Transform ROUTE Tokenstatus.set_string TO Token_Status_Display.set_string } PROTO OBJECT [ exposedField SFBool input FALSE field MFNode behavior [] field MFNode contains [] ] { Transform { children [ Group {children IS behavior} Group {children IS contains} ] }#Transform }#DEF OBJECT PROTO BOARD [ eventIn SFFloat set_clock field MFString text "" field SFVec3f position 0 0 0 field MFString behavior "" field SFNode inside_state NULL field SFNode object NULL field SFNode node NULL ] {Transform { children [ Transform { translation IS position children Billboard { children Transform { children Shape { geometry Text { string IS text fontStyle FontStyle { size 02.75 family "SERIF" #style "ITALIC" justify "MIDDLE" } } } #Shape } #Transform } #Billboard } #Transform DEF S Script { eventIn SFFloat set_clock IS set_clock field SFNode inside_state IS inside_state field SFNode object IS object field SFNode node IS node directOutput TRUE url IS behavior } #DEF S ] }} #PROTO BOARD