vrml.eai.field
Class EventInMFVec2f
java.lang.Object
vrml.eai.field.BaseField
vrml.eai.field.EventIn
vrml.eai.field.EventInMFVec2f
public abstract class EventInMFVec2f
- extends EventIn
Reference to a MFVec2f event-in slot. Use this class to write
values into MFVec2f event-in slots.
The following example demonstrates how to write three
texture coordinate values into the "point" field of a
TextureCoordinate node:
vrml.eai.Node textureCoordinate = ...;
vrml.eai.field.EventInMFVec2f set_point = (vrml.eai.field.EventInMFVec2f)textureCoordinate.getEventIn("set_point");
float[][] v = new float[3][];
v[0] = new float[] { 0.0f, 0.0f }; // lower left
v[1] = new float[] { 1.0f, 0.0f }; // lower right
v[2] = new float[] { 0.5f, 1.0f }; // top center
set_point.setValue(v);
Fields inherited from class vrml.eai.field.BaseField |
MFColor, MFFloat, MFInt32, MFNode, MFRotation, MFString, MFTime, MFVec2f, MFVec3f, SFBool, SFColor, SFFloat, SFImage, SFInt32, SFMatrix4f, SFNode, SFRotation, SFString, SFTime, SFVec2f, SFVec3f |
Method Summary |
abstract void |
set1Value(int index,
float[] value)
Sets one element of the MFVec2f event-in slot. |
abstract void |
setValue(float[][] value)
Sets the elements of the MFVec2f event-in slot. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EventInMFVec2f
protected EventInMFVec2f()
- 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.getEventIn(java.lang.String)
method.
setValue
public abstract void setValue(float[][] value)
throws java.lang.ArrayIndexOutOfBoundsException
- Sets the elements of the MFVec2f event-in slot.
The following example demonstrates how to write three
texture coordinate values into the "point" field of a
TextureCoordinate node:
vrml.eai.Node textureCoordinate = ...;
vrml.eai.field.EventInMFVec2f set_point = (vrml.eai.field.EventInMFVec2f)textureCoordinate.getEventIn("set_point");
float[][] v = new float[3][];
v[0] = new float[] { 0.0f, 0.0f }; // lower left
v[1] = new float[] { 1.0f, 0.0f }; // lower right
v[2] = new float[] { 0.5f, 1.0f }; // top center
set_point.setValue(v);
- Parameters:
value
- The new vector values. This is an array of float arrays that
contain at least two values. The first value is the x component
of the vector, and the second value the y component.
- Throws:
java.lang.ArrayIndexOutOfBoundsException
- when one of the arrays
in the value parameter contains less than two values.
set1Value
public abstract void set1Value(int index,
float[] value)
throws java.lang.ArrayIndexOutOfBoundsException
- Sets one element of the MFVec2f event-in slot.
The following example demonstrates how to write a
texture coordinate value into the first element of
the "point" field of a TextureCoordinate node:
vrml.eai.Node textureCoordinate = ...;
vrml.eai.field.EventInMFVec2f set_point = (vrml.eai.field.EventInMFVec2f)textureCoordinate.getEventIn("set_point");
float[] v = new float[] { 0.0f, 0.0f };
set_point.set1Value(0, v);
- Parameters:
index
- The index of the element, starting at 0.value
- The new vector value. This is an array of
at least two float values. The first value is the x component
of the vector, and the second value the y component.
- Throws:
java.lang.ArrayIndexOutOfBoundsException
- when the index is
invalid, or the value array contains less then two values.