vrml.field
Class MFVec3f

java.lang.Object
  extended by vrml.Field
      extended by vrml.MField
          extended by vrml.field.MFVec3f
All Implemented Interfaces:
java.lang.Cloneable

public class MFVec3f
extends MField

Represents a VRML MFVec3f field in Java.


Constructor Summary
MFVec3f()
          Default constructor.
MFVec3f(float[] vec3s)
          Construct an MFVec3f field.
MFVec3f(float[][] vec3s)
          Construct an MFVec3f field.
MFVec3f(int size, float[] vec3s)
          Construct an MFVec3f field.
 
Method Summary
 void addValue(ConstSFVec3f vec)
          Add a new element at the end of the list.
 void addValue(float x, float y, float z)
          Add a new element at the end of the list.
 void addValue(SFVec3f vec)
          Add a new element at the end of the list.
 void clear()
          Removes all fields from the MField.
 void delete(int index)
          Deletes a field from the MField.
 void get1Value(int index, float[] vec3s)
          Retrieves a specific element in an MFVec3f and returns it as a float array.
 void get1Value(int index, SFVec3f vec)
          Retrieves a specific element in an MFVec3f and returns it as an SFVec3f.
 int getSize()
          Number of elements contained in the MField.
 void getValue(float[] vec3s)
          Retrieves the value of an MFVec3f field.
 void getValue(float[][] vec3s)
          Retrieves the value of an MFVec3f field.
 void insertValue(int index, ConstSFVec3f vec)
          Insert a new element at the specified position.
 void insertValue(int index, float x, float y, float z)
          Insert a new element at the specified position.
 void insertValue(int index, SFVec3f vec)
          Insert a new element at the specified position.
 void set1Value(int index, ConstSFVec3f vec)
          Set a specified element in the field.
 void set1Value(int index, float x, float y, float z)
          Set a specified element in the field.
 void set1Value(int index, SFVec3f vec)
          Set a specified element in the field.
 void setValue(ConstMFVec3f vecs)
          Set the value of the field.
 void setValue(float[] vec3s)
          Set the value of the field.
 void setValue(float[][] vec3s)
          Set the value of the field.
 void setValue(int size, float[] vec3s)
          Set the value of the field.
 void setValue(MFVec3f vecs)
          Set the value of the field.
 
Methods inherited from class vrml.Field
clone, dispose, finalize, getPeer, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MFVec3f

public MFVec3f()
Default constructor.


MFVec3f

public MFVec3f(float[][] vec3s)
Construct an MFVec3f field.

Parameters:
vec3s - An array of sets of x,y,z values

MFVec3f

public MFVec3f(float[] vec3s)
Construct an MFVec3f field.

Parameters:
vec3s - List of x,y,z tuples

MFVec3f

public MFVec3f(int size,
               float[] vec3s)
Construct an MFVec3f field.

Parameters:
size - Number of SFVec3f elements passed in.
vec3s - List of x,y,z tuples
Method Detail

getSize

public int getSize()
Description copied from class: MField
Number of elements contained in the MField.

Specified by:
getSize in class MField
Returns:
Number of elements.

clear

public void clear()
Description copied from class: MField
Removes all fields from the MField.

Specified by:
clear in class MField

delete

public void delete(int index)
Description copied from class: MField
Deletes a field from the MField.

Specified by:
delete in class MField
Parameters:
index - Index of field to delete.

getValue

public void getValue(float[][] vec3s)
Retrieves the value of an MFVec3f field.

Parameters:
vec3s - 2D array of x,y,z tuples to be returned.

getValue

public void getValue(float[] vec3s)
Retrieves the value of an MFVec3f field.

Parameters:
vec3s - Array of x,y,z tuples to be returned.

get1Value

public void get1Value(int index,
                      float[] vec3s)
Retrieves a specific element in an MFVec3f and returns it as a float array.

Parameters:
index - Position of desired element
vec3s - Element at specified position

get1Value

public void get1Value(int index,
                      SFVec3f vec)
Retrieves a specific element in an MFVec3f and returns it as an SFVec3f.

Parameters:
index - Position of desired element
vec - Element at specified position

setValue

public void setValue(float[][] vec3s)
Set the value of the field.

Parameters:
vec3s - New value for field.

setValue

public void setValue(float[] vec3s)
Set the value of the field.

Parameters:
vec3s - New value for field.

setValue

public void setValue(int size,
                     float[] vec3s)
Set the value of the field.

Parameters:
size - Size of new value for field.
vec3s - New value for field.

setValue

public void setValue(MFVec3f vecs)
Set the value of the field.

Parameters:
vecs - New value for field.

setValue

public void setValue(ConstMFVec3f vecs)
Set the value of the field.

Parameters:
vecs - New value for field.

set1Value

public void set1Value(int index,
                      float x,
                      float y,
                      float z)
Set a specified element in the field.

Parameters:
index - Position of element to update.
x - X-component of new value.
y - Y-component of new value.
z - Z-component of new value.

set1Value

public void set1Value(int index,
                      ConstSFVec3f vec)
Set a specified element in the field.

Parameters:
index - Position of element to update.
vec - New value for element.

set1Value

public void set1Value(int index,
                      SFVec3f vec)
Set a specified element in the field.

Parameters:
index - Position of element to update.
vec - New value for element.

addValue

public void addValue(float x,
                     float y,
                     float z)
Add a new element at the end of the list.

Parameters:
x - X-component of the vector to add.
y - Y-component of the vector to add.
z - Z-component of the vector to add.

addValue

public void addValue(ConstSFVec3f vec)
Add a new element at the end of the list.

Parameters:
vec - Element to add.

addValue

public void addValue(SFVec3f vec)
Add a new element at the end of the list.

Parameters:
vec - Element to add.

insertValue

public void insertValue(int index,
                        float x,
                        float y,
                        float z)
Insert a new element at the specified position.

Parameters:
index - Position to insert new element at.
x - X-component of value to insert.
y - Y-component of value to insert.
z - Z-component of value to insert.

insertValue

public void insertValue(int index,
                        ConstSFVec3f vec)
Insert a new element at the specified position.

Parameters:
index - Position to insert new element at.
vec - Value to insert.

insertValue

public void insertValue(int index,
                        SFVec3f vec)
Insert a new element at the specified position.

Parameters:
index - Position to insert new element at.
vec - Value to insert.