svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.geometry / org.gvsig.fmap.geometry.api / src / main / java / org / gvsig / fmap / geom / primitive / Arc.java @ 40435
History | View | Annotate | Download (4.41 KB)
1 | 40435 | jjdelcerro | /* gvSIG. Geographic Information System of the Valencian Government
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2007-2008 Infrastructures and Transports Department
|
||
4 | * of the Valencian Government (CIT)
|
||
5 | *
|
||
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | * as published by the Free Software Foundation; either version 2
|
||
9 | * of the License, or (at your option) any later version.
|
||
10 | *
|
||
11 | * This program is distributed in the hope that it will be useful,
|
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | */
|
||
22 | |||
23 | /*
|
||
24 | * AUTHORS (In addition to CIT):
|
||
25 | * 2009 {Iver T.I.} {Task}
|
||
26 | */
|
||
27 | |||
28 | package org.gvsig.fmap.geom.primitive; |
||
29 | |||
30 | /**
|
||
31 | * <p>
|
||
32 | * This interface is equivalent to the GM_Arc specified in
|
||
33 | * <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a>.
|
||
34 | * A Arc is defined by 3 points, and consists of the arc of the circle determined by the 3 points,
|
||
35 | * starting at the first, passing through the second and terminating at the third.
|
||
36 | * If the 3 points are co-linear, then the arc shall be a 3-point line string, and will
|
||
37 | * not be able to return values for center, radius, start angle and end angle.
|
||
38 | * </p>
|
||
39 | * @see <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a>
|
||
40 | * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
|
||
41 | */
|
||
42 | public interface Arc extends Curve { |
||
43 | |||
44 | /**
|
||
45 | * Sets the three points to define an arc.
|
||
46 | * These are three ordered points that belong to the arc
|
||
47 | * (none of them is the center of the ellipse/circle). Therefore
|
||
48 | * they must not be aligned.
|
||
49 | *
|
||
50 | * @param startPoint
|
||
51 | * The start point of an arc.
|
||
52 | * @param midPoint
|
||
53 | * The middle point of an arc.
|
||
54 | * @param endPoint
|
||
55 | * The end point of an arc.
|
||
56 | * @exception IllegalArgumentException if the three points are aligned or
|
||
57 | * there is a repeated point.
|
||
58 | *
|
||
59 | */
|
||
60 | void setPoints(Point startPoint, Point midPoint, Point endPoint); |
||
61 | |||
62 | /**
|
||
63 | * Sets the values to define an arc.
|
||
64 | * @param center The center of the arc.
|
||
65 | * @param radius The radius.
|
||
66 | * @param startAngle The start angle of the arc (in radians)
|
||
67 | * @param angleExt The angular extent of the arc (in radians).
|
||
68 | *
|
||
69 | * The sign convention is:
|
||
70 | *
|
||
71 | * startAngle = 0 is "3 o'clock";
|
||
72 | * startAngle = (PI / 3) is "1 o'clock";
|
||
73 | * angleExt > 0 means "advancing clockwise";
|
||
74 | * angleExt < 0 means "advancing counterclockwise".
|
||
75 | */
|
||
76 | void setPoints (Point center, double radius, double startAngle, double angleExt); |
||
77 | |||
78 | /**
|
||
79 | * Sets the values to define an arc.
|
||
80 | * @param center The center of the arc.
|
||
81 | * @param radius The radius.
|
||
82 | * @param startAngle The start angle of the arc (in radians)
|
||
83 | * @param angleExt The angular extent of the arc (in radians).
|
||
84 | *
|
||
85 | * The sign convention is:
|
||
86 | *
|
||
87 | * startAngle = 0 is "3 o'clock";
|
||
88 | * startAngle = (PI / 3) is "1 o'clock";
|
||
89 | * angleExt > 0 means "advancing clockwise";
|
||
90 | * angleExt < 0 means "advancing counterclockwise".
|
||
91 | */
|
||
92 | void setPointsStartExt (Point center, double radius, double startAngle, double angleExt); |
||
93 | |||
94 | /**
|
||
95 | * Sets the values to define an arc. The arc will go from
|
||
96 | * startAngle to endAngle clockwise. Angles will be
|
||
97 | * normalized to ]-PI, PI] (-PI excluded) before creating
|
||
98 | * the arc.
|
||
99 | *
|
||
100 | * @param center The center of the arc.
|
||
101 | * @param radius The radius.
|
||
102 | * @param startAngle The start angle of the arc (in radians)
|
||
103 | * @param endAngle The end angle of the arc (in radians).
|
||
104 | *
|
||
105 | */
|
||
106 | void setPointsStartEnd (Point center, double radius, double startAngle, double endAngle ); |
||
107 | |||
108 | /**
|
||
109 | * Return the first point that has been used to create the arc.
|
||
110 | * @return
|
||
111 | * The first point of the arc.
|
||
112 | */
|
||
113 | Point getInitPoint();
|
||
114 | |||
115 | /**
|
||
116 | * Return the end point that has been used to create the arc.
|
||
117 | * @return
|
||
118 | * The end point of the arc.
|
||
119 | */
|
||
120 | Point getEndPoint();
|
||
121 | |||
122 | /**
|
||
123 | * Return the center of the arc, that is, the center of the ellipse/circle
|
||
124 | * in which the arc is based.
|
||
125 | *
|
||
126 | * @return The center of the arc.
|
||
127 | */
|
||
128 | Point getCenterPoint();
|
||
129 | |||
130 | |||
131 | } |