class DistanceCondition XSD: class SelectedCondition XSD:

Copyright © 2015 Open Geospatial Consortium 69 xsd:complexContent xsd:complexType xsd:element name=Condition type=ConditionType abstract=true substitutionGroup=ARElement

7.5.4.1 class DistanceCondition XSD:

xsd:complexType name=DistanceConditionType xsd:complexContent xsd:extension base=ConditionType xsd:sequence xsd:element name=max type=xsd:double maxOccurs=1 minOccurs=0 xsd:element name=min type=xsd:double maxOccurs=1 minOccurs=0 xsd:sequence xsd:extension xsd:complexContent xsd:complexType xsd:element name=DistanceCondition type=DistanceConditionType substitutionGroup=Condition Example: Model id=myModel ... -- representation of the mountain hut as a 3D model conditions DistanceCondition min200min -- only visible when distance is more than 200 meters -- DistanceCondition conditions Model Label id=myLabel ... -- representation of the mountain hut as a Label conditions DistanceCondition max500max min200min -- only visible when distance more than 200 meters, but less than 500 meters -- DistanceCondition conditions Label

7.5.4.2 class SelectedCondition XSD:

xsd:complexType name=SelectedConditionType xsd:complexContent xsd:extension base=ConditionType Copyright © 2015 Open Geospatial Consortium 70 xsd:sequence xsd:element name=listener maxOccurs=1 minOccurs=0 xsd:simpleType xsd:restriction base=xsd:string xsd:enumeration value=feature xsd:enumeration value=anchor xsd:restriction xsd:simpleType xsd:element xsd:element name=selected type=xsd:boolean maxOccurs=1 minOccurs=1 xsd:sequence xsd:extension xsd:complexContent xsd:complexType xsd:element name=SelectedCondition type=SelectedConditionType substitutionGroup=Condition Example: Model id=myModel conditions SelectedCondition listenerfeaturelistener selectedtrueselected -- only visible when the Feature the VisualAsset is attached to is selected -- SelectedCondition conditions href xlink:href=http:myserver.commyModel.dae Model Copyright © 2015 Open Geospatial Consortium 71 8 ECMAScript Bindings normative Requirements Class http:www.opengis.netspecarml2.0reqscripting Target Type Software Implementation The following section describes the scripting part of ARML 2.0. Throughout this section, an WebIDL translation of the object model is introduced to define ECMAScript bindings and a JSON serialization of the ARML 2.0 object model. ARML provides ECMAScript the standardized version of JavaScript bindings to allow the dynamic access and modification of objects in the AR scene, as well as event handlers to react on user input. In addition to the XML serialization, each class defined in ARML also has a JSON serialization, which is used to access and modify the properties of the objects in the scene. Implementations are encouraged to support ARMLs ECMAScript bindings to allow the developer dynamic access to the scene. However, if ECMAScript bindings cannot be provided for whatever reason, the implementation must clearly state that only the descriptive ARML specification is supported.

8.1 Accessing ARElements and Modifying the Scene

Implementations must ensure that an arml object is injected into the ECMAScript runtime context on startup. This object is the root node for any scripting operations on the AR scene and serves as the namespace for the objects defined in ARML 2.0. Requirement http:www.opengis.netspecarml2.0reqscriptinggeneralarml_injection On startup, the arml object shall be injected into the ECMAScript runtime. In addition to serving as the namespace, arml has the following properties and methods: module arml { readonly attribute ARElement[] arElements; ARElement getARElementByIdString id; void addToSceneARElement element; void removeFromSceneARElement element; void addEventListenerString type, EventListener listener; void removeEventListenerString type, EventListener listener; ... all interface objects from below } getARElementByIdString id returns the object having its id property set to the passed String. In case no such object exists, or id is empty, the call returns null. addToSceneARElement element adds the given element to the AR scene