vrml.eai.field
Class EventOutMFRotation

java.lang.Object
  extended by vrml.eai.field.BaseField
      extended by vrml.eai.field.EventOut
          extended by vrml.eai.field.EventOutMField
              extended by vrml.eai.field.EventOutMFRotation

public abstract class EventOutMFRotation
extends EventOutMField

Reference to a MFRotation event-out slot. Use this class to read values from MFRotation event-out slots.

The following example gets the rotation values from the "keyValue" field of an OrientationInterpolator node and prints them to the console:

 vrml.eai.Node orientationInterpolator = ...;
 vrml.eai.field.EventOutMFRotation keyValue_changed = (vrml.eai.field.EventOutMFRotation)orientationInterpolator.getEventOut("keyValue_changed");
 float[][] r = keyValue_changed.getValue();
 for (int i = 0; i < r.length; ++i)
     System.out.println("x = " + r[i][0] + ", y = " + r[i][1] + ", z = " + r[i][2] + ", angle = " + r[i][3]);
 


Field Summary
 
Fields inherited from class vrml.eai.field.BaseField
MFColor, MFFloat, MFInt32, MFNode, MFRotation, MFString, MFTime, MFVec2f, MFVec3f, SFBool, SFColor, SFFloat, SFImage, SFInt32, SFNode, SFRotation, SFString, SFTime, SFVec2f, SFVec3f
 
Constructor Summary
protected EventOutMFRotation()
          Default Constructor.
 
Method Summary
abstract  float[] get1Value(int index)
          Returns one element of a MFRotation event-out slot.
abstract  void get1Value(int index, float[] value)
          Returns one element of a MFRotation event-out slot.
abstract  float[][] getValue()
          Returns the current value of a MFRotation event-out slot.
abstract  void getValue(float[] value)
          Returns the current value of a MFRotation event-out slot.
abstract  void getValue(float[][] value)
          Returns the current value of a MFRotation event-out slot.
 
Methods inherited from class vrml.eai.field.EventOutMField
size
 
Methods inherited from class vrml.eai.field.EventOut
addVrmlEventListener, getUserData, removeVrmlEventListener, setUserData
 
Methods inherited from class vrml.eai.field.BaseField
getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventOutMFRotation

protected EventOutMFRotation()
Default Constructor. This method is protected, i.e. you cannot create new instances of this class. The only way to get instances is via the Node.getEventOut(java.lang.String) method.

Method Detail

getValue

public abstract float[][] getValue()
Returns the current value of a MFRotation event-out slot.

The following example gets the rotation values from the "keyValue" field of an OrientationInterpolator node and prints them to the console:

 vrml.eai.Node orientationInterpolator = ...;
 vrml.eai.field.EventOutMFRotation keyValue_changed = (vrml.eai.field.EventOutMFRotation)orientationInterpolator.getEventOut("keyValue_changed");
 float[][] r = keyValue_changed.getValue();
 for (int i = 0; i < r.length; ++i)
     System.out.println("x = " + r[i][0] + ", y = " + r[i][1] + ", z = " + r[i][2] + ", angle = " + r[i][3]);
 

Returns:
The current rotation values. This is an array of float arrays that contain four values. The first value is the x component of the rotation axis, the second value the y component, the third value the z component, and the fourth value the rotation angle in radians.

getValue

public abstract void getValue(float[][] value)
                       throws java.lang.ArrayIndexOutOfBoundsException
Returns the current value of a MFRotation event-out slot.

The following example gets the rotation values from the "keyValue" field of an OrientationInterpolator node and prints them to the console:

 vrml.eai.Node orientationInterpolator = ...;
 vrml.eai.field.EventOutMFRotation keyValue_changed = (vrml.eai.field.EventOutMFRotation)orientationInterpolator.getEventOut("keyValue_changed");
 int size = keyValue_changed.size();
 float[][] r = new float[size][];
 for (int i = 0; i < size; ++i)
     r[i] = new float[4];
 keyValue_changed.getValue(r);
 for (int i = 0; i < size; ++i)
     System.out.println("x = " + r[i][0] + ", y = " + r[i][1] + ", z = " + r[i][2] + ", angle = " + r[i][3]);
 

Parameters:
value - An array of float arrays that contain at least four values. This array gets filled with the current rotation values. The first element of each array gets filled with the x component of the rotation axis, the second element with the y component, the third element with the z component, and the fourth element with the rotation angle in radians.
Throws:
java.lang.ArrayIndexOutOfBoundsException - when either the value array is too small, or one of the arrays contained in the value array has less then four elements.

getValue

public abstract void getValue(float[] value)
                       throws java.lang.ArrayIndexOutOfBoundsException
Returns the current value of a MFRotation event-out slot.

The following example gets the rotation values from the "keyValue" field of an OrientationInterpolator node and prints them to the console:

 vrml.eai.Node orientationInterpolator = ...;
 vrml.eai.field.EventOutMFRotation keyValue_changed = (vrml.eai.field.EventOutMFRotation)orientationInterpolator.getEventOut("keyValue_changed");
 float[] r = new float[keyValue_changed.size() * 4];
 keyValue_changed.getValue(r);
 for (int i = 0; i < r.length; i += 4)
     System.out.println("x = " + r[i] + ", y = " + r[i + 1] + ", z = " + r[i + 2] + ", angle = " + r[i + 3]);
 

Parameters:
value - An array of float values that gets filled with the current rotation values. The number of elements in this array must be at least four times the number of rotation values. The elements at the positions [i x 4] get filled with the x components of the rotation axes, the elements at [i x 4 + 1] with the y components, the elements at [i x 4 + 2] with the z components, and the elements at [i x 4 + 3] with the rotation angles in radians (for 0 <= i < EventOutMField.size()).
Throws:
java.lang.ArrayIndexOutOfBoundsException - when the value array is too small.

get1Value

public abstract float[] get1Value(int index)
                           throws java.lang.ArrayIndexOutOfBoundsException
Returns one element of a MFRotation event-out slot.

The following example gets the first rotation value from the "keyValue" field of an OrientationInterpolator node and print it to the console:

 vrml.eai.Node orientationInterpolator = ...;
 vrml.eai.field.EventOutMFRotation keyValue_changed = (vrml.eai.field.EventOutMFRotation)orientationInterpolator.getEventOut("keyValue_changed");
 float[] r = keyValue_changed.get1Value(0);
 System.out.println("x = " + r[0] + ", y = " + r[1] + ", z = " + r[2] + ", angle = " + r[3]);
 

Parameters:
index - The index of the element, starting at 0.
Returns:
The rotation value. This is an array of four float values. The first value contains the x component of the rotation axis, the second value the y component, the third value the z component, and the fourth value the rotation angle in radians.
Throws:
java.lang.ArrayIndexOutOfBoundsException - when the index is invalid.

get1Value

public abstract void get1Value(int index,
                               float[] value)
                        throws java.lang.ArrayIndexOutOfBoundsException
Returns one element of a MFRotation event-out slot.

The following example gets the first rotation value from the "keyValue" field of an OrientationInterpolator node and print it to the console:

 vrml.eai.Node orientationInterpolator = ...;
 vrml.eai.field.EventOutMFRotation keyValue_changed = (vrml.eai.field.EventOutMFRotation)orientationInterpolator.getEventOut("keyValue_changed");
 float[] r = new float[4];
 keyValue_changed.get1Value(0, r);
 System.out.println("x = " + r[0] + ", y = " + r[1] + ", z = " + r[2] + ", angle = " + r[3]);
 

Parameters:
index - The index of the element, starting at 0.
value - An array of at least four float values that gets filled with the rotation. The first value gets filled with the x component of the rotation axis, the second value with the y component, the third value with the z component, and the fourth value with the rotation angle in radians.
Throws:
java.lang.ArrayIndexOutOfBoundsException - when the index is invalid, or the value array has less than four elements.