svn-gvsig-desktop / trunk / libraries / libGeometries / src / org / gvsig / geometries / iso / AbstractGeometry.java @ 20086
History | View | Annotate | Download (6.05 KB)
1 |
package org.gvsig.geometries.iso; |
---|---|
2 |
|
3 |
import java.awt.Shape; |
4 |
import java.awt.geom.AffineTransform; |
5 |
import java.awt.geom.PathIterator; |
6 |
import java.awt.geom.Rectangle2D; |
7 |
import java.io.IOException; |
8 |
|
9 |
import org.cresques.cts.ICoordTrans; |
10 |
import org.cresques.cts.IProjection; |
11 |
import org.gvsig.geometries.iso.primitive.Box; |
12 |
import org.gvsig.geometries.operation.GeometryOperation; |
13 |
import org.gvsig.geometries.operation.GeometryOperationException; |
14 |
|
15 |
import com.iver.cit.gvsig.fmap.core.Handler; |
16 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
17 |
|
18 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
19 |
*
|
20 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
21 |
*
|
22 |
* This program is free software; you can redistribute it and/or
|
23 |
* modify it under the terms of the GNU General Public License
|
24 |
* as published by the Free Software Foundation; either version 2
|
25 |
* of the License, or (at your option) any later version.
|
26 |
*
|
27 |
* This program is distributed in the hope that it will be useful,
|
28 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
29 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
30 |
* GNU General Public License for more details.
|
31 |
*
|
32 |
* You should have received a copy of the GNU General Public License
|
33 |
* along with this program; if not, write to the Free Software
|
34 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
35 |
*
|
36 |
* For more information, contact:
|
37 |
*
|
38 |
* Generalitat Valenciana
|
39 |
* Conselleria d'Infraestructures i Transport
|
40 |
* Av. Blasco Ib??ez, 50
|
41 |
* 46010 VALENCIA
|
42 |
* SPAIN
|
43 |
*
|
44 |
* +34 963862235
|
45 |
* gvsig@gva.es
|
46 |
* www.gvsig.gva.es
|
47 |
*
|
48 |
* or
|
49 |
*
|
50 |
* IVER T.I. S.A
|
51 |
* Salamanca 50
|
52 |
* 46005 Valencia
|
53 |
* Spain
|
54 |
*
|
55 |
* +34 963163400
|
56 |
* dac@iver.es
|
57 |
*/
|
58 |
/* CVS MESSAGES:
|
59 |
*
|
60 |
* $Id: AbstractGeometry.java,v 1.2 2008/03/25 08:47:41 cvs Exp $
|
61 |
* $Log: AbstractGeometry.java,v $
|
62 |
* Revision 1.2 2008/03/25 08:47:41 cvs
|
63 |
* Visitors removed
|
64 |
*
|
65 |
* Revision 1.1 2008/03/12 08:46:21 cvs
|
66 |
* *** empty log message ***
|
67 |
*
|
68 |
*
|
69 |
*/
|
70 |
/**
|
71 |
* This interface must to be implemented by all the geometries.
|
72 |
* It contains methods that has been created because of they are
|
73 |
* on the ISO 19107 and others that has been inherited because of
|
74 |
* the previous gvSIG versions.
|
75 |
* @author Jorge Piera Llodr? (jorge.piera@iver.es)
|
76 |
* @see http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=32554
|
77 |
* @see http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012
|
78 |
*/
|
79 |
public interface AbstractGeometry { |
80 |
|
81 |
/**
|
82 |
* This method returns the geometry identifier just as is
|
83 |
* described on the ISO 10136.
|
84 |
* @return the geometry identifier
|
85 |
*/
|
86 |
public String getId(); |
87 |
|
88 |
/**
|
89 |
* This method returns the geometry coordinates reference
|
90 |
* system just as is described on the ISO 10136.
|
91 |
* @return the projection
|
92 |
*/
|
93 |
public IProjection getSRS();
|
94 |
|
95 |
/**
|
96 |
* This method has been created because of the ISO 19107
|
97 |
* @return if the geometry is simple.
|
98 |
*/
|
99 |
public boolean isSimple(); |
100 |
|
101 |
/**
|
102 |
* This method has been created because of the ISO 19107
|
103 |
* @return the number of dimensions.
|
104 |
*
|
105 |
*/
|
106 |
public int getCoordinateDimension(); |
107 |
|
108 |
/**
|
109 |
* This method has been created because of the ISO 19107
|
110 |
* @return the boundary that encloses the geometry
|
111 |
*/
|
112 |
public Box getBoundary(); |
113 |
|
114 |
/**
|
115 |
* This method has been created because of the ISO 19107. It
|
116 |
* returns a cloned geometry in the new SRS
|
117 |
* @param newProjection
|
118 |
* The new projection
|
119 |
* @return the boundary that encloses the geometry
|
120 |
*/
|
121 |
public AbstractGeometry transform(IProjection newProjection);
|
122 |
|
123 |
/**
|
124 |
* Gets a concrete operation
|
125 |
* @param opeartionCode
|
126 |
* Operation code. See the GeometryOperation class to see the codes
|
127 |
* @return
|
128 |
* An operation or null
|
129 |
*/
|
130 |
public GeometryOperation getOperation(int opeartionCode); |
131 |
|
132 |
/**
|
133 |
* Executes the operation for a concrete geometry
|
134 |
* @param operationCode
|
135 |
* @return
|
136 |
* The operation result (if exists)
|
137 |
* @throws GeometryOperationException
|
138 |
*/
|
139 |
public Object doOperation(int opeartionCode) throws GeometryOperationException; |
140 |
|
141 |
/**
|
142 |
* It returns the geometry type, that can be one of the constants
|
143 |
* defined in FShape: POINT, LINE, POLIGON
|
144 |
* @return The geometry type
|
145 |
*/
|
146 |
int getGeometryType();
|
147 |
|
148 |
/**
|
149 |
* It clones the geometry
|
150 |
* @return The cloned geometry
|
151 |
*/
|
152 |
IGeometry cloneGeometry(); |
153 |
|
154 |
/**
|
155 |
* Devuelve true si la geometr?a intersecta con el rect?ngulo que se pasa
|
156 |
* como par?metro.
|
157 |
*
|
158 |
* @param r Rect?ngulo.
|
159 |
*
|
160 |
* @return True, si intersecta.
|
161 |
* @deprecated
|
162 |
*/
|
163 |
boolean intersects(Rectangle2D r); |
164 |
|
165 |
/**
|
166 |
* Se usa en las strategies de dibujo para comprobar de manera r?pida
|
167 |
* si intersecta con el rect?ngulo visible
|
168 |
* @param x
|
169 |
* @param y
|
170 |
* @param w
|
171 |
* @param h
|
172 |
* @return
|
173 |
* @deprecated
|
174 |
*/
|
175 |
public boolean fastIntersects(double x, double y, double w, double h); |
176 |
|
177 |
/**
|
178 |
* Devuelve el Rect?ngulo que ocupa la geometr?a.
|
179 |
* @return Rect?ngulo.
|
180 |
* @deprecated Use getBoundary instead of this
|
181 |
*/
|
182 |
Rectangle2D getBounds2D();
|
183 |
|
184 |
/**
|
185 |
* Reproyecta la geometr?a a partir del transformador de coordenadas.
|
186 |
*
|
187 |
* @param ct Coordinate Transformer.
|
188 |
* @deprecated
|
189 |
*/
|
190 |
void reProject(ICoordTrans ct);
|
191 |
|
192 |
/**
|
193 |
* Devuelve el GeneralPathXIterator con la informaci?n relativa a la geometr?a.
|
194 |
* @param at TODO
|
195 |
*
|
196 |
* @return PathIterator.
|
197 |
* @deprecated
|
198 |
*/
|
199 |
PathIterator getPathIterator(AffineTransform at); |
200 |
|
201 |
/**
|
202 |
*
|
203 |
* @return
|
204 |
* @throws IOException
|
205 |
* @deprecated
|
206 |
*/
|
207 |
public byte[] toWKB() throws IOException; |
208 |
|
209 |
/**
|
210 |
* It returns the handlers of the geomety,
|
211 |
* these they can be of two types is straightening and of seleccion.
|
212 |
*
|
213 |
* @param type Type of handlers
|
214 |
*
|
215 |
* @return Handlers.
|
216 |
*/
|
217 |
public Handler[] getHandlers(int type); |
218 |
|
219 |
/**
|
220 |
*
|
221 |
* @param at
|
222 |
* @deprecated
|
223 |
*/
|
224 |
public void transform(AffineTransform at); |
225 |
|
226 |
/**
|
227 |
*
|
228 |
* @param at
|
229 |
* @param flatness
|
230 |
* @return
|
231 |
* @deprecated
|
232 |
*/
|
233 |
PathIterator getPathIterator(AffineTransform at, double flatness); |
234 |
|
235 |
/**
|
236 |
* Useful to have the real shape behind the scenes.
|
237 |
* May be uses to edit it knowing it it is a Circle, Ellipse, etc
|
238 |
* @return
|
239 |
* @deprecated
|
240 |
*/
|
241 |
Shape getInternalShape();
|
242 |
} |