FreeWRL/FreeX3D  3.0.0
SFRotation.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 SFRotation extends Field {
11  float axisX;
12  float axisY;
13  float axisZ;
14  float angle;
15 
16  public SFRotation() { }
17 
18  public SFRotation(float axisX, float axisY, float axisZ, float angle) {
19  this.axisX = axisX;
20  this.axisY = axisY;
21  this.axisZ = axisZ;
22  this.angle = angle;
23  }
24 
25  public void getValue(float[] values) {
26  __updateRead();
27  values[0] = axisX;
28  values[1] = axisY;
29  values[2] = axisZ;
30  values[3] = angle;
31  }
32 
33  public void setValue(float axisX, float axisY, float axisZ, float angle) {
34  this.axisX = axisX;
35  this.axisY = axisY;
36  this.axisZ = axisZ;
37  this.angle = angle;
38  __updateWrite();
39  }
40 
41 
42  public void setValue(float[] values) {
43  this.axisX = values[0];
44  this.axisY = values[1];
45  this.axisZ = values[2];
46  this.angle = values[3];
47  __updateWrite();
48  }
49 
50  public void setValue(ConstSFRotation sfRotation) {
51  sfRotation.__updateRead();
52  axisX = sfRotation.axisX;
53  axisY = sfRotation.axisY;
54  axisZ = sfRotation.axisZ;
55  angle = sfRotation.angle;
56  __updateWrite();
57  }
58 
59  public void setValue(SFRotation sfRotation) {
60  sfRotation.__updateRead();
61  axisX = sfRotation.axisX;
62  axisY = sfRotation.axisY;
63  axisZ = sfRotation.axisZ;
64  angle = sfRotation.angle;
65  __updateWrite();
66  }
67 
68 
69  public String toString() {
70  __updateRead();
71  return ""+axisX+" "+axisY+" "+axisZ+" "+angle;
72  }
73 
74  public void __fromPerl(BufferedReader in) throws IOException {
75 
76  //System.out.println ("fromPerl, Rotation");
77  axisX = Float.parseFloat(in.readLine());
78  axisY = Float.parseFloat(in.readLine());
79  axisZ = Float.parseFloat(in.readLine());
80  angle = Float.parseFloat(in.readLine());
81  }
82 
83  public void __toPerl(PrintWriter out) throws IOException {
84  out.print(axisX+" "+axisY+" "+axisZ+" "+angle);
85  //out.println();
86  }
87  //public void setOffset(String offs) { this.offset = offs; } //JAS2
88  //public String getOffset() { return this.offset; } //JAS2
89 }