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 package math.geom2d.spline;
28
29 import java.util.Collection;
30
31 import math.geom2d.AffineTransform2D;
32 import math.geom2d.Box2D;
33 import math.geom2d.curve.Curve2D;
34 import math.geom2d.curve.Curve2DUtils;
35 import math.geom2d.curve.CurveSet2D;
36 import math.geom2d.curve.PolyCurve2D;
37
38
39
40
41
42
43
44 @Deprecated
45 public class PolyBezierCurve2D extends PolyCurve2D<CubicBezierCurve2D> {
46
47 @Deprecated
48 public PolyBezierCurve2D() {
49 super();
50 }
51
52 @Deprecated
53 public PolyBezierCurve2D(CubicBezierCurve2D[] curves) {
54 super(curves);
55 }
56
57 @Deprecated
58 public PolyBezierCurve2D(Collection<CubicBezierCurve2D> curves) {
59 super(curves);
60 }
61
62
63
64
65 @Override
66 public PolyBezierCurve2D clip(Box2D box) {
67
68 CurveSet2D<? extends Curve2D> set = Curve2DUtils.clipCurve(this, box);
69
70
71 PolyBezierCurve2D result = new PolyBezierCurve2D();
72
73
74 for (Curve2D curve : set.getCurves()) {
75 if (curve instanceof CubicBezierCurve2D)
76 result.addCurve((CubicBezierCurve2D) curve);
77 }
78 return result;
79 }
80
81 @Override
82 public PolyBezierCurve2D transform(AffineTransform2D trans) {
83 PolyBezierCurve2D result = new PolyBezierCurve2D();
84 for (CubicBezierCurve2D curve : curves)
85 result.addCurve(curve.transform(trans));
86 return result;
87 }
88
89 }