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