-
Notifications
You must be signed in to change notification settings - Fork 0
/
Edge.java
executable file
·94 lines (57 loc) · 1.41 KB
/
Edge.java
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
//import com.jogamp.opengl.GL2;
import java.awt.geom.Line2D;
/**
*
* @author Habib Daneshpajouh
* @email habib.dpajouh@gmail.com
*
**/
public class Edge extends Line2D.Double implements Cloneable {
private int v1Index;
private int v2Index;
public Edge() {
super();
}
public Edge(Edge other) {
super();
x1 = other.x1;
x2 = other.x2;
y1 = other.y1;
y2 = other.y2;
v1Index = other.v1Index;
v2Index = other.v2Index;
}
public Edge(Vertex v1, Vertex v2) {
super();
setLine(v1, v2);
}
public Edge(int v1, int v2) {
super();
v1Index = v1;
v2Index = v2;
}
@Override
public Object clone() {
return new Edge(this);
}
public void setV1Index(int v) {
v1Index = v;
}
public int getV1Index() {
return v1Index;
}
public void setV2Index(int v) {
v2Index = v;
}
public int getV2Index() {
return v2Index;
}
/*
public void draw(GL2 gl) {
gl.glBegin(GL2.GL_LINES);
gl.glVertex3d(x1, y1, 0.01);
gl.glVertex3d(x2, y2, 0.01);
gl.glEnd();
}
*/
}