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 @ 42309
History | View | Annotate | Download (4.48 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
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 3
|
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 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
|
25 |
package org.gvsig.fmap.geom.primitive; |
26 |
|
27 |
/**
|
28 |
* <p>
|
29 |
* This interface is equivalent to the GM_Arc specified in
|
30 |
* <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a>.
|
31 |
* A Arc is defined by 3 points, and consists of the arc of the circle determined by the 3 points,
|
32 |
* starting at the first, passing through the second and terminating at the third.
|
33 |
* If the 3 points are co-linear, then the arc shall be a 3-point line string, and will
|
34 |
* not be able to return values for center, radius, start angle and end angle.
|
35 |
* </p>
|
36 |
* @see <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a>
|
37 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
|
38 |
*/
|
39 |
public interface Arc extends Curve { |
40 |
|
41 |
/**
|
42 |
* Sets the three points to define an arc.
|
43 |
* These are three ordered points that belong to the arc
|
44 |
* (none of them is the center of the ellipse/circle). Therefore
|
45 |
* they must not be aligned.
|
46 |
*
|
47 |
* @param startPoint
|
48 |
* The start point of an arc.
|
49 |
* @param midPoint
|
50 |
* The middle point of an arc.
|
51 |
* @param endPoint
|
52 |
* The end point of an arc.
|
53 |
* @exception IllegalArgumentException if the three points are aligned or
|
54 |
* there is a repeated point.
|
55 |
*
|
56 |
*/
|
57 |
void setPoints(Point startPoint, Point midPoint, Point endPoint); |
58 |
|
59 |
/**
|
60 |
* Sets the values to define an arc.
|
61 |
* @param center The center of the arc.
|
62 |
* @param radius The radius.
|
63 |
* @param startAngle The start angle of the arc (in radians)
|
64 |
* @param angleExt The angular extent of the arc (in radians).
|
65 |
*
|
66 |
* The sign convention is:
|
67 |
*
|
68 |
* startAngle = 0 is "3 o'clock";
|
69 |
* startAngle = (PI / 3) is "1 o'clock";
|
70 |
* angleExt > 0 means "advancing clockwise";
|
71 |
* angleExt < 0 means "advancing counterclockwise".
|
72 |
*/
|
73 |
void setPoints (Point center, double radius, double startAngle, double angleExt); |
74 |
|
75 |
/**
|
76 |
* Sets the values to define an arc.
|
77 |
* @param center The center of the arc.
|
78 |
* @param radius The radius.
|
79 |
* @param startAngle The start angle of the arc (in radians)
|
80 |
* @param angleExt The angular extent of the arc (in radians).
|
81 |
*
|
82 |
* The sign convention is:
|
83 |
*
|
84 |
* startAngle = 0 is "3 o'clock";
|
85 |
* startAngle = (PI / 3) is "1 o'clock";
|
86 |
* angleExt > 0 means "advancing clockwise";
|
87 |
* angleExt < 0 means "advancing counterclockwise".
|
88 |
*/
|
89 |
void setPointsStartExt (Point center, double radius, double startAngle, double angleExt); |
90 |
|
91 |
/**
|
92 |
* Sets the values to define an arc. The arc will go from
|
93 |
* startAngle to endAngle clockwise. Angles will be
|
94 |
* normalized to ]-PI, PI] (-PI excluded) before creating
|
95 |
* the arc.
|
96 |
*
|
97 |
* @param center The center of the arc.
|
98 |
* @param radius The radius.
|
99 |
* @param startAngle The start angle of the arc (in radians)
|
100 |
* @param endAngle The end angle of the arc (in radians).
|
101 |
*
|
102 |
*/
|
103 |
void setPointsStartEnd (Point center, double radius, double startAngle, double endAngle ); |
104 |
|
105 |
/**
|
106 |
* Return the first point that has been used to create the arc.
|
107 |
* @return
|
108 |
* The first point of the arc.
|
109 |
*/
|
110 |
Point getInitPoint();
|
111 |
|
112 |
/**
|
113 |
* Return the end point that has been used to create the arc.
|
114 |
* @return
|
115 |
* The end point of the arc.
|
116 |
*/
|
117 |
Point getEndPoint();
|
118 |
|
119 |
/**
|
120 |
* Return the center of the arc, that is, the center of the ellipse/circle
|
121 |
* in which the arc is based.
|
122 |
*
|
123 |
* @return The center of the arc.
|
124 |
*/
|
125 |
Point getCenterPoint();
|
126 |
|
127 |
/**
|
128 |
* Return the middle point of the arc.
|
129 |
*
|
130 |
* @return The middle point of the arc.
|
131 |
*/
|
132 |
Point getMiddlePoint();
|
133 |
|
134 |
|
135 |
} |