//AUTOMATICALLY GENERATED BY genfields.pl.
//DO NOT EDIT!!!!

package vrml.field;
import vrml.*;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.IOException;

public class SFVec3f extends Field {
     float x;
     float y;
     float z;

    public SFVec3f() { }

    public SFVec3f(float x, float y, float z) {
	        this.x = x;
        this.y = y;
        this.z = z;
    }

    public void getValue(float[] values) {
        __updateRead();
        values[0] = x;
        values[1] = y;
        values[2] = z;
    }

    public float getX() {
        __updateRead();
        return x;
    }

    public float getY() {
        __updateRead();
        return y;
    }

    public float getZ() {
        __updateRead();
        return z;
    }

    public void setValue(float x, float y, float z) {
        this.x = x;
        this.y = y;
        this.z = z;
        __updateWrite();
    }


    public void setValue(float[] values) {
        this.x = values[0];
        this.y = values[1];
        this.z = values[2];
        __updateWrite();
    }

    public void setValue(ConstSFVec3f sfVec3f) {
        sfVec3f.__updateRead();
        x = sfVec3f.x;
        y = sfVec3f.y;
        z = sfVec3f.z;
        __updateWrite();
    }

    public void setValue(SFVec3f sfVec3f) {
        sfVec3f.__updateRead();
        x = sfVec3f.x;
        y = sfVec3f.y;
        z = sfVec3f.z;
        __updateWrite();
    }


    public String toString() {
        __updateRead();
        return ""+x+" "+y+" "+z;
    }

    public void __fromPerl(BufferedReader in)  throws IOException {

	//System.out.println ("fromPerl, Vec3f");
		x = Float.parseFloat(in.readLine());
	        y = Float.parseFloat(in.readLine());
        	z = Float.parseFloat(in.readLine());
    }

    public void __toPerl(PrintWriter out)  throws IOException {
        out.print(x + " " + y + " " + z);
	//out.println();
    }
    //public void setOffset(String offs) { this.offset = offs; } //JAS2
    //public String getOffset() { return this.offset; } //JAS2
}