root / branches / v2_0_0_prep / libraries / libFMap_geometries / src / org / gvsig / fmap / geom / primitive / Curve.java @ 29805
History | View | Annotate | Download (4.98 KB)
1 |
/* 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_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>
|
61 |
*/
|
62 |
public interface Curve extends OrientableCurve{ |
63 |
|
64 |
/**
|
65 |
* Sets all the coordinates of the curve
|
66 |
* @param generalPathX
|
67 |
* The generalPath that contains all the coordinates
|
68 |
*/
|
69 |
public void setGeneralPath(GeneralPathX generalPathX); |
70 |
|
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); |
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 |
*/
|
91 |
public double getCoordinateAt(int index, int dimension); |
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 |
*/
|
102 |
public void setCoordinateAt(int index, int dimension, double value); |
103 |
|
104 |
/**
|
105 |
* Adds a vertex (or direct position) to the curve
|
106 |
* @param point
|
107 |
* The new point to add
|
108 |
*/
|
109 |
public void addVertex(Point point); |
110 |
|
111 |
/**
|
112 |
* Remove a vertex (direct position) to the curve
|
113 |
* @param index
|
114 |
* The index of the vertex to remove
|
115 |
*/
|
116 |
public void removeVertex(int index); |
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 |
*/
|
125 |
public Point getVertex(int index); |
126 |
|
127 |
/**
|
128 |
* Gets the number of vertices (direct positions) of the curve
|
129 |
* @return
|
130 |
* The number of vertices
|
131 |
*/
|
132 |
public int getNumVertices(); |
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 |
*/
|
141 |
public void insertVertex(int index, Point p); |
142 |
|
143 |
/**
|
144 |
* Sets a vertex in a concrete position and replaces the
|
145 |
* previous one that was in this position.
|
146 |
* @param index
|
147 |
* The index of the vertex where the new point has to be replaced.
|
148 |
* @param p
|
149 |
* The vertex to set.
|
150 |
*/
|
151 |
public void setVertex(int index, Point p); |
152 |
} |