Certain aspects of the EAI are of necessity language and platform dependent, such as the various getBrowser operations. Therefore, implementations for specific languages and environments, such as Java Applets and C++ COM, are provided as additional annexes. As new implementations are developed, it is recommended that they employ the IDL Specification as the initial starting point.
There is a distinct difference between the access type of the underlying
field that was retrieved from the node and how it is represented by the
interfaces. A request is made of the node to access any field to be viewed
as either an eventIn or an eventOut. The node interface then either returns
the type or generates an error condition. The acceptable conditions for
succesful completion of the request are defined in Table
A.2
The first alternative is provided through getType() method provided in the BaseField interface. This returns a long which has one of the values defined by the constant types also defined in that interface.
The second alternative is provided by the interface hierarchy. The EventIn and EventOut interfaces are further derived to provide interfaces for each exact field type.
The requestor ID is an instance of the BrowserListener interface when the service request is Register Browser Interest.
The requestor ID is an instance of the VrmlEventListener interface when the service request is Register Field_Interest.
InvalidBrowserException is used to indicate an EAIBrowserRef
has been disposed of.
InvalidNodeException is used to indicate an EAINodeID
has been disposed of.
InvalidEventInException is used to indicate the named field is not accessable as an eventIn from the Node.getEventIn() method.
InvalidEventOutException is used to indicate the named field is not accessable as an eventOut from the Node.getEventOut() method.
SomeNode {
MFField []
}
An empty MF field shall return an sequence of length zero if queried about its value. The size() method of the MField base interfaces shall return a value of 0.
If beginUpdate has been called and multiple set1Values have been called on that field, the result when endUpdate is called shall be a single event with all of the individual values set. If two calls are made to set a particular array index, the last value written shall be used.
If beginUpdate has not been called, the result shall be an event that contains the entire field value with the individual value changed. Multiple set1Value calls to the field shall result in the equivalent number of events being generated inside the VRML browser.
A get1Value method is provided for MF fields. This allows access to a single value out of the many values. When an attempt is made to access a value at an index greater than the number of items in that eventOut, an ArrayIndexOutOfBoundsException shall be generated.
Specific language bindings may define additional or overloaded getValue methods as appropriate for the particular language.
A set1Value method is provided for MFFields. This allows the ability to change a single value of a field without having to re-create the entire array of values. When an attempt is made to set a value at an index greater than the number of items in that eventIn, an ArrayIndexOutOfBoundsException shall be generated.
Specific language bindings may define additional or overloaded setValue methods as appropriate for the particular language.
typedef sequence<string> stringarray; typedef sequence<float> floatarray; typedef sequence<long> longarray; typedef sequence<double> doublearray; typedef sequence<octet> bytearray; typedef sequence<stringarray> stringdoublearray; typedef sequence<floatarray> floatdoublearray; typedef sequence<longarray> longdoublearray; module vrml { /* forward declarations */ module eai { interface Browser; module field { interface BaseField; interface EventIn; interface EventOut; }; module event { interface BrowserEvent { const long INITIALIZED = 1; const long SHUTDOWN = 2; const long URL_ERROR = 3; const long CONNECTION_ERROR = 4; const long LAST_IDENTIFIER = 5; long getID(); Browser getSource(); }; interface BrowserListener { void browserChanged(in BrowserEvent evt); }; interface VrmlEvent { field::BaseField getSource(); double getTime(); }; interface VrmlEventListener { void eventOutChanged(in VrmlEvent evt); }; }; exception VrmlException {}; exception IllegalArgumentException {}; exception ArrayIndexOutOfBoundsException {}; module field { exception InvalidFieldException {}; exception InvalidEventInException {}; exception InvalidEventOutException {}; }; exception InvalidBrowserException {}; exception InvalidNodeException {}; exception InvalidVrmlException {}; exception NoSuchBrowserException {}; exception NotSupportedException {}; exception ConnectionException {}; interface Node { string getType() raises (InvalidNodeException); string getName() raises (InvalidNodeException); eai::field::EventIn getEventIn(in string name) raises (eai::field::InvalidEventInException, InvalidNodeException); eai::field::EventOut getEventOut(in string name) raises (eai::field::InvalidEventOutException, InvalidNodeException); void dispose() raises (InvalidNodeException); }; typedef sequence<Node> nodearray; interface Browser { string getName() raises (InvalidBrowserException, ConnectionException); string getVersion() raises (InvalidBrowserException, ConnectionException); float getCurrentSpeed() raises (InvalidBrowserException, ConnectionException); float getCurrentFrameRate() raises (InvalidBrowserException, ConnectionException); string getWorldURL() raises (InvalidBrowserException, ConnectionException); void replaceWorld(in nodearray node_names) raises (IllegalArgumentException, InvalidBrowserException, ConnectionException); void loadURL(in stringarray url, in stringarray parameter) raises (InvalidBrowserException, ConnectionException); void setDescription(in string description) raises (InvalidBrowserException, ConnectionException); nodearray createVrmlFromString(in string vrmlSyntax) raises (InvalidVrmlException, InvalidBrowserException, ConnectionException); void createVrmlFromURL(in stringarray url, in Node node, in string event) raises (InvalidBrowserException, InvalidNodeException, ConnectionException); Node getNode(in string name) raises (InvalidNodeException, InvalidBrowserException, ConnectionException); void addRoute(in Node fromNode, in string fromEventOut, in Node toNode, in string toEventIn) raises (eai::field::InvalidEventInException, eai::field::InvalidEventOutException, InvalidBrowserException, InvalidNodeException, ConnectionException); void deleteRoute(in Node fromNode, in string fromEventOut, in Node toNode, in string toEventIn) raises (eai::field::InvalidEventInException, eai::field::InvalidEventOutException, InvalidBrowserException, InvalidNodeException, ConnectionException); void beginUpdate() raises (InvalidBrowserException, ConnectionException); void endUpdate() raises (InvalidBrowserException, ConnectionException); void dispose(); void addBrowserListener(in eai::event::BrowserListener l) raises (InvalidBrowserException, ConnectionException); void removeBrowserListener(in eai::event::BrowserListener l) raises (InvalidBrowserException, ConnectionException); }; module field { interface BaseField { const long SFBool = 1; const long SFColor = 2; const long SFFloat = 3; const long SFImage = 4; const long SFInt32 = 5; const long SFNode = 6; const long SFRotation = 7; const long SFString = 8; const long SFTime = 9; const long SFVec2f = 10; const long SFVec3f = 11; const long MFColor = 12; const long MFFloat = 13; const long MFInt32 = 14; const long MFNode = 15; const long MFRotation = 16; const long MFString = 17; const long MFTime = 18; const long MFVec2f = 19; const long MFVec3f = 20; const long UNSET_FIELD = 21; /* access types */ const long EVENTIN = 22; const long EVENTOUT = 23; const long EXPOSEDFIELD = 24; long getType(); long getAccessType(); string getName(); void addVrmlEventListener(in eai::event::VrmlEventListener l); void removeVrmlEventListener(in eai::event::VrmlEventListener l); }; /* note: IDL does not support overloading methods, so each interface has only one setValue and getValue method. Specific language bindings are free to add additional overloaded methods */ interface EventIn: BaseField { }; interface EventInMFColor: EventIn { void setValue(in floatdoublearray value) raises(IllegalArgumentException, ArrayIndexOutOfBoundsException); void set1Value(in long index, in floatarray value) raises(IllegalArgumentException, ArrayIndexOutOfBoundsException); }; interface EventInMFFloat: EventIn { void setValue(in floatarray value); void set1Value(in long index, in float value) raises(ArrayIndexOutOfBoundsException); }; interface EventInMFInt32: EventIn { void setValue(in longarray value); void set1Value(in long index, in long value) raises(ArrayIndexOutOfBoundsException); }; interface EventInMFNode: EventIn { void setValue(in nodearray node) raises(InvalidNodeException); void set1Value(in long index, in Node node) raises(InvalidNodeException, ArrayIndexOutOfBoundsException); }; interface EventInMFRotation: EventIn { void setValue(in floatdoublearray value) raises(ArrayIndexOutOfBoundsException); void set1Value(in long index, in floatarray value) raises(ArrayIndexOutOfBoundsException); }; interface EventInMFString: EventIn { void setValue(in stringarray value); void set1Value(in long index, in string value) raises(ArrayIndexOutOfBoundsException); }; interface EventInMFTime: EventIn { void setValue(in doublearray value); void set1Value(in long index, in double value) raises(ArrayIndexOutOfBoundsException); }; interface EventInMFVec2f: EventIn { void setValue(in floatdoublearray value) raises(ArrayIndexOutOfBoundsException); void set1Value(in long index, in floatarray value) raises(ArrayIndexOutOfBoundsException); }; interface EventInMFVec3f: EventIn { void setValue(in floatdoublearray value) raises(ArrayIndexOutOfBoundsException); void set1Value(in long index, in floatarray value) raises(ArrayIndexOutOfBoundsException); }; interface EventInSFBool: EventIn { void setValue(in boolean value); }; interface EventInSFColor: EventIn { void setValue(in floatarray value) raises(IllegalArgumentException, ArrayIndexOutOfBoundsException); }; interface EventInSFFloat: EventIn { void setValue(in float value); }; interface EventInSFImage: EventIn { void setValue(in long width, in long height, in long numComponents, in longarray pixels) raises(IllegalArgumentException, ArrayIndexOutOfBoundsException); }; interface EventInSFInt32: EventIn { void setValue(in long value); }; interface EventInSFNode: EventIn { void setValue(in Node value) raises(InvalidNodeException); }; interface EventInSFRotation: EventIn { void setValue(in floatarray value) raises(ArrayIndexOutOfBoundsException); }; interface EventInSFString: EventIn { void setValue(in string value); }; interface EventInSFTime: EventIn { void setValue(in double value); }; interface EventInSFVec2f: EventIn { void setValue(in floatarray value) raises(ArrayIndexOutOfBoundsException); }; interface EventInSFVec3f: EventIn { void setValue(in floatarray value) raises(ArrayIndexOutOfBoundsException); }; interface EventOut { }; interface EventOutMField: EventOut { long size(); }; interface EventOutMFColor: EventOutMField { floatdoublearray getValue(); floatarray get1Value(in long index) raises (ArrayIndexOutOfBoundsException); }; interface EventOutMFFloat: EventOutMField { floatarray getValue(); float get1Value(in long index) raises (ArrayIndexOutOfBoundsException); }; interface EventOutMFInt32: EventOutMField { longarray getValue(); long get1Value(in long index) raises (ArrayIndexOutOfBoundsException); }; interface EventOutMFNode: EventOutMField { nodearray getValue(); Node get1Value(in long index) raises (ArrayIndexOutOfBoundsException); }; interface EventOutMFRotation: EventOutMField { floatdoublearray getValue(); floatarray get1Value(in long index) raises (ArrayIndexOutOfBoundsException); }; interface EventOutMFString: EventOutMField { stringarray getValue(); string get1Value(in long index) raises (ArrayIndexOutOfBoundsException); }; interface EventOutMFTime: EventOutMField { doublearray getValue(); double get1Value(in long index) raises (ArrayIndexOutOfBoundsException); }; interface EventOutMFVec2f: EventOutMField { floatdoublearray getValue(); floatarray get1Value(in long index) raises (ArrayIndexOutOfBoundsException); }; interface EventOutMFVec3f: EventOutMField { floatdoublearray getValue(); floatarray get1Value(in long index) raises (ArrayIndexOutOfBoundsException); }; interface EventOutSFBool: EventOut { boolean getValue(); }; interface EventOutSFColor: EventOut { floatarray getValue(); }; interface EventOutSFFloat: EventOut { float getValue(); }; interface EventOutSFImage: EventOut { long getWidth(); long getHeight(); long getNumComponents(); longarray getPixels(); }; interface EventOutSFInt32: EventOut { long getValue(); }; interface EventOutSFNode: EventOut { Node getValue(); }; interface EventOutSFRotation: EventOut { floatarray getValue(); }; interface EventOutSFString: EventOut { string getValue(); }; interface EventOutSFTime: EventOut { double getValue(); }; interface EventOutSFVec2f: EventOut { floatarray getValue(); }; interface EventOutSFVec3f: EventOut { floatarray getValue(); }; }; }; };
http://www.vrml.org/Specifications/VRML97/part2/idlBind.html