Revision 29166 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/Geometry.java
Geometry.java | ||
---|---|---|
39 | 39 |
import org.gvsig.fmap.geom.operation.GeometryOperationException; |
40 | 40 |
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException; |
41 | 41 |
import org.gvsig.fmap.geom.primitive.Envelope; |
42 |
import org.gvsig.fmap.geom.primitive.FShape; |
|
43 | 42 |
import org.gvsig.fmap.geom.primitive.GeneralPathX; |
44 | 43 |
import org.gvsig.fmap.geom.type.GeometryType; |
45 | 44 |
|
... | ... | |
70 | 69 |
public interface Geometry extends Shape, Serializable, Comparable { |
71 | 70 |
|
72 | 71 |
/** |
73 |
* Predefined geometry types in the model |
|
72 |
* Predefined geometry types in the model.
|
|
74 | 73 |
*/ |
75 | 74 |
public interface TYPES { |
76 | 75 |
/** |
... | ... | |
79 | 78 |
public final static int NULL = -1; |
80 | 79 |
|
81 | 80 |
/** |
82 |
* Any geometry |
|
81 |
* Any geometry.
|
|
83 | 82 |
*/ |
84 | 83 |
|
85 | 84 |
public final static int GEOMETRY = 0; |
86 | 85 |
|
87 | 86 |
/** |
88 | 87 |
* A geometric element that has zero dimensions and a location determinable by an ordered set |
89 |
* of coordinates |
|
88 |
* of coordinates.
|
|
90 | 89 |
*/ |
91 | 90 |
public final static int POINT = 1; |
92 | 91 |
|
... | ... | |
102 | 101 |
public final static int SURFACE = 4; |
103 | 102 |
|
104 | 103 |
/** |
105 |
* Solids in 3D |
|
104 |
* Solids in 3D.
|
|
106 | 105 |
*/ |
107 | 106 |
public final static int SOLID = 8; |
108 | 107 |
|
... | ... | |
167 | 166 |
*/ |
168 | 167 |
public interface SUBTYPES{ |
169 | 168 |
/** |
170 |
* The subtype us unknown |
|
169 |
* The subtype us unknown.
|
|
171 | 170 |
*/ |
172 | 171 |
public final static int UNKNOWN = 0; |
173 | 172 |
|
174 | 173 |
/** |
175 |
* Geometries with two dimensions |
|
174 |
* Geometries with two dimensions.
|
|
176 | 175 |
*/ |
177 | 176 |
public final static int GEOM2D = 1; |
178 | 177 |
|
179 | 178 |
/** |
180 | 179 |
* Geometries with two dimensions and with a value |
181 |
* for the elevation |
|
180 |
* for the elevation.
|
|
182 | 181 |
*/ |
183 | 182 |
public final static int GEOM2DZ = 2; |
184 | 183 |
|
185 | 184 |
/** |
186 |
* Geometries with three dimensions |
|
185 |
* Geometries with three dimensions.
|
|
187 | 186 |
*/ |
188 | 187 |
public final static int GEOM3D = 3; |
189 | 188 |
|
190 | 189 |
/** |
191 | 190 |
* Geometries with two dimensions and with the |
192 |
* M coordinate |
|
191 |
* M coordinate.
|
|
193 | 192 |
*/ |
194 | 193 |
public final static int GEOM2DM = 4; |
195 | 194 |
|
196 | 195 |
/** |
197 | 196 |
* Geometries with three dimensions and with the |
198 |
* M coordinate |
|
197 |
* M coordinate.
|
|
199 | 198 |
*/ |
200 | 199 |
public final static int GEOM3DM = 5; |
201 | 200 |
} |
202 | 201 |
|
203 |
/** Initial value for new geometry types (it must not overlap with the basic ones defined in TYPES) */ |
|
202 |
/** Initial value for new geometry types (it must not overlap with the basic ones defined in TYPES). */
|
|
204 | 203 |
public static final int EXTENDED_GEOMTYPE_OFFSET = 65536; //2^16; |
205 | 204 |
|
206 | 205 |
public static int BEST = 0; |
207 | 206 |
/** |
208 |
* North |
|
207 |
* North.
|
|
209 | 208 |
*/ |
210 | 209 |
public static int N = 1; |
211 | 210 |
|
212 | 211 |
/** |
213 |
* North - East |
|
212 |
* North - East.
|
|
214 | 213 |
*/ |
215 | 214 |
public static int NE = 2; |
216 | 215 |
|
217 | 216 |
/** |
218 |
* East |
|
217 |
* East.
|
|
219 | 218 |
*/ |
220 | 219 |
public static int E = 3; |
221 | 220 |
|
222 | 221 |
/** |
223 |
* South - East |
|
222 |
* South - East.
|
|
224 | 223 |
*/ |
225 | 224 |
public static int SE = 4; |
226 | 225 |
|
227 | 226 |
/** |
228 |
* South |
|
227 |
* South.
|
|
229 | 228 |
*/ |
230 | 229 |
public static int S = 5; |
231 | 230 |
|
232 | 231 |
/** |
233 |
* South - West |
|
232 |
* South - West.
|
|
234 | 233 |
*/ |
235 | 234 |
public static int SW = 6; |
236 | 235 |
|
237 | 236 |
/** |
238 |
* West |
|
237 |
* West.
|
|
239 | 238 |
*/ |
240 | 239 |
public static int W = 7; |
241 | 240 |
|
242 | 241 |
/** |
243 |
* North - West |
|
242 |
* North - West.
|
|
244 | 243 |
*/ |
245 | 244 |
public static int NW = 8; |
246 | 245 |
|
... | ... | |
258 | 257 |
public int getType(); |
259 | 258 |
|
260 | 259 |
/** |
261 |
* Creates a clone of this geometry |
|
260 |
* Creates a clone of this geometry.
|
|
262 | 261 |
* |
263 | 262 |
* @return A clone of this geometry. |
264 | 263 |
*/ |
265 | 264 |
public Geometry cloneGeometry(); |
266 | 265 |
|
267 | 266 |
/** |
268 |
* Returns true if this geometry intersects the rectangle passed as parameter |
|
267 |
* Returns true if this geometry intersects the rectangle passed as parameter.
|
|
269 | 268 |
* |
270 | 269 |
* @param r Rectangle. |
271 | 270 |
* |
... | ... | |
278 | 277 |
* intersects with the visible rectangle. |
279 | 278 |
* |
280 | 279 |
* @param x |
281 |
* The minimum X coordinate |
|
280 |
* The minimum X coordinate.
|
|
282 | 281 |
* @param y |
283 |
* The minimum Y coordinate |
|
282 |
* The minimum Y coordinate.
|
|
284 | 283 |
* @param w |
285 |
* The width of the envelope |
|
284 |
* The width of the envelope.
|
|
286 | 285 |
* @param h |
287 |
* The height of the envelope |
|
288 |
* @return true if <code>this</code> intersects the rectangle defined by the parameters |
|
286 |
* The height of the envelope.
|
|
287 |
* @return true if <code>this</code> intersects the rectangle defined by the parameters.
|
|
289 | 288 |
*/ |
290 | 289 |
public boolean fastIntersects(double x, double y, double w, double h); |
291 | 290 |
|
... | ... | |
306 | 305 |
* each ordinate, and second one containing all the maximums. |
307 | 306 |
* </p> |
308 | 307 |
* @return |
309 |
* The minimum bounding box for this Geometry |
|
308 |
* The minimum bounding box for this Geometry.
|
|
310 | 309 |
*/ |
311 | 310 |
public Envelope getEnvelope(); |
312 | 311 |
|
... | ... | |
321 | 320 |
|
322 | 321 |
/** |
323 | 322 |
* If applies an affine transformation and |
324 |
* returns the GeneralPathXIterator with this geometry's information |
|
323 |
* returns the GeneralPathXIterator with this geometry's information.
|
|
325 | 324 |
* @param at |
326 |
* The transformation to apply |
|
325 |
* The transformation to apply.
|
|
327 | 326 |
* @return |
328 | 327 |
* The GeneralPathXIterator with this geometry's information. |
329 | 328 |
*/ |
... | ... | |
334 | 333 |
* these they can be of two types is straightening and of selection. |
335 | 334 |
* |
336 | 335 |
* @param type |
337 |
* Type of handlers |
|
336 |
* Type of handlers.
|
|
338 | 337 |
* |
339 | 338 |
* @return |
340 | 339 |
* The handlers. |
... | ... | |
345 | 344 |
* It applies an affine transformation to the geometry. |
346 | 345 |
* |
347 | 346 |
* @param at |
348 |
* The transformation to apply |
|
347 |
* The transformation to apply.
|
|
349 | 348 |
*/ |
350 | 349 |
public void transform(AffineTransform at); |
351 | 350 |
|
352 | 351 |
/** |
353 | 352 |
* If applies an affine transformation and |
354 |
* returns the GeneralPathXIterator with this geometry's information |
|
353 |
* returns the GeneralPathXIterator with this geometry's information.
|
|
355 | 354 |
* @param at |
356 |
* The affine transformation |
|
355 |
* The affine transformation.
|
|
357 | 356 |
* @param flatness |
357 |
* |
|
358 | 358 |
* @return |
359 | 359 |
* The GeneralPathXIterator with this geometry's information. |
360 | 360 |
*/ |
... | ... | |
362 | 362 |
|
363 | 363 |
/** |
364 | 364 |
* Useful to have the real shape behind the scenes. |
365 |
* May be uses to edit it knowing it it is a Circle, Ellipse, etc |
|
365 |
* May be uses to edit it knowing it it is a Circle, Ellipse, etc.
|
|
366 | 366 |
* @return |
367 | 367 |
* The awt shape |
368 | 368 |
*/ |
... | ... | |
372 | 372 |
* Returns the largest number n such that each direct position |
373 | 373 |
* in a geometric set can be associated with a subset |
374 | 374 |
* that has the direct position in its interior and |
375 |
* is similar (isomorphic) to Rn, Euclidean n-space |
|
375 |
* is similar (isomorphic) to Rn, Euclidean n-space.
|
|
376 | 376 |
* @return |
377 |
* The dimension |
|
377 |
* The dimension.
|
|
378 | 378 |
*/ |
379 | 379 |
public int getDimension(); |
380 | 380 |
|
... | ... | |
386 | 386 |
* whose intersection with the object is isomorphic to an |
387 | 387 |
* n-sphere, where n is the dimension of this Geometry. |
388 | 388 |
* @return |
389 |
* If the geometry is simple |
|
389 |
* If the geometry is simple.
|
|
390 | 390 |
*/ |
391 | 391 |
public boolean isSimple(); |
392 | 392 |
|
393 | 393 |
/** |
394 |
* Invokes a geometry operation given its index and context |
|
394 |
* Invokes a geometry operation given its index and context.
|
|
395 | 395 |
* @param index |
396 | 396 |
* Unique index of the operation. Operation code. |
397 |
* @param ctx |
|
398 |
* The context of the geometry operation. |
|
397 | 399 |
* @return |
398 | 400 |
* Object returned by the operation. |
401 |
* @throws GeometryOperationNotSupportedException |
|
402 |
* It is thrown when the operation has been not registered for this geometry. |
|
403 |
* @throws GeometryOperationException |
|
404 |
* It is thrown when there is an error executing the operation. |
|
399 | 405 |
*/ |
400 | 406 |
public Object invokeOperation(int index, GeometryOperationContext ctx) throws GeometryOperationNotSupportedException, GeometryOperationException; |
401 | 407 |
|
402 | 408 |
/** |
403 |
* Invokes a geometry operation given its name and context |
|
409 |
* Invokes a geometry operation given its name and context.
|
|
404 | 410 |
* @param opName |
405 |
* Operation name |
|
411 |
* Operation name. |
|
412 |
* @param ctx |
|
413 |
* The context of the geometry operation. |
|
406 | 414 |
* @return |
407 | 415 |
* Object returned by the operation. |
416 |
* @throws GeometryOperationNotSupportedException |
|
417 |
* It is thrown when the operation has been not registered for this geometry. |
|
418 |
* @throws GeometryOperationException |
|
419 |
* It is thrown when there is an error executing the operation. |
|
408 | 420 |
*/ |
409 | 421 |
public Object invokeOperation(String opName, GeometryOperationContext ctx) throws GeometryOperationNotSupportedException, GeometryOperationException; |
410 | 422 |
|
411 | 423 |
/** |
412 |
* Instance of the GeometryType associated to this geometry |
|
424 |
* Instance of the GeometryType associated to this geometry.
|
|
413 | 425 |
* @return |
414 |
* The geometry type |
|
426 |
* The geometry type.
|
|
415 | 427 |
*/ |
416 | 428 |
public GeometryType getGeometryType(); |
417 | 429 |
|
418 | 430 |
/** |
419 | 431 |
* Get GeneralPathIterator, to do registered operations to it. |
420 | 432 |
* @return |
421 |
* The GeneralPathX |
|
433 |
* The GeneralPathX.
|
|
422 | 434 |
*/ |
423 | 435 |
public GeneralPathX getGeneralPath(); |
424 | 436 |
} |
Also available in: Unified diff