-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlane.java
More file actions
114 lines (88 loc) · 2.16 KB
/
Plane.java
File metadata and controls
114 lines (88 loc) · 2.16 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package prg.es6;
public class Plane{
private Point3D p1;
private Point3D p2;
private Point3D p3;
//COSTRUTTORI:
public Plane(){}
public Plane(Point3D p1, Point3D p2, Point3D p3){
this.setAllPoints(p1, p2, p3);
}
public Plane(int x1, int y1, int z1, int x2, int y2, int z2, int x3, int y3, int z3){
this.setPositionAllPoints(x1, y1, z1, x2, y2, z2, x3, y3, z3);
}
//METODI:
public Plane setP1(Point3D p1){
this.p1.setXYZ(p1.getX(), p1.getY(), p1.getZ());
return this;
}
public Plane setP2(Point3D p2){
this.p2.setXYZ(p2.getX(), p2.getY(), p2.getZ());
return this;
}
public Plane setP3(Point3D p3){
this.p3.setXYZ(p3.getX(), p3.getY(), p3.getZ());
return this;
}
public Plane setAllPoints(Point3D p1, Point3D p2, Point3D p3){
return this.setP1(p1).setP2(p2).setP3(p3);
}
public Plane setPositionP1(int x, int y, int z){
this.p1.setXYZ(x, y, z);
return this;
}
public Plane setPositionP2(int x, int y, int z){
this.p2.setXYZ(x, y, z);
return this;
}
public Plane setPositionP3(int x, int y, int z){
this.p3.setXYZ(x, y, z);
return this;
}
public Plane setPositionAllPoints(int x1, int y1, int z1, int x2, int y2, int z2, int x3, int y3, int z3){
return this.setPositionP1(x1, y1, z1).setPositionP2(x2, y2, z2).setPositionP3(x3, y3, z3);
}
public Point3D getP1(){
return this.p1;
}
public Point3D getP2(){
return this.p2;
}
public Point3D getP3(){
return this.p3;
}
public int getXP1(){
return this.p1.getX();
}
public int getYP1(){
return this.p1.getY();
}
public int getZP1(){
return this.p1.getZ();
}
public int getXP2(){
return this.p2.getX();
}
public int getYP2(){
return this.p2.getY();
}
public int getZP2(){
return this.p2.getZ();
}
public int getXP3(){
return this.p3.getX();
}
public int getYP3(){
return this.p3.getY();
}
public int getZP3(){
return this.p3.getZ();
}
public String toString(){
return "Plane: " + p1.toString() + " " + p2.toString()+ " " + p3.toString();
}
public Plane toPrint(){
System.out.println(this.toString());
return this;
}
}