Package vrml.field
Class ConstMFColor
java.lang.Object
vrml.Field
vrml.ConstField
vrml.ConstMField
vrml.field.ConstMFColor
- All Implemented Interfaces:
Cloneable
Constant VRML JSAI type class containing multiple color 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.7 $
- Author:
- Alan Hudson, Justin Couch
-
Field Summary
FieldsFields inherited from class vrml.ConstMField
numElements
Fields inherited from class vrml.Field
valueChanged
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Construct an instance with default values.ConstMFColor
(float[] colors) Construct a new field based on all the given data valuesConstMFColor
(float[][] colors) Construct a new field based on all the given 2D array of values.ConstMFColor
(int size, float[] colors) Construct a new field based on subsection the given data values -
Method Summary
Modifier and TypeMethodDescriptionclone()
Make a clone of this object.void
get1Value
(int index, float[] color) Get the color value at the given position and copy it into the user provided array.void
Get the color value at the given position and copy it into the user provided field.void
getValue
(float[] colors) Copy the color values used in this field into the user provided array.void
getValue
(float[][] colors) Get the color values used in this field and copy them into the user provided array.toString()
Create a string representation of the field values.Methods inherited from class vrml.ConstMField
getSize
-
Field Details
-
data
protected float[] dataThe data of the underlying field
-
-
Constructor Details
-
ConstMFColor
protected ConstMFColor()Construct an instance with default values. Not available to mere mortals. -
ConstMFColor
public ConstMFColor(float[][] colors) Construct a new field based on all the given 2D array of values.- Parameters:
colors
- The color values to use
-
ConstMFColor
public ConstMFColor(float[] colors) Construct a new field based on all the given data values- Parameters:
colors
- The color values to use
-
ConstMFColor
public ConstMFColor(int size, float[] colors) Construct a new field based on subsection the given data values- Parameters:
size
- The number of items to use. numElements = size / 3colors
- The color values to use
-
-
Method Details
-
getValue
public void getValue(float[][] colors) Get the color values used in this field and copy them into the user provided array.- Parameters:
colors
- The array to copy values to
-
getValue
public void getValue(float[] colors) Copy the color values used in this field into the user provided array.- Parameters:
colors
- The array to copy values to
-
get1Value
public void get1Value(int index, float[] color) Get the color value at the given position and copy it into the user provided array.- Parameters:
index
- The position of the color to copycolor
- The array to copy data to
-
get1Value
Get the color value at the given position and copy it into the user provided field.- Parameters:
index
- The position of the color to copycolor
- The field to copy data to
-
toString
-
clone
-