-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathPathD.java
More file actions
42 lines (35 loc) · 1022 Bytes
/
PathD.java
File metadata and controls
42 lines (35 loc) · 1022 Bytes
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
package clipper2.core;
import java.util.ArrayList;
import java.util.List;
/**
* This structure contains a sequence of PointD vertices defining a single
* contour (see also terminology). Paths may be open and represent a series of
* line segments defined by 2 or more vertices, or they may be closed and
* represent polygons. Whether or not a path is open depends on its context.
* Closed paths may be 'outer' contours, or they may be 'hole' contours, and
* this usually depends on their orientation (whether arranged roughly
* clockwise, or arranged counter-clockwise).
*/
@SuppressWarnings("serial")
public class PathD extends ArrayList<PointD> {
public PathD() {
super();
}
public PathD(int n) {
super(n);
}
public PathD(List<PointD> path) {
super(path);
}
@Override
public String toString() {
StringBuilder s = new StringBuilder();
for (PointD p : this) {
s.append(p.toString()).append(", ");
}
if (!s.isEmpty()) {
s.setLength(s.length() - 2);
}
return s.toString();
}
}