Statistics
| Revision:

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 @ 40559

History | View | Annotate | Download (4.45 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
 * AUTHORS (In addition to CIT):
26
 * 2009 {Iver T.I.}   {Task}
27
 */
28

    
29
package org.gvsig.fmap.geom.primitive;
30

    
31
/**
32
 * <p>
33
 * This interface is equivalent to the GM_Arc specified in 
34
 * <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a>.
35
 * A Arc is defined by 3 points, and consists of the arc of the circle determined by the 3 points, 
36
 * starting at the first, passing through the second and terminating at the third. 
37
 * If the 3 points are co-linear, then the arc shall be a 3-point line string, and will 
38
 * not be able to return values for center, radius, start angle and end angle. 
39
 * </p> 
40
 * @see <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a>
41
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
42
 */
43
public interface Arc extends Curve {
44
                
45
        /**
46
         * Sets the three points to define an arc.
47
         * These are three ordered points that belong to the arc
48
         * (none of them is the center of the ellipse/circle). Therefore
49
         * they must not be aligned.
50
         * 
51
         * @param startPoint
52
         * The start point of an arc.
53
     * @param midPoint
54
     * The middle point of an arc.
55
         * @param endPoint
56
         * The end point of an arc.
57
         * @exception IllegalArgumentException if the three points are aligned or
58
         * there is a repeated point.
59
         * 
60
         */
61
        void setPoints(Point startPoint, Point midPoint, Point endPoint);
62
        
63
        /**
64
         * Sets the values to define an arc.
65
         * @param center The center of the arc.
66
         * @param radius The radius.
67
         * @param startAngle The start angle of the arc (in radians)
68
         * @param angleExt The angular extent of the arc (in radians). 
69
         * 
70
         * The sign convention is: 
71
         * 
72
         * startAngle = 0 is "3 o'clock"; 
73
         * startAngle = (PI / 3) is "1 o'clock"; 
74
     * angleExt > 0 means "advancing clockwise"; 
75
     * angleExt < 0 means "advancing counterclockwise".
76
         */
77
        void setPoints (Point center, double radius, double startAngle, double angleExt);
78

    
79
    /**
80
     * Sets the values to define an arc.
81
     * @param center The center of the arc.
82
     * @param radius The radius.
83
     * @param startAngle The start angle of the arc (in radians)
84
     * @param angleExt The angular extent of the arc (in radians). 
85
     * 
86
     * The sign convention is: 
87
     * 
88
     * startAngle = 0 is "3 o'clock"; 
89
     * startAngle = (PI / 3) is "1 o'clock"; 
90
     * angleExt > 0 means "advancing clockwise"; 
91
     * angleExt < 0 means "advancing counterclockwise".
92
     */
93
    void setPointsStartExt (Point center, double radius, double startAngle, double angleExt);
94
    
95
    /**
96
     * Sets the values to define an arc. The arc will go from
97
     * startAngle to endAngle clockwise. Angles will be
98
     * normalized to ]-PI, PI] (-PI excluded) before creating
99
     * the arc. 
100
     * 
101
     * @param center The center of the arc.
102
     * @param radius The radius.
103
     * @param startAngle The start angle of the arc (in radians)
104
     * @param endAngle The end angle of the arc (in radians). 
105
     * 
106
     */
107
    void setPointsStartEnd (Point center, double radius, double startAngle, double endAngle );
108
        
109
        /**
110
         * Return the first point that has been used to create the arc.
111
         * @return
112
         * The first point of the arc.
113
         */
114
        Point getInitPoint();
115
                
116
        /**
117
         * Return the end point that has been used to create the arc.
118
         * @return
119
         * The end point of the arc.
120
         */
121
        Point getEndPoint();
122
        
123
        /**
124
         * Return the center of the arc, that is, the center of the ellipse/circle
125
         * in which the arc is based.
126
         * 
127
         * @return The center of the arc.
128
         */
129
        Point getCenterPoint();
130
                
131
                
132
}