1 /* file : Boundary2D.java
2 *
3 * Project : geometry
4 *
5 * ===========================================
6 *
7 * This library is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 2.1 of the License, or (at
10 * your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE.
15 *
16 * See the GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library. if not, write to :
20 * The Free Software Foundation, Inc., 59 Temple Place, Suite 330,
21 * Boston, MA 02111-1307, USA.
22 *
23 * Created on 25 dec. 2006
24 *
25 */
26
27 package math.geom2d.domain;
28
29 import java.awt.Graphics2D;
30 import java.awt.geom.Point2D;
31 import java.util.ArrayList;
32 import java.util.Collection;
33
34 import math.geom2d.AffineTransform2D;
35 import math.geom2d.Box2D;
36 import math.geom2d.curve.ContinuousCurve2D;
37 import math.geom2d.curve.Curve2D;
38 import math.geom2d.curve.CurveSet2D;
39
40 /**
41 * A Boundary2D is the curve which defines the contour of a domain in the plane.
42 * It is compound of one or several non-intersecting and oriented curves.
43 *
44 * @author dlegland
45 */
46 public interface Boundary2D extends OrientedCurve2D {
47
48 /**
49 * Returns true if the point is 'inside' the domain bounded by the curve.
50 *
51 * @param pt a point in the plane
52 * @return true if the point is on the left side of the curve.
53 */
54 public boolean isInside(java.awt.geom.Point2D pt);
55
56 /**
57 * Returns the different continuous curves composing the boundary
58 */
59 public Collection<? extends ContinuousBoundary2D> getBoundaryCurves();
60
61 /**
62 * Returns the domain delimited by this boundary.
63 *
64 * @return the domain delimited by this boundary
65 */
66 public Domain2D getDomain();
67
68 /**
69 * Forces the subclasses to return an instance of Boundary2D.
70 */
71 public Curve2D getReverseCurve();
72
73 /**
74 * Forces the subclasses to return an instance of Boundary2D.
75 */
76 public Curve2D transform(AffineTransform2D trans);
77
78 public void fill(Graphics2D g2);
79
80 }