|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvrml.eai.field.BaseField
vrml.eai.field.EventOut
vrml.eai.field.EventOutMField
vrml.eai.field.EventOutMFVec3f
public abstract class EventOutMFVec3f
Reference to a MFVec3f event-out slot. Use this class to read values from MFVec3f event-out slots.
The following example gets the coordinates from the "point" field of a Coordinate node and prints them to the console:
vrml.eai.Node coordinate = ...; vrml.eai.field.EventOutMFVec3f point_changed = (vrml.eai.field.EventOutMFVec3f)coordinate.getEventOut("point_changed"); float[][] v = point_changed.getValue(); for (int i = 0; i < v.length; ++i) System.out.println("x = " + v[i][0] + ", y = " + v[i][1] + ", z = " + v[i][2]);
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 |
EventOutMFVec3f()
Default Constructor. |
Method Summary | |
---|---|
abstract float[] |
get1Value(int index)
Returns one element of the MFVec3f event-out slot. |
abstract void |
get1Value(int index,
float[] value)
Returns one element of the MFVec3f event-out slot. |
abstract float[][] |
getValue()
Returns the current value of the MFVec3f event-out slot. |
abstract void |
getValue(float[] value)
Returns the current value of the MFVec3f event-out slot. |
abstract void |
getValue(float[][] value)
Returns the current value of the MFVec3f 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 |
---|
protected EventOutMFVec3f()
Node.getEventOut(java.lang.String)
method.
Method Detail |
---|
public abstract float[][] getValue()
The following example gets the coordinates from the "point" field of a Coordinate node and prints them to the console:
vrml.eai.Node coordinate = ...; vrml.eai.field.EventOutMFVec3f point_changed = (vrml.eai.field.EventOutMFVec3f)coordinate.getEventOut("point_changed"); float[][] v = point_changed.getValue(); for (int i = 0; i < v.length; ++i) System.out.println("x = " + v[i][0] + ", y = " + v[i][1] + ", z = " + v[i][2]);
public abstract void getValue(float[][] value) throws java.lang.ArrayIndexOutOfBoundsException
The following example gets the coordinates from the "point" field of a Coordinate node and prints them to the console:
vrml.eai.Node coordinate = ...; vrml.eai.field.EventOutMFVec3f point_changed = (vrml.eai.field.EventOutMFVec3f)coordinate.getEventOut("point_changed"); int size = point_changed.size(); float[][] v = new float[size][]; for (int i = 0; i < size; ++i) v[i] = new float[3]; point_changed.getValue(v); for (int i = 0; i < size; ++i) System.out.println("x = " + v[i][0] + ", y = " + v[i][1] + ", z = " + v[i][2]);
value
- An array of float arrays that contain at least three values.
This array gets filled with the current vector values. The first
element of each array gets filled with the x component of the
vector, the second element with the y component, and the third
element with the z component.
java.lang.ArrayIndexOutOfBoundsException
- when either the value array
is too small, or one of the arrays contained in the value array has
less then three elements.public abstract void getValue(float[] value) throws java.lang.ArrayIndexOutOfBoundsException
The following example gets the coordinates from the "point" field of a Coordinate node and prints them to the console:
vrml.eai.Node coordinate = ...; vrml.eai.field.EventOutMFVec3f point_changed = (vrml.eai.field.EventOutMFVec3f)coordinate.getEventOut("point_changed"); float[] v = new float[point_changed.size() * 3]; point_changed.getValue(v); for (int i = 0; i < v.length; i += 3) System.out.println("x = " + v[i] + ", y = " + v[i + 1] + ", z = " + v[i + 2]);
value
- An array of float values that gets filled with the
current vector values. The number of elements in this array
must be at least three times the number of vector values. The
elements at the positions [i x 3] get filled with the x components
of the vectors, the elements at [i x 3 + 1] with the y
components, and the elements at [i x 3 + 2] with the z components
(for 0 <= i < EventOutMField.size()
).
java.lang.ArrayIndexOutOfBoundsException
- when the value array is
too small.public abstract float[] get1Value(int index) throws java.lang.ArrayIndexOutOfBoundsException
The following example gets the first coordinate from the "point" field of a Coordinate node and prints it to the console:
vrml.eai.Node coordinate = ...; vrml.eai.field.EventOutMFVec3f point_changed = (vrml.eai.field.EventOutMFVec3f)coordinate.getEventOut("point_changed"); float[] v = point_changed.get1Value(0); System.out.println("x = " + v[0] + ", y = " + v[1] + ", z = " + v[2]);
index
- The index of the element, starting at 0.
java.lang.ArrayIndexOutOfBoundsException
- when the index is invalid.public abstract void get1Value(int index, float[] value) throws java.lang.ArrayIndexOutOfBoundsException
The following example gets the first coordinate from the "point" field of a Coordinate node and prints it to the console:
vrml.eai.Node coordinate = ...; vrml.eai.field.EventOutMFVec3f point_changed = (vrml.eai.field.EventOutMFVec3f)coordinate.getEventOut("point_changed"); float[] v = new float[3]; point_changed.get1Value(0, v); System.out.println("x = " + v[0] + ", y = " + v[1] + ", z = " + v[2]);
index
- The index of the element, starting at 0.value
- An array of at least three float values that gets filled
with the vector. The first value gets filled with the
x component of the vector, the second value with
the y component, and the third value with the z component.
java.lang.ArrayIndexOutOfBoundsException
- when the index is invalid, or
the value array has less than three elements.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |