Revision 28990 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/primitive/Curve.java
Curve.java | ||
---|---|---|
1 |
package org.gvsig.fmap.geom.primitive; |
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
7 | 2 |
* |
8 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
9 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
10 | 6 |
* This program is free software; you can redistribute it and/or |
11 | 7 |
* modify it under the terms of the GNU General Public License |
12 | 8 |
* as published by the Free Software Foundation; either version 2 |
13 | 9 |
* of the License, or (at your option) any later version. |
14 |
* |
|
10 |
*
|
|
15 | 11 |
* This program is distributed in the hope that it will be useful, |
16 | 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 | 14 |
* GNU General Public License for more details. |
19 |
* |
|
15 |
*
|
|
20 | 16 |
* You should have received a copy of the GNU General Public License |
21 | 17 |
* along with this program; if not, write to the Free Software |
22 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
23 |
* |
|
24 |
* For more information, contact: |
|
25 |
* |
|
26 |
* Generalitat Valenciana |
|
27 |
* Conselleria d'Infraestructures i Transport |
|
28 |
* Av. Blasco Ib??ez, 50 |
|
29 |
* 46010 VALENCIA |
|
30 |
* SPAIN |
|
31 |
* |
|
32 |
* +34 963862235 |
|
33 |
* gvsig@gva.es |
|
34 |
* www.gvsig.gva.es |
|
35 |
* |
|
36 |
* or |
|
37 |
* |
|
38 |
* IVER T.I. S.A |
|
39 |
* Salamanca 50 |
|
40 |
* 46005 Valencia |
|
41 |
* Spain |
|
42 |
* |
|
43 |
* +34 963163400 |
|
44 |
* dac@iver.es |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
45 | 21 |
*/ |
46 |
/* CVS MESSAGES: |
|
47 |
* |
|
48 |
* $Id: Curve.java,v 1.1 2008/03/12 08:46:20 cvs Exp $ |
|
49 |
* $Log: Curve.java,v $ |
|
50 |
* Revision 1.1 2008/03/12 08:46:20 cvs |
|
51 |
* *** empty log message *** |
|
52 |
* |
|
53 |
* |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2009 {Iver T.I.} {Task} |
|
54 | 26 |
*/ |
27 |
|
|
28 |
package org.gvsig.fmap.geom.primitive; |
|
29 |
|
|
55 | 30 |
/** |
56 |
* @author Jorge Piera Llodr? (jorge.piera@iver.es) |
|
31 |
* <p> |
|
32 |
* This interface is equivalent to the GM_Curve and the GM_CurveSegment specified in |
|
33 |
* <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a>. |
|
34 |
* Curve is a descendent subtype of {@link Primitive} through {@link OrientablePrimitive}. |
|
35 |
* It is the basis for 1-dimensional geometry. |
|
36 |
* </p> |
|
37 |
* <p> |
|
38 |
* A curve is a continuous image of an open interval |
|
39 |
* and so could be written as a parameterized function such as c(t):(a, b) -> E^n where "t" is a real |
|
40 |
* parameter and E^n is Euclidean space of dimension n (usually 2 or 3, as determined by |
|
41 |
* the coordinate reference system). Any other parameterization that results in the same image curve, |
|
42 |
* traced in the same direction, such as any linear shifts and positive scales such as |
|
43 |
* e(t) = c(a + t(b-a)):(0,1) -> E^n, is an equivalent representation of the same curve. |
|
44 |
* </p> |
|
45 |
* <p> |
|
46 |
* Curves are continuous, connected, and have a measurable length in terms of |
|
47 |
* the coordinate system. The orientation of the curve is determined by this |
|
48 |
* parameterization, and is consistent with the tangent function, which |
|
49 |
* approximates the derivative function of the parameterization and shall |
|
50 |
* always point in the "forward" direction. The parameterization of the reversal of |
|
51 |
* the curve defined by c(t):(a, b) -> E^n would be defined by a function of the |
|
52 |
* form s(t) = c(a + b - t):(a, b) - >E^n. |
|
53 |
* </p> |
|
54 |
* <p> |
|
55 |
* In the ISO model a curve is composed of one or more curve segments. |
|
56 |
* In gvSIG a curve is not composed by curve segments: a curve is |
|
57 |
* one and only one curve segment. |
|
58 |
* </p> |
|
59 |
* @see <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a> |
|
60 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a> |
|
57 | 61 |
*/ |
58 | 62 |
public interface Curve extends OrientableCurve{ |
59 | 63 |
|
64 |
/** |
|
65 |
* Sets all the coordinates of the curve |
|
66 |
* @param generalPathX |
|
67 |
* The generalPath that contains all the coordinates |
|
68 |
*/ |
|
60 | 69 |
public void setGeneralPath(GeneralPathX generalPathX); |
61 | 70 |
|
62 |
public void setPoints(Point startPoint, Point endPoint); |
|
71 |
/** |
|
72 |
* Sets the initial point and the end point of the curve. On this case, |
|
73 |
* the curve is a single line |
|
74 |
* @param initialPoint |
|
75 |
* The initial point |
|
76 |
* @param endPoint |
|
77 |
* The end point |
|
78 |
*/ |
|
79 |
public void setPoints(Point initialPoint, Point endPoint); |
|
63 | 80 |
|
81 |
/** |
|
82 |
* Gets the one of the values of a coordinate (direct position) |
|
83 |
* in a concrete dimension |
|
84 |
* @param index |
|
85 |
* The index of the direct position to set |
|
86 |
* @param dimension |
|
87 |
* The dimension of the direct position |
|
88 |
* @return |
|
89 |
* The value of the coordinate |
|
90 |
*/ |
|
64 | 91 |
public double getCoordinateAt(int index, int dimension); |
65 | 92 |
|
93 |
/** |
|
94 |
* Sets the value of a coordinate (direct position) in a concrete dimension |
|
95 |
* @param index |
|
96 |
* The index of the direct position to set |
|
97 |
* @param dimension |
|
98 |
* The dimension of the direct position |
|
99 |
* @param value |
|
100 |
* The value to set |
|
101 |
*/ |
|
66 | 102 |
public void setCoordinateAt(int index, int dimension, double value); |
67 | 103 |
|
104 |
/** |
|
105 |
* Adds a vertex (or direct position) to the curve |
|
106 |
* @param point |
|
107 |
* The new point to add |
|
108 |
*/ |
|
68 | 109 |
public void addVertex(Point point); |
69 | 110 |
|
111 |
/** |
|
112 |
* Remove a vertex (direct position) to the curve |
|
113 |
* @param index |
|
114 |
* The index of the vertex to remove |
|
115 |
*/ |
|
70 | 116 |
public void removeVertex(int index); |
71 | 117 |
|
118 |
/** |
|
119 |
* Gets a vertex (direct position) |
|
120 |
* @param index |
|
121 |
* The index of the vertex to get |
|
122 |
* @return |
|
123 |
* One point |
|
124 |
*/ |
|
72 | 125 |
public Point getVertex(int index); |
73 | 126 |
|
127 |
/** |
|
128 |
* Gets the number of vertices (direct positions) of the curve |
|
129 |
* @return |
|
130 |
* The number of vertices |
|
131 |
*/ |
|
74 | 132 |
public int getNumVertices(); |
75 | 133 |
|
134 |
/** |
|
135 |
* Inserts a vertex (direct position) to the curve |
|
136 |
* @param index |
|
137 |
* The index of the vertex where the new point has to be added |
|
138 |
* @param p |
|
139 |
* The vertex to add |
|
140 |
*/ |
|
76 | 141 |
public void insertVertex(int index, Point p); |
77 | 142 |
} |
Also available in: Unified diff