|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--WF3DField
This class is used to represent a VRML field of any type. The
Java type that an instance of this class contains depends on the VRML field represented, and follow below conversion table:
| VRML field type | WF3D Java type | The object structure |
| SFBool | boolean | - |
| SFString | String | - |
| SFInt32 | int | - |
| SFNode | WF3DNode | - |
| SFRotation | float[4] | { Nx, Ny, Nz, angle } |
| SFColor | int | 0xRRGGBB |
| SFImage | WF3DImg | - |
| SFFloat | float | - |
| SFTime | double | - |
| SFVec2f | float[2] | { s, t } |
| SFVec3f | float[3] | { x, y, z } |
| MFString | String[...] | { string0, string1 ... } |
| MFInt32 | int[...] | { int0, int1, ... } |
| MFNode | WF3DNode[...] | { node0, node1, ...} |
| MFRotation | float[...] | { Nx0, Ny0, Nz0, angle0, Nx1, Ny1, Nz1, angle1, ... ] |
| MFColor | int[...] | { 0xRRGGBB0, 0xRRGGBB1, ... } |
| MFFloat | float[...] | { float0, float1 ... } |
| MFVec2f | float[...] | { x0, y0, x1, y1, ... } |
| MFVec3f | float[...] | [ x0, y0, z0, x1, y1, z1, ... ] |
| Field Summary | |
WF3DNode |
parent
The node this field belongs to. |
int |
type
The field type. |
| Method Summary | |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
boolean |
getBoolean()
Retrieves the boolean value (if type==Field.SFBool).
|
double |
getDouble()
Retrieves the double value (if type==Field.SFTime).
|
float |
getFloat()
Retrieves the float value (if type==Field.SFFloat).
|
float[] |
getFloatArray()
Retrieves the float array value (if type==Field.SFVec2f, type==Field.SFVec3f,
type==Field.MFFloat, type==Field.MFVec2f or type==Field.MFVec3f).
|
int |
getInt()
Retrieves the int value (if type==Field.SFInt32 or type==Field.SFColor).
|
int[] |
getIntArray()
Retrieves the int array value (if type==Field.MFInt32 or type==Field.MFColor).
|
WF3DNode |
getNode()
Retrieves the WF3DNode value (if type==Field.SFNode or type==Field.MFNode).
|
WF3DNode[] |
getNodeArray()
Retrieves the WF3DNode array (if type==Field.MFNode).
|
java.lang.String |
getString()
Retrieves the String value (if type==Field.SFString or type==Field.MFString).
|
java.lang.String[] |
getStringArray()
Retrieves the String array value (if type==Field.MFString).
|
void |
set()
Signals that this field was set. |
void |
set(boolean booleanValue)
Sets the field value, (if type==Field.SFBool).
|
void |
set(double doubleValue)
Sets the field value (if type==Field.SFTime).
|
void |
set(float floatValue)
Sets the field value (if type==Field.SFFloat).
|
void |
set(int intValue)
Sets the field value, (if type==Field.SFInt32).
|
void |
set(java.lang.Object newValue)
Sets the field value (if type==Field.SFString, type==Field.SFNode, type==Field.SFImage or
type==(any Field.MF value)).
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public int type
public WF3DNode parent
| Method Detail |
public java.lang.Object clone()
clone in class java.lang.Objectpublic void set()
public void set(java.lang.Object newValue)
type==Field.SFString, type==Field.SFNode, type==Field.SFImage or
type==(any Field.MF value)).
The argument type must be compatible with the VRML field type this object represent (see above conversion
table), or else this may cause an error.
newValue - The new value this field will contain.public void set(boolean booleanValue)
type==Field.SFBool).
This function may only be called on objects representing a VRML field of type SFBool.
public void set(int intValue)
type==Field.SFInt32).
This function may only be called on objects representing a VRML field of type SFInt32 or SFColor.
public void set(float floatValue)
type==Field.SFFloat).
This function may only be called on objects representing a VRML field of type SFFloat.
public void set(double doubleValue)
type==Field.SFTime).
This function may only be called on objects representing a VRML field of type SFTime.
public boolean getBoolean()
type==Field.SFBool).
This method will generate an error if the object represent any other than a VRML field of type SFBool.
public int getInt()
type==Field.SFInt32 or type==Field.SFColor).
This method will generate an error if the object represent any other than a VRML field of type SFInt32 or SFColor.
public float getFloat()
type==Field.SFFloat).
This method will generate an error if the object represent any other than a VRML field of type SFFloat.
public double getDouble()
type==Field.SFTime).
This method will generate an error if the object represent any other than a VRML field of type SFTime.
public java.lang.String getString()
type==Field.SFString or type==Field.MFString).
In the case of MFString fields this method returns the first String element in the String array.
This method will generate an error if the object represent any other than a VRML field of type SFString or MFString.
public WF3DNode getNode()
type==Field.SFNode or type==Field.MFNode).
In the case of MFNode this method returns the first WF3DNode element in the WF3DNode array.
This method will generate an error if the object represent any other than a VRML field of type SFNode or MFNode.
public int[] getIntArray()
type==Field.MFInt32 or type==Field.MFColor).
This method will generate an error if the object represent any other than a VRML field of type MFInt32 or MFColor.
public float[] getFloatArray()
type==Field.SFVec2f, type==Field.SFVec3f,
type==Field.MFFloat, type==Field.MFVec2f or type==Field.MFVec3f).
This method will generate an error if the object represent any other than a VRML field of type SFVec2f, SFVec3f, MFFloat, MFVec2f or MFVec3f.
public java.lang.String[] getStringArray()
type==Field.MFString).
This method will generate an error if the object represent any other than a VRML field of type MFString.
public WF3DNode[] getNodeArray()
type==Field.MFNode).
This method will generate an error if the object represent any other than a VRML field of type MFNode.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||