vrml.field
Class MFVec2d

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

public class MFVec2d
extends MField

Represents a VRML MFVec2d field in Java.


Constructor Summary
MFVec2d()
          Default constructor.
MFVec2d(double[] vec2s)
          Construct an MFVec2d field.
MFVec2d(double[][] vec2s)
          Construct an MFVec2d field.
MFVec2d(int size, double[] vec2s)
          Construct an MFVec2d field.
 
Method Summary
 void addValue(ConstSFVec2d vec)
          Add a new element at the end of the list.
 void addValue(double x, double y)
          Add a new element at the end of the list.
 void addValue(SFVec2d 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, double[] vec2s)
          Retrieves a specific element in an MFVec2d and returns it as a double array.
 void get1Value(int index, SFVec2d vec)
          Retrieves a specific element in an MFVec2d and returns it as an SFVec2d.
 int getSize()
          Number of elements contained in the MField.
 void getValue(double[] vec2s)
          Retrieves the value of an MFVec2d field.
 void getValue(double[][] vec2s)
          Retrieves the value of an MFVec2d field.
 void insertValue(int index, ConstSFVec2d vec)
          Insert a new element at the specified position.
 void insertValue(int index, double x, double y)
          Insert a new element at the specified position.
 void insertValue(int index, SFVec2d vec)
          Insert a new element at the specified position.
 void set1Value(int index, ConstSFVec2d vec)
          Set a specified element in the field.
 void set1Value(int index, double x, double y)
          Set a specified element in the field.
 void set1Value(int index, SFVec2d vec)
          Set a specified element in the field.
 void setValue(ConstMFVec2d vecs)
          Set the value of the field.
 void setValue(double[] vec2s)
          Set the value of the field.
 void setValue(double[][] vec2s)
          Set the value of the field.
 void setValue(int size, double[] vec2s)
          Set the value of the field.
 void setValue(MFVec2d 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

MFVec2d

public MFVec2d()
Default constructor.


MFVec2d

public MFVec2d(double[][] vec2s)
Construct an MFVec2d field.

Parameters:
vec2s - An array of sets of x,y values

MFVec2d

public MFVec2d(double[] vec2s)
Construct an MFVec2d field.

Parameters:
vec2s - List of x,y pairs

MFVec2d

public MFVec2d(int size,
               double[] vec2s)
Construct an MFVec2d field.

Parameters:
size - Number of SFVec2d elements passed in.
vec2s - List of x,y pairs
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(double[][] vec2s)
Retrieves the value of an MFVec2d field.

Parameters:
vec2s - 2D array of x,y pairs to be returned.

getValue

public void getValue(double[] vec2s)
Retrieves the value of an MFVec2d field.

Parameters:
vec2s - Array of x,y pairs to be returned.

get1Value

public void get1Value(int index,
                      double[] vec2s)
Retrieves a specific element in an MFVec2d and returns it as a double array.

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

get1Value

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

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

setValue

public void setValue(double[][] vec2s)
Set the value of the field.

Parameters:
vec2s - New value for field.

setValue

public void setValue(double[] vec2s)
Set the value of the field.

Parameters:
vec2s - New value for field.

setValue

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

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

setValue

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

Parameters:
vecs - New value for field.

setValue

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

Parameters:
vecs - New value for field.

set1Value

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

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

set1Value

public void set1Value(int index,
                      ConstSFVec2d 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,
                      SFVec2d vec)
Set a specified element in the field.

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

addValue

public void addValue(double x,
                     double y)
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.

addValue

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

Parameters:
vec - Element to add.

addValue

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

Parameters:
vec - Element to add.

insertValue

public void insertValue(int index,
                        double x,
                        double y)
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.

insertValue

public void insertValue(int index,
                        ConstSFVec2d 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,
                        SFVec2d vec)
Insert a new element at the specified position.

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