Xj3D 2.0 VRML/X3D Code API

org.web3d.x3d.sai
Interface SFColorRGBA

All Superinterfaces:
X3DField

public interface SFColorRGBA
extends X3DField

Representation of a SFColorRGBA field.

Colour values are represented as floating point numbers between [0 - 1] as per the VRML IS specification Section 4.4.5 Standard units and coordinate system.

Version:
$Revision: 1.3 $

Method Summary
 void getValue(float[] col)
          Write the value of the colour to the given array.
 void setValue(float[] value)
          Set the colour value in the given eventIn.
 
Methods inherited from interface org.web3d.x3d.sai.X3DField
addX3DEventListener, getDefinition, getUserData, isReadable, isWritable, removeX3DEventListener, setUserData
 

Method Detail

getValue

void getValue(float[] col)
Write the value of the colour to the given array.

Parameters:
col - The array of colour values to be filled in where
value[0] = Red component [0-1]
value[1] = Green component [0-1]
value[2] = Blue component [0-1]
value[3] = Alpha component [0-1]
Throws:
java.lang.ArrayIndexOutOfBoundsException - The provided array was too small

setValue

void setValue(float[] value)
Set the colour value in the given eventIn. Colour values are required to be in the range [0-1].

The value array must contain at least three elements. If the array contains more than 4 values only the first three values will be used and the rest ignored.

If the array of values does not contain at least 3 elements an ArrayIndexOutOfBoundsException will be generated. If the colour values are out of range an IllegalArgumentException will be generated.

Parameters:
value - The array of colour values where
value[0] = Red component [0-1]
value[1] = Green component [0-1]
value[2] = Blue component [0-1]
value[3] = Alpha component [0-1]
Throws:
java.lang.IllegalArgumentException - A colour value(s) was out of range
java.lang.ArrayIndexOutOfBoundsException - A value did not contain at least three values for the colour component

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium