-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathPath64.java
More file actions
47 lines (39 loc) · 1.1 KB
/
Path64.java
File metadata and controls
47 lines (39 loc) · 1.1 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
package clipper2.core;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* This structure contains a sequence of Point64 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 Path64 extends ArrayList<Point64> {
public Path64() {
super();
}
public Path64(int n) {
super(n);
}
public Path64(List<Point64> path) {
super(path);
}
public Path64(Point64... path) {
super(Arrays.asList(path));
}
@Override
public String toString() {
StringBuilder s = new StringBuilder();
for (Point64 p : this) {
s.append(p.toString()).append(", ");
}
if (!s.isEmpty()) {
s.setLength(s.length() - 2);
}
return s.toString();
}
}