Xj3D VRML/X3D Code API

vrml.field
Class ConstMFVec2f

java.lang.Object
  extended byvrml.Field
      extended byvrml.ConstField
          extended byvrml.ConstMField
              extended byvrml.field.ConstMFVec2f
All Implemented Interfaces:
java.lang.Cloneable

public class ConstMFVec2f
extends ConstMField

Constant VRML JSAI type class containing multiple 2 component vector fields.

Internally the class keeps data as a flat array, so that is the most efficient way of interacting with this class.

Version:
$Revision: 1.5 $
Author:
Alan Hudson, Justin Couch

Field Summary
protected  float[] data
          The data of the underlying field
 
Fields inherited from class vrml.ConstMField
numElements
 
Fields inherited from class vrml.Field
valueChanged
 
Constructor Summary
protected ConstMFVec2f()
          Construct an instance with default values.
  ConstMFVec2f(float[] vecs)
          Construct a new field based on all the given data values
  ConstMFVec2f(float[][] vecs)
          Construct a new field based on all the given 2D array of values.
  ConstMFVec2f(int size, float[] vecs)
          Construct a new field based on subsection the given data values
 
Method Summary
 java.lang.Object clone()
          Make a clone of this object.
 void get1Value(int index, float[] vec)
          Get the vec value at the given position and copy it into the user provided array.
 void get1Value(int index, SFVec2f vec)
          Get the vec value at the given position and copy it into the user provided field.
 void getValue(float[] vecs)
          Copy the vec values used in this field into the user provided array.
 void getValue(float[][] vecs)
          Get the vec values used in this field and copy them into the user provided array.
 java.lang.String toString()
          Create a string representation of the field values.
 
Methods inherited from class vrml.ConstMField
getSize
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

protected float[] data
The data of the underlying field

Constructor Detail

ConstMFVec2f

protected ConstMFVec2f()
Construct an instance with default values. Not available to mere mortals.


ConstMFVec2f

public ConstMFVec2f(float[][] vecs)
Construct a new field based on all the given 2D array of values.

Parameters:
vecs - The vec values to use

ConstMFVec2f

public ConstMFVec2f(float[] vecs)
Construct a new field based on all the given data values

Parameters:
vecs - The vec values to use

ConstMFVec2f

public ConstMFVec2f(int size,
                    float[] vecs)
Construct a new field based on subsection the given data values

Parameters:
size - The number of items to use. numElements = size / 2
vecs - The vec values to use
Method Detail

getValue

public void getValue(float[][] vecs)
Get the vec values used in this field and copy them into the user provided array.

Parameters:
vecs - The array to copy values to

getValue

public void getValue(float[] vecs)
Copy the vec values used in this field into the user provided array.

Parameters:
vecs - The array to copy values to

get1Value

public void get1Value(int index,
                      float[] vec)
Get the vec value at the given position and copy it into the user provided array.

Parameters:
index - The position of the vec to copy
vec - The array to copy data to

get1Value

public void get1Value(int index,
                      SFVec2f vec)
Get the vec value at the given position and copy it into the user provided field.

Parameters:
index - The position of the vec to copy
vec - The field to copy data to

toString

public java.lang.String toString()
Create a string representation of the field values.

Returns:
A string representing the values.

clone

public java.lang.Object clone()
Make a clone of this object.

Specified by:
clone in class Field
Returns:
A copy of the field and its data

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium