Package org.web3d.x3d.sai
Interface MFVec3d
-
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(double[] value) Places a new value at the end of the existing value, increasing the field length accordingly.void
clear()
Removes all values in the field and changes the field size to zero.void
get1Value
(int index, double[] vec) Get the value of a particular vector value in the event out array.void
getValue
(double[] vec) Get the values of the event out flattened into a single 1D array.void
getValue
(double[][] vec) Write the value of the event out to the given array.void
insertValue
(int index, double[] value) Inserts a value into an existing index of the field.void
removeValue
(int index) Removes one value from the field.void
set1Value
(int index, double[] value) Set a particular vector value in the given eventIn array.void
setValue
(int numVec, double[] value) Set the value of the array of 3D vectors.void
setValue
(int numVec, double[][] value) Set the value of the array of 3D vectors.Methods inherited from interface org.web3d.x3d.sai.X3DField
addX3DEventListener, getDefinition, getUserData, isReadable, isWritable, removeX3DEventListener, setUserData
-
Method Details
-
append
void append(double[] value) Places a new value at the end of the existing value, increasing the field length accordingly.- Parameters:
value
- The value to append value[0] = X
value[1] = Y
value[2] = Z- Throws:
ArrayIndexOutOfBoundsException
- A value did not contain at least three values for the vector definition.
-
clear
void clear()Removes all values in the field and changes the field size to zero. -
getValue
void getValue(double[][] vec) Write the value of the event out to the given array.- Parameters:
vec
- The array to be filled in where
vec[i][0] = X
vec[i][1] = Y
vec[i][2] = Z- Throws:
ArrayIndexOutOfBoundsException
- The provided array was too small
-
getValue
void getValue(double[] vec) Get the values of the event out flattened into a single 1D array. The array must be at least 3 times the size of the array.- Parameters:
vec
- The array to be filled in where the vec[i + 0] = X
vec[i + 1] = Y
vec[i + 2] = Z- Throws:
ArrayIndexOutOfBoundsException
- The provided array was too small
-
get1Value
void get1Value(int index, double[] vec) Get the value of a particular vector value in the event out array.- Parameters:
index
- The position to get the vector value from.vec
- The array to place the value in where. vec[0] = X
vec[1] = Y
vec[2] = Z- Throws:
ArrayIndexOutOfBoundsException
- The provided array was too small or the index was outside the current data array bounds.
-
insertValue
Inserts a value into an existing index of the field. Current field values from the index to the end of the field are shifted down and the field length is increased by one to accommodate the new element. If the index is out of the bounds of the current field an ArrayIndexOutofBoundsException will be generated.- Parameters:
index
- The position at which to insertvalue
- The new element to insert value[0] = X
value[1] = Y
value[2] = Z- Throws:
ArrayIndexOutOfBoundsException
- The index was outside the current field size.ArrayIndexOutOfBoundsException
- A value did not contain at least three values for the vector definition.
-
removeValue
Removes one value from the field. Values at indices above the removed element will be shifted down by one and the size of the field will be reduced by one.- Parameters:
index
- The position of the value to remove.- Throws:
ArrayIndexOutOfBoundsException
- The index was outside the current field size.
-
setValue
void setValue(int numVec, double[] value) Set the value of the array of 3D vectors. Input is an array of doubles If value[i] does not contain at least three values it will generate an ArrayIndexOutOfBoundsException. If value[i] contains more than three items only the first three values will be used and the rest ignored.If one or more of the values for value[i] are null then the resulting event that is sent to the VRML scene graph is implementation dependent but no error indicator will be set here.
- Parameters:
numVec
- The number of items to copy from the arrayvalue
- The array of vec3d values where
value[i] = X
value[i+1] = Y
value[i+2] = Z- Throws:
ArrayIndexOutOfBoundsException
- A value did not contain at least three values for the vector definition.
-
setValue
void setValue(int numVec, double[][] value) Set the value of the array of 3D vectors. Input is an array of doubles If value[i] does not contain at least three values it will generate an ArrayIndexOutOfBoundsException. If value[i] contains more than three items only the first three values will be used and the rest ignored.If one or more of the values for value[i] are null then the resulting event that is sent to the VRML scene graph is implementation dependent but no error indicator will be set here.
- Parameters:
numVec
- The number of items to copy from the arrayvalue
- The array of vec3d values where
value[i][0] = X
value[i][1] = Y
value[i][2] = Z- Throws:
ArrayIndexOutOfBoundsException
- A value did not contain at least three values for the vector definition.
-
set1Value
void set1Value(int index, double[] value) Set a particular vector value in the given eventIn array. To the VRML world this will generate a full MFVec3f event with the nominated index value changed.The value array must contain at least three elements. If the array contains more than 3 values only the first 3 values will be used and the rest ignored.
If the index is out of the bounds of the current array of data values or the array of values does not contain at least 3 elements an ArrayIndexOutOfBoundsException will be generated.
- Parameters:
index
- The position to set the vector valuevalue
- The array of vector values where
value[0] = X
value[1] = Y
value[2] = Z- Throws:
ArrayIndexOutOfBoundsException
- A value did not contain at least 3 values for the vector
-