1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 package org.ximtec.igesture.util.additions3d;
27
28 public class Point3D implements Cloneable{
29
30 private long timeStamp = 0;
31 private double x;
32 private double y;
33 private double z;
34
35
36
37
38
39 public Point3D() {
40 super();
41 }
42
43
44
45
46
47
48
49
50
51 public Point3D(double x, double y, double z, long timeStamp) {
52 this.setX(x);
53 this.setY(y);
54 this.setZ(z);
55 this.timeStamp = timeStamp;
56 }
57
58
59
60
61
62
63 public long getTimeStamp() {
64 return timeStamp;
65 }
66
67
68
69
70
71
72
73
74 public void set(double x, double y, double z) {
75 this.setX(x);
76 this.setY(y);
77 this.setZ(z);
78 }
79
80
81
82
83
84
85 public void setTimeStamp(long timeStamp) {
86 this.timeStamp = timeStamp;
87 }
88
89
90
91
92
93
94 public boolean hasTimeStamp() {
95 return (timeStamp != 0);
96 }
97
98 public double getX() {
99 return x;
100 }
101
102 public void setX(double x) {
103 this.x = x;
104 }
105
106 public double getY() {
107 return y;
108 }
109
110 public void setY(double y) {
111 this.y = y;
112 }
113
114 public double getZ() {
115 return z;
116 }
117
118 public void setZ(double z) {
119 this.z = z;
120 }
121
122
123
124
125
126 @Override
127 public Object clone() {
128 try {
129 return super.clone();
130 } catch (CloneNotSupportedException e) {
131 throw new InternalError();
132 }
133 }
134 }