FreeWRL / FreeX3D 4.3.0
ConstSFVec2f.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 ConstSFVec2f extends ConstField {
11 float x;
12 float y;
13
14 public ConstSFVec2f() { }
15
16 public ConstSFVec2f(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 String toString() {
38 __updateRead();
39 return ""+x+" "+y;
40 }
41
42 public void __fromPerl(BufferedReader in) throws IOException {
43
44 //System.out.println ("fromPerl, Vec2f");
45 x = Float.parseFloat(in.readLine());
46 y = Float.parseFloat(in.readLine());
47 }
48
49 public void __toPerl(PrintWriter out) throws IOException {
50 out.print(x + " " + y);
51 //out.println();
52 }
53 //public void setOffset(String offs) { this.offset = offs; } //JAS2
54 //public String getOffset() { return this.offset; } //JAS2
55}