FreeWRL/FreeX3D  3.0.0
SFVec3f.java
1 //AUTOMATICALLY GENERATED BY genfields.pl.
2 //DO NOT EDIT!!!!
3 
4 package vrml.field;
5 import vrml.*;
6 import java.io.BufferedReader;
7 import java.io.PrintWriter;
8 import java.io.IOException;
9 
10 public class SFVec3f extends Field {
11  float x;
12  float y;
13  float z;
14 
15  public SFVec3f() { }
16 
17  public SFVec3f(float x, float y, float z) {
18  this.x = x;
19  this.y = y;
20  this.z = z;
21  }
22 
23  public void getValue(float[] values) {
24  __updateRead();
25  values[0] = x;
26  values[1] = y;
27  values[2] = z;
28  }
29 
30  public float getX() {
31  __updateRead();
32  return x;
33  }
34 
35  public float getY() {
36  __updateRead();
37  return y;
38  }
39 
40  public float getZ() {
41  __updateRead();
42  return z;
43  }
44 
45  public void setValue(float x, float y, float z) {
46  this.x = x;
47  this.y = y;
48  this.z = z;
49  __updateWrite();
50  }
51 
52 
53  public void setValue(float[] values) {
54  this.x = values[0];
55  this.y = values[1];
56  this.z = values[2];
57  __updateWrite();
58  }
59 
60  public void setValue(ConstSFVec3f sfVec3f) {
61  sfVec3f.__updateRead();
62  x = sfVec3f.x;
63  y = sfVec3f.y;
64  z = sfVec3f.z;
65  __updateWrite();
66  }
67 
68  public void setValue(SFVec3f sfVec3f) {
69  sfVec3f.__updateRead();
70  x = sfVec3f.x;
71  y = sfVec3f.y;
72  z = sfVec3f.z;
73  __updateWrite();
74  }
75 
76 
77  public String toString() {
78  __updateRead();
79  return ""+x+" "+y+" "+z;
80  }
81 
82  public void __fromPerl(BufferedReader in) throws IOException {
83 
84  //System.out.println ("fromPerl, Vec3f");
85  x = Float.parseFloat(in.readLine());
86  y = Float.parseFloat(in.readLine());
87  z = Float.parseFloat(in.readLine());
88  }
89 
90  public void __toPerl(PrintWriter out) throws IOException {
91  out.print(x + " " + y + " " + z);
92  //out.println();
93  }
94  //public void setOffset(String offs) { this.offset = offs; } //JAS2
95  //public String getOffset() { return this.offset; } //JAS2
96 }