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 / GeometryManager.java @ 43405

History | View | Annotate | Download (49 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
package org.gvsig.fmap.geom;
25

    
26
import java.awt.geom.PathIterator;
27
import java.util.List;
28
import org.cresques.cts.IProjection;
29

    
30
import org.gvsig.fmap.geom.aggregate.MultiCurve;
31
import org.gvsig.fmap.geom.aggregate.MultiLine;
32
import org.gvsig.fmap.geom.aggregate.MultiPoint;
33
import org.gvsig.fmap.geom.aggregate.MultiPolygon;
34
import org.gvsig.fmap.geom.aggregate.MultiPrimitive;
35
import org.gvsig.fmap.geom.aggregate.MultiSurface;
36
import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
37
import org.gvsig.fmap.geom.exception.CreateGeometryException;
38
import org.gvsig.fmap.geom.operation.GeometryOperation;
39
import org.gvsig.fmap.geom.operation.GeometryOperationContext;
40
import org.gvsig.fmap.geom.operation.GeometryOperationException;
41
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
42
import org.gvsig.fmap.geom.primitive.Curve;
43
import org.gvsig.fmap.geom.primitive.Envelope;
44
import org.gvsig.fmap.geom.primitive.GeneralPathX;
45
import org.gvsig.fmap.geom.primitive.IGeneralPathX;
46
import org.gvsig.fmap.geom.primitive.Line;
47
import org.gvsig.fmap.geom.primitive.NullGeometry;
48
import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
49
import org.gvsig.fmap.geom.primitive.Point;
50
import org.gvsig.fmap.geom.primitive.Polygon;
51
import org.gvsig.fmap.geom.primitive.Surface;
52
import org.gvsig.fmap.geom.type.GeometryType;
53
import org.gvsig.fmap.geom.type.GeometryTypeNotSupportedException;
54
import org.gvsig.fmap.geom.type.GeometryTypeNotValidException;
55
import org.gvsig.tools.dynobject.DynObject;
56
import org.gvsig.tools.service.Manager;
57
import org.gvsig.tools.service.ServiceException;
58
import org.gvsig.tools.service.spi.ServiceManager;
59

    
60
/**
61
 * This singleton provides a centralized access to gvSIG's Geometry Model.
62
 * Its responsibilities are:<br>
63
 *
64
 * <ul>
65
 * <li>Offering a set of convenient methods for registering and retrieving
66
 * geometry types.
67
 * <li>Offering a set of convenient methods for registering and retrieving
68
 * geometry operations associated to one or more geometry types.
69
 * <li>Offering a set of convenient methods for registering and retrieving new
70
 * geometries.
71
 * </ul>
72
 *
73
 * @author jiyarza
74
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
75
 */
76
public interface GeometryManager extends Manager, ServiceManager {
77

    
78
    public interface OPERATIONS {
79

    
80
        public final static String FROMWKT = "FromWKT";
81
        public final static String FROMWKB = "FromWKB";
82
        public final static String FROMEWKB = "FromEWKB";
83

    
84
        public final static String TOWKT = "ToWKT";
85
        public final static String TOWKB = "ToWKB";
86
        public final static String TOEWKB = "ToEWKB";
87
    }
88

    
89
    /**
90
     * <p>
91
     * Registers a GeometryOperation associated to a GeometryType. Returns an
92
     * unique index that is used later to identify and invoke the operation.
93
     * </p>
94
     * <p>
95
     * By convention this index should be in a final and static variable in the
96
     * class that implements the operation. The value of this variable must be
97
     * set using the method
98
     * {@link GeometryManager#getGeometryOperationCode(String)}:<BR>
99
     *
100
     * <pre>
101
     *
102
     * public class MyOperation extends GeometryOperation {
103
     *
104
     *     public static final int CODE = GeometryLocator.getGeometryManager()
105
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
106
     * }
107
     * </pre>
108
     *
109
     * </p>
110
     *
111
     * @param geomOpName
112
     *            Operation's unique name
113
     * @param geomOp
114
     *            Specific GeometryOperation's instance implementing this
115
     *            operation
116
     * @param geomType
117
     *            GeometryType instance to which this operation should be
118
     *            associated
119
     * @return Index assigned to this operation. This index is used later to
120
     *         access the operation.
121
     *
122
     */
123
    public int registerGeometryOperation(String geomOpName,
124
        GeometryOperation geomOp, GeometryType geomType);
125

    
126
    /**
127
     * <p>
128
     * Registers a GeometryOperation that is common for all GeometryType
129
     * (registered yet or not). Returns an unique index that is used later to
130
     * identify and invoke the operation.
131
     * </p>
132
     * <p>
133
     * By convention this index should be in a final and static variable in the
134
     * class that implements the operation. The value of this variable must be
135
     * set using the method
136
     * {@link GeometryManager#getGeometryOperationCode(String)}:<BR>
137
     *
138
     * <pre>
139
     *
140
     * public class MyOperation extends GeometryOperation {
141
     *
142
     *     public static final int CODE = GeometryLocator.getGeometryManager()
143
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
144
     * }
145
     * </pre>
146
     *
147
     * </p>
148
     *
149
     * @param geomOpName
150
     *            Operation's unique name
151
     * @param geomOp
152
     *            Specific GeometryOperation's instance implementing this
153
     *            operation
154
     * @return Index assigned to this operation. This index is used later to
155
     *         access the operation.
156
     */
157
    public int registerGeometryOperation(String geomOpName,
158
        GeometryOperation geomOp);
159

    
160
    /**
161
     * <p>
162
     * Registers a GeometryOperation associated to a GeometryType, that has been
163
     * specified using the type code and the subtype code. Returns an unique
164
     * index that is used later to identify and invoke the operation.
165
     * </p>
166
     * <p>
167
     * By convention this index should be in a final and static variable in the
168
     * class that implements the operation. The value of this variable must be
169
     * set using the method
170
     * {@link GeometryManager#getGeometryOperationCode(String)}:<BR>
171
     *
172
     * <pre>
173
     *
174
     * public class MyOperation extends GeometryOperation {
175
     *
176
     *     public static final int CODE = GeometryLocator.getGeometryManager()
177
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
178
     * }
179
     * </pre>
180
     *
181
     * </p>
182
     * <p>
183
     * This method is only used if you have not a reference to the GeometryType
184
     * associated to the geometry class. If you have such reference then it is
185
     * slightly faster to use the method that receives the GeometryType.<br>
186
     * </p>
187
     *
188
     * @param geomOpName
189
     *            Operation's unique name
190
     * @param geomOp
191
     *            Specific GeometryOperation's instance implementing this
192
     *            operation
193
     * @param type
194
     *            Type of geometry. Must be a value defined in
195
     *            {@link Geometry.TYPES}
196
     * @param subType
197
     *            SubType of geometry. Must be a value defined in
198
     *            {@link Geometry.SUBTYPES}
199
     * @return Index assigned to this operation. This index is used later to
200
     *         access the operation.
201
     * @throws GeometryTypeNotSupportedException
202
     *             Returns this exception if there is not a registered geometry
203
     *             with
204
     *             these type and subtype
205
     * @throws GeometryTypeNotValidException
206
     *             Returns if the type and subtype are not valid
207
     */
208
    public int registerGeometryOperation(String geomOpName,
209
        GeometryOperation geomOp, int type, int subType)
210
        throws GeometryTypeNotSupportedException, GeometryTypeNotValidException;
211

    
212
    /**
213
     * <p>
214
     * Registers a GeometryOperation associated to all the geometries with a
215
     * concrete type. Returns an unique index that is used later to identify and
216
     * invoke the operation.<br>
217
     * </p>
218
     * <p>
219
     * By convention this index should be in a final and static variable in the
220
     * class that implements the operation. The value of this variable must be
221
     * set using the method
222
     * {@link GeometryManager#getGeometryOperationCode(String)}:<BR>
223
     *
224
     * <pre>
225
     *
226
     * public class MyOperation extends GeometryOperation {
227
     *
228
     *     public static final int CODE = GeometryLocator.getGeometryManager()
229
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
230
     * }
231
     * </pre>
232
     *
233
     * </p>
234
     *
235
     * @param geomOpName
236
     *            Operation's unique name
237
     * @param geomOp
238
     *            Specific GeometryOperation's instance implementing this
239
     *            operation
240
     * @param type
241
     *            Type of geometry. Must be a value defined in
242
     *            {@link Geometry.TYPES}
243
     * @return Index assigned to this operation. This index is used later to
244
     *         access the operation.
245
     */
246
    public int registerGeometryOperation(String geomOpName,
247
        GeometryOperation geomOp, int type);
248

    
249
    /**
250
     * <p>
251
     * Registers a GeometryOperation associated to all the geometries which
252
     * super type matches with a concrete type. Returns an unique index that
253
     * is used later to identify and invoke the operation.<br>
254
     * </p>
255
     * <p>
256
     * By convention this index should be in a final and static variable in the
257
     * class that implements the operation. The value of this variable must be
258
     * set using the method
259
     * {@link GeometryManager#getGeometryOperationCode(String)}:<BR>
260
     *
261
     * <pre>
262
     *
263
     * public class MyOperation extends GeometryOperation {
264
     *
265
     *     public static final int CODE = GeometryLocator.getGeometryManager()
266
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
267
     * }
268
     * </pre>
269
     *
270
     * </p>
271
     *
272
     * @param geomOpName
273
     *            Operation's unique name
274
     * @param geomOp
275
     *            Specific GeometryOperation's instance implementing this
276
     *            operation
277
     * @param superType
278
     *            super type of geometries that is used to register
279
     *            the operation. Must be a value defined in
280
     *            {@link Geometry.TYPES}
281
     * @return Index assigned to this operation. This index is used later to
282
     *         access the operation.
283
     */
284
    public int registerGeometryOperationBySuperType(String geomOpName,
285
        GeometryOperation geomOp, int superType);
286

    
287
    /**
288
     * <p>
289
     * Registers a GeometryOperation associated to all the geometries which
290
     * super subType matches with a concrete subType. Returns an unique index that
291
     * is used later to identify and invoke the operation.<br>
292
     * </p>
293
     * <p>
294
     * By convention this index should be in a final and static variable in the
295
     * class that implements the operation. The value of this variable must be
296
     * set using the method
297
     * {@link GeometryManager#getGeometryOperationCode(String)}:<BR>
298
     *
299
     * <pre>
300
     *
301
     * public class MyOperation extends GeometryOperation {
302
     *
303
     *     public static final int CODE = GeometryLocator.getGeometryManager()
304
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
305
     * }
306
     * </pre>
307
     *
308
     * </p>
309
     *
310
     * @param geomOpName
311
     *            Operation's unique name
312
     * @param geomOp
313
     *            Specific GeometryOperation's instance implementing this
314
     *            operation
315
     * @param superSubType
316
     *            super subType of geometries that is used to register
317
     *            the operation. Must be a value defined in
318
     *            {@link Geometry.SUBTYPES}
319
     * @return Index assigned to this operation. This index is used later to
320
     *         access the operation.
321
     */
322
    public int registerGeometryOperationBySuperSubType(String geomOpName,
323
        GeometryOperation geomOp, int superSubType);
324

    
325
    /**
326
     * <p>
327
     * Registers a GeometryOperation associated to all the geometries with a
328
     * concrete subtype. Returns an unique index that is used later to identify
329
     * and invoke the operation.<br>
330
     * </p>
331
     * <p>
332
     * By convention this index should be in a final and static variable in the
333
     * class that implements the operation. The value of this variable must be
334
     * set using the method
335
     * {@link GeometryManager#getGeometryOperationCode(String)}:<BR>
336
     *
337
     * <pre>
338
     *
339
     * public class MyOperation extends GeometryOperation {
340
     *
341
     *     public static final int CODE = GeometryLocator.getGeometryManager()
342
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
343
     * }
344
     * </pre>
345
     *
346
     * </p>
347
     *
348
     * @param geomOpName
349
     *            Operation's unique name
350
     * @param geomOp
351
     *            Specific GeometryOperation's instance implementing this
352
     *            operation
353
     * @param subType
354
     *            SubType of geometry. Must be a value defined in
355
     *            {@link Geometry.SUBTYPES}
356
     * @return Index assigned to this operation. This index is used later to
357
     *         access the operation.
358
     */
359
    public int registerGeometryOperationBySubtype(String geomOpName,
360
        GeometryOperation geomOp, int subType);
361

    
362
    /**
363
     * <p>
364
     * Registers a GeometryType instance.
365
     * </p>
366
     *
367
     * @param geometryType
368
     *            A {@link GeometryType} instance to create {@link Geometry} objects
369
     */
370
    public void registerGeometryType(GeometryType geometryType);
371

    
372
    /**
373
     * <p>
374
     * Registers a Geometry implementation class with a predefined geometry type
375
     * and returns the associated GeometryType instance. Available predefined
376
     * types are defined in {@link Geometry.TYPES} and the subtypes are defined
377
     * in {@link Geometry.SUBTYPES}.
378
     * </p>
379
     * <p>
380
     * How to register a geometry class with a predefined type:
381
     *
382
     * <pre>
383
     *
384
     * GeometryType geomType = GeometryLocator.getGeometryManager()
385
     *     .registerBasicGeometryType(Point2D.class, &quot;Point2D&quot;, Geometry.TYPES.POINT,
386
     *         Geometry.SYBTYPES.GEOM2D);
387
     * </pre>
388
     *
389
     * </p>
390
     *
391
     * @param geomClass
392
     *            Geometry subclass. It must not be null and must implement
393
     *            Geometry, otherwise an exception
394
     *            is raised.
395
     * @param name
396
     *            Symbolic name for the geometry type, it can be null. If it is
397
     *            null then the symbolic name
398
     *            will be the simple class name.
399
     * @param type
400
     *            Type of geometry. Must be a value defined in
401
     *            {@link Geometry.TYPES}
402
     * @param subType
403
     *            SubType of geometry. Must be a value defined in
404
     *            {@link Geometry.SUBTYPES}
405
     * @return Instance of GeometryType associated to the Geometry
406
     *         implementation class
407
     *         geomClass
408
     * @throws IllegalArgumentException
409
     *             If geomClass is null or does not implement Geometry
410
     */
411
    public GeometryType registerGeometryType(Class geomClass, String name,
412
        int type, int subType);
413

    
414
    /**
415
     * <p>
416
     * Registers a Geometry implementation class with a predefined geometry type
417
     * and returns the associated GeometryType instance. Available predefined
418
     * types are defined in {@link Geometry.TYPES} and the subtypes are defined
419
     * in {@link Geometry.SUBTYPES}.
420
     * </p>
421
     * <p>
422
     * It adds also the super type and the super subType of the geometry, that
423
     * can be used to check if the type (or the subtype) inherits of other
424
     * type (or subType)
425
     * </p>
426
     * <p>
427
     * How to register a geometry class with a predefined type:
428
     *
429
     * <pre>
430
     *
431
     * GeometryType geomType = GeometryLocator.getGeometryManager()
432
     *     .registerBasicGeometryType(Arc3D.class, &quot;Arc3D&quot;, Geometry.TYPES.ARC,
433
     *         Geometry.SYBTYPES.GEOM3D, Geometry.TYPES.CURVE, Geometry.SYBTYPES.GEOM2D);
434
     * </pre>
435
     *
436
     * </p>
437
     *
438
     * @param geomClass
439
     *            Geometry subclass. It must not be null and must implement
440
     *            Geometry, otherwise an exception
441
     *            is raised.
442
     * @param name
443
     *            Symbolic name for the geometry type, it can be null. If it is
444
     *            null then the symbolic name
445
     *            will be the simple class name.
446
     * @param type
447
     *            Type of geometry. Must be a value defined in
448
     *            {@link Geometry.TYPES}
449
     * @param subType
450
     *            SubType of geometry. Must be a value defined in
451
     *            {@link Geometry.SUBTYPES}
452
     * @param superType
453
     *              Super type of a geometry. Must be a value defined in
454
     *            {@link Geometry.TYPES}
455
     * @param superSubType
456
     *             Super subType of a geometry. Must be a value defined in
457
     *            {@link Geometry.SUBTYPES}
458
     * @return Instance of GeometryType associated to the Geometry
459
     *         implementation class
460
     *         geomClass
461
     * @throws IllegalArgumentException
462
     *             If geomClass is null or does not implement Geometry
463
     */
464
    public GeometryType registerGeometryType(Class geomClass, String name,
465
        int type, int subType, int superType, int superSubType);
466

    
467
    /**
468
     * <p>
469
     * Registers a Geometry implementation class with a predefined geometry type
470
     * and returns the associated GeometryType instance. Available predefined
471
     * types are defined in {@link Geometry.TYPES} and the subtypes are defined
472
     * in {@link Geometry.SUBTYPES}.
473
     * </p>
474
     * <p>
475
     * It adds also the super type of the geometry, that can be used to
476
     * check if the type inherits of other type.
477
     * </p>
478
     * <p>
479
     * How to register a geometry class with a predefined type:
480
     *
481
     * <pre>
482
     *
483
     * GeometryType geomType = GeometryLocator.getGeometryManager()
484
     *     .registerBasicGeometryType(Arc3D.class, &quot;Arc3D&quot;, Geometry.TYPES.ARC,
485
     *         Geometry.SYBTYPES.GEOM3D, Geometry.TYPES.CURVE);
486
     * </pre>
487
     *
488
     * </p>
489
     *
490
     * @param geomClass
491
     *            Geometry subclass. It must not be null and must implement
492
     *            Geometry, otherwise an exception
493
     *            is raised.
494
     * @param name
495
     *            Symbolic name for the geometry type, it can be null. If it is
496
     *            null then the symbolic name
497
     *            will be the simple class name.
498
     * @param type
499
     *            Type of geometry. Must be a value defined in
500
     *            {@link Geometry.TYPES}
501
     * @param subType
502
     *            SubType of geometry. Must be a value defined in
503
     *            {@link Geometry.SUBTYPES}
504
     * @param superType
505
     *              Super type of a geometry. Must be a value defined in
506
     *            {@link Geometry.TYPES}
507
     * @return Instance of GeometryType associated to the Geometry
508
     *         implementation class
509
     *         geomClass
510
     * @throws IllegalArgumentException
511
     *             If geomClass is null or does not implement Geometry
512
     */
513
    public GeometryType registerGeometryType(Class geomClass, String name,
514
        int type, int subType, int superType);
515

    
516
    /**
517
     * <p>
518
     * Registers a Geometry implementation class with a predefined geometry type
519
     * and returns the associated GeometryType instance. Available predefined
520
     * types are defined in {@link Geometry.TYPES} and the subtypes are defined
521
     * in {@link Geometry.SUBTYPES}.
522
     * </p>
523
     * <p>
524
     * It adds also the super types and the super subTypes of the geometry, that
525
     * can be used to check if the type (or the subtype) inherits of other
526
     * types (or subTypes)
527
     * </p>
528
     * <p>
529
     * How to register a geometry class with a predefined type:
530
     *
531
     * <pre>
532
     *
533
     * GeometryType geomType = GeometryLocator.getGeometryManager()
534
     *     .registerBasicGeometryType(Circle3DM.class, &quot;Circle3DM&quot;, Geometry.TYPES.CIRCLE,
535
     *         Geometry.SYBTYPES.GEOM3DM,
536
     *         new int[]{Geometry.TYPES.CURVE, Geometry.TYPES.GEOMETRY},
537
     *         new int[]{Geometry.SYBTYPES.GEOM2D, Geometry.SYBTYPES.GEOM3D});
538
     * </pre>
539
     *
540
     * </p>
541
     *
542
     * @param geomClass
543
     *            Geometry subclass. It must not be null and must implement
544
     *            Geometry, otherwise an exception
545
     *            is raised.
546
     * @param name
547
     *            Symbolic name for the geometry type, it can be null. If it is
548
     *            null then the symbolic name
549
     *            will be the simple class name.
550
     * @param type
551
     *            Type of geometry. Must be a value defined in
552
     *            {@link Geometry.TYPES}
553
     * @param subType
554
     *            SubType of geometry. Must be a value defined in
555
     *            {@link Geometry.SUBTYPES}
556
     * @param superTypes
557
     *              List of the super types of a geometry. Must be a value defined in
558
     *            {@link Geometry.TYPES}
559
     * @param superSubTypes
560
     *             List of the super subType of a geometry. Must be a value defined in
561
     *            {@link Geometry.SUBTYPES}
562
     * @return Instance of GeometryType associated to the Geometry
563
     *         implementation class
564
     *         geomClass
565
     * @throws IllegalArgumentException
566
     *             If geomClass is null or does not implement Geometry
567
     */
568
    public GeometryType registerGeometryType(Class geomClass, String name,
569
        int type, int subType, int[] superTypes, int superSubTypes[]);
570

    
571
    /**
572
     * <p>
573
     * Registers a Geometry implementation class with a predefined geometry type
574
     * and returns the associated GeometryType instance. Available predefined
575
     * types are defined in {@link Geometry.TYPES} and the subtypes are defined
576
     * in {@link Geometry.SUBTYPES}.
577
     * </p>
578
     * <p>
579
     * It adds also the super types and the super subTypes of the geometry, that
580
     * can be used to check if the type inherits of other types.
581
     * </p>
582
     * <p>
583
     * How to register a geometry class with a predefined type:
584
     *
585
     * <pre>
586
     *
587
     * GeometryType geomType = GeometryLocator.getGeometryManager()
588
     *     .registerBasicGeometryType(Circle2D.class, &quot;Circle2DM&quot;, Geometry.TYPES.CIRCLE,
589
     *         Geometry.SYBTYPES.GEOM2D,
590
     *         new int[]{Geometry.TYPES.CURVE, Geometry.TYPES.SURFACE});
591
     * </pre>
592
     *
593
     * </p>
594
     *
595
     * @param geomClass
596
     *            Geometry subclass. It must not be null and must implement
597
     *            Geometry, otherwise an exception
598
     *            is raised.
599
     * @param name
600
     *            Symbolic name for the geometry type, it can be null. If it is
601
     *            null then the symbolic name
602
     *            will be the simple class name.
603
     * @param type
604
     *            Type of geometry. Must be a value defined in
605
     *            {@link Geometry.TYPES}
606
     * @param subType
607
     *            SubType of geometry. Must be a value defined in
608
     *            {@link Geometry.SUBTYPES}
609
     * @param superTypes
610
     *              List of the super types of a geometry. Must be a value defined in
611
     *            {@link Geometry.TYPES}
612
     * @return Instance of GeometryType associated to the Geometry
613
     *         implementation class
614
     *         geomClass
615
     * @throws IllegalArgumentException
616
     *             If geomClass is null or does not implement Geometry
617
     */
618
    public GeometryType registerGeometryType(Class geomClass, String name,
619
        int type, int subType, int[] superTypes);
620

    
621
    /**
622
     * <p>
623
     * Registers a Geometry implementation class with a predefined geometry type
624
     * and returns the associated GeometryType instance. Available predefined
625
     * types are defined in {@link Geometry.TYPES} and the subtypes are defined
626
     * in {@link Geometry.SUBTYPES}.
627
     * </p>
628
     * <p>
629
     * In this case the symbolic name will be the geometry's simple class name
630
     * </p>
631
     * How to register a new geometry type:
632
     *
633
     * <pre>
634
     *
635
     * GeometryType geomType = GeometryLocator.getGeometryManager()
636
     *     .registerBasicGeometryType(Point2D.class, Geometry.TYPES.POINT,
637
     *         Geometry.SYBTYPES.GEOM2D);
638
     * </pre>
639
     *
640
     * @param geomClass
641
     *            Geometry implementation class. It must not be null and must
642
     *            implement Geometry,
643
     *            otherwise an exception is thrown.
644
     * @param type
645
     *            Type of geometry. Must be a value defined in
646
     *            {@link Geometry.TYPES}
647
     * @param subType
648
     *            SubType of geometry. Must be a value defined in
649
     *            {@link Geometry.SUBTYPES}
650
     * @return Instance of GeometryType associated to the Geometry
651
     *         implementation class
652
     * @throws IllegalArgumentException
653
     *             If geomClass is null or does not implement Geometry
654
     */
655
    public GeometryType registerGeometryType(Class geomClass, int type,
656
        int subType);
657

    
658
    /**
659
     * <p>
660
     * Returns an instance of GeometryType given the Geometry type and the
661
     * subtype.
662
     * </p>
663
     *
664
     * @param type
665
     *            Type of geometry. Must be a value defined in
666
     *            {@link Geometry.TYPES}
667
     * @param subType
668
     *            SubType of geometry. Must be a value defined in
669
     *            {@link Geometry.SUBTYPES}
670
     * @return Instance of GeometryType associated to the type and the subtype
671
     * @throws GeometryTypeNotSupportedException
672
     *             Returns this exception if there is not a registered geometry
673
     *             with
674
     *             these type and subtype
675
     * @throws GeometryTypeNotValidException
676
     *             Returns if the type and subtype are not valid
677
     */
678
    public GeometryType getGeometryType(int type, int subType)
679
        throws GeometryTypeNotSupportedException, GeometryTypeNotValidException;
680

    
681
    /**
682
     * <p>
683
     * This method creates a {@link Geometry} with the type specified by this
684
     * GeometryType. The geometry is empty, and all the internal attributes must
685
     * be assigned to a value when the geometry has been created.
686
     * </p>
687
     * <p>
688
     * This example creates a point2D and sets the coordinates to 1,1:
689
     *
690
     * <pre>
691
     * Point point =
692
     *     (Point) GeometryLocator.getGeometryManager().create(GEOMETRY.TYPES.POINT,
693
     *         GEOMETRY.SUBTYPES.GEOM2D);
694
     * point.setX(1);
695
     * point.setY(1);
696
     * </pre>
697
     *
698
     * </p>
699
     *
700
     * @param geomType
701
     *            The geometry type
702
     * @return
703
     *         A instance of a geometry.
704
     * @throws CreateGeometryException
705
     *             This exception is thrown when the manager can not create
706
     *             the geometry.
707
     */
708
    public Geometry create(GeometryType geomType)
709
        throws CreateGeometryException;
710

    
711
    /**
712
     * <p>
713
     * Creates a Envelope with a concrete subtype. The envelope is empty and it
714
     * have to be filled with the corners once has been created.
715
     * </p>
716
     *
717
     * @param subType
718
     *            SubType of envelope. Must be a value defined in
719
     *            {@link Geometry.SUBTYPES}
720
     * @return
721
     *         A Envelope
722
     * @throws CreateEnvelopeException
723
     *             If it is not possible to create the envelope.
724
     */
725
    public Envelope createEnvelope(int subType) throws CreateEnvelopeException;
726

    
727
    /**
728
     * <p>
729
     * Creates a Envelope with a concrete subtype. It sets the values for the
730
     * lower corner and the upper corner (in 2D) using the method parameters.
731
     * </p>
732
     *
733
     * @param minX
734
     *            The minimum value for the X coordinate.
735
     * @param minY
736
     *            The minimum value for the Y coordinate.
737
     * @param maxX
738
     *            The maximum value for the X coordinate.
739
     * @param maxY
740
     *            The maximum value for the Y coordinate.
741
     * @param subType
742
     *            SubType of envelope. Must be a value defined in
743
     *            {@link Geometry.SUBTYPES}
744
     * @return
745
     * @throws CreateEnvelopeException
746
     */
747
    public Envelope createEnvelope(double minX, double minY, double maxX,
748
        double maxY, int subType) throws CreateEnvelopeException;
749

    
750
    /**
751
     * <p>
752
     * This method creates a {@link Geometry} with the type specified by this
753
     * name. If a geometry with this name doesn't exist, a
754
     * {@link IllegalArgumentException} is thrown. The geometry is empty, and
755
     * all the internal attributes must be assigned to a value when the geometry
756
     * has been created.
757
     * </p>
758
     * <p>
759
     * This example creates a point2D and sets the coordinates to 1,1: It
760
     * supposes that there is a Point2D class with name "Point2D".
761
     * </p>
762
     *
763
     * <pre>
764
     * Point point = (Point) GeometryLocator.getGeometryManager().create(&quot;Point2D&quot;);
765
     * point.setX(1);
766
     * point.setY(1);
767
     * </pre>
768
     *
769
     * @param name
770
     *            The name of the geometry type
771
     * @return
772
     *         A instance of a geometry.
773
     * @throws CreateGeometryException
774
     *             This exception is thrown when the manager can not create
775
     *             the geometry.
776
     */
777
    public Geometry create(String name) throws CreateGeometryException;
778

    
779
    /**
780
     * Create a geometry from a WKT definition.
781
     *
782
     * This is a utility method to wrap the invocation to the operation
783
     * {@link OPERATIONS#FROMWKT}.
784
     *
785
     * @param wkt
786
     *            geometry in Well-known text format
787
     *
788
     * @return the geometry as a Geometry
789
     *
790
     * @throws CreateGeometryException
791
     * @throws GeometryException
792
     */
793
    public Geometry createFrom(String wkt, String srs)
794
        throws CreateGeometryException, GeometryException;
795

    
796
    public Geometry createFrom(String wkt, IProjection srs)
797
        throws CreateGeometryException, GeometryException;
798

    
799
    public Geometry createFrom(String wkt) throws CreateGeometryException,
800
        GeometryException;
801

    
802
    /**
803
     * Create a geometry from a WKB definition.
804
     *
805
     * This is a utility method to wrap the invocation to the operation
806
     * {@link OPERATIONS#FROMWKB}.
807
     *
808
     * @param wkb
809
     *            geometry in well-known binary format
810
     *
811
     * @return the geometry as a Geometry
812
     *
813
     * @throws CreateGeometryException
814
     * @throws GeometryException
815
     */
816
    public Geometry createFrom(byte[] wkb) throws CreateGeometryException,
817
        GeometryException;
818

    
819
    public Geometry createFrom(byte[] wkb, IProjection srs) throws CreateGeometryException,
820
        GeometryException;
821
    
822
    /**
823
     * <p>
824
     * This method creates a {@link Geometry} with a concrete type and subtype.
825
     * The geometry is empty, and all the internal attributes must be assigned
826
     * to a value when the geometry has been created.
827
     * </p>
828
     * <p>
829
     * This example creates a point2D and sets the coordinates to 1,1. It
830
     * supposes that there is a Point2D class with the id 1.
831
     * </p>
832
     *
833
     * <pre>
834
     * Point point =
835
     *     (Point) GeometryLocator.getGeometryManager().create(Geometry.TYPES.POINT,
836
     *         Geometry.SYBTYPES.GEOM2D);
837
     * point.setX(1);
838
     * point.setY(1);
839
     * </pre>
840
     *
841
     * @param type
842
     *            Type of geometry. Must be a value defined in
843
     *            {@link Geometry.TYPES}
844
     * @param subType
845
     *            SubType of geometry. Must be a value defined in
846
     *            {@link Geometry.SUBTYPES}
847
     * @return
848
     *         A instance of a geometry.
849
     * @throws CreateGeometryException
850
     *             This exception is thrown when the manager can not create
851
     *             the geometry.
852
     */
853
    public Geometry create(int type, int subType)
854
        throws CreateGeometryException;
855

    
856
    /**
857
     * <p>
858
     * It creates a null geometry with a concrete subtype.
859
     * <p>
860
     *
861
     * @param subType
862
     *            SubType of geometry. Must be a value defined in
863
     *            {@link Geometry.SUBTYPES}
864
     * @return
865
     *         A NullGeometry
866
     * @throws CreateGeometryException
867
     *             This exception is thrown when the manager can not create
868
     *             the geometry.
869
     * @deprecated use null instead. This method can be removed in next revisions
870
     */
871
    public NullGeometry createNullGeometry(int subType)
872
        throws CreateGeometryException;
873

    
874
    /**
875
     * <p>
876
     * Create a new point with a concrete type and sets the value for the X and
877
     * the Y.
878
     * </p>
879
     *
880
     * @param x
881
     *            The X coordinate
882
     * @param y
883
     *            The y coordinate
884
     * @param subType
885
     *            SubType of geometry. Must be a value defined in
886
     *            {@link Geometry.SUBTYPES}
887
     * @throws CreateGeometryException
888
     *             This exception is thrown when the manager can not create
889
     *             the geometry.
890
     * @return
891
     *         The Point
892
     */
893
    public Point createPoint(double x, double y, int subType)
894
        throws CreateGeometryException;
895

    
896
    /**
897
     * Create a new line with a concrete type. Use later addVertex to add
898
     * vertex to te line.
899
     *
900
     * @param subType SubType of geometry. Must be a value defined in {@link Geometry.SUBTYPES}
901
     * @return a line
902
     * @throws CreateGeometryException
903
     *             This exception is thrown when the manager can not create
904
     *             the geometry.
905
     */
906
    public Line createLine(int subType) throws CreateGeometryException;
907

    
908
    /**
909
     * @deprecated use createLine
910
     */
911
    public Curve createCurve(int subType) throws CreateGeometryException;
912

    
913
    /**
914
     * Create a new polygon with a concrete type.
915
     * Use later addVertex to add vertex to te polygon.
916
     *
917
     * @param subType
918
     *            SubType of geometry. Must be a value defined in
919
     *            {@link Geometry.SUBTYPES}
920
     * @return
921
     *         A polygon
922
     * @throws CreateGeometryException
923
     *             This exception is thrown when the manager can not create
924
     *             the geometry.
925
     */
926
    public Polygon createPolygon(int subType)
927
        throws CreateGeometryException;
928

    
929
    /**
930
     * @deprecated use createPolygon
931
     */
932
    public Surface createSurface(int subType)
933
        throws CreateGeometryException;
934

    
935
    /**
936
     * Create a new multipoint with a concrete subtype.
937
     * Use addPrimitive to populate the multipoint.
938
     *
939
     * @param subType
940
     *            SubType of geometry. Must be a value defined in
941
     *            {@link Geometry.SUBTYPES}
942
     * @return A multipoint
943
     * @throws CreateGeometryException
944
     *             This exception is thrown when the manager can not create the
945
     *             geometry.
946
     */
947
    public MultiPoint createMultiPoint(int subType)
948
        throws CreateGeometryException;
949

    
950
    /**
951
     * Create a new multicurve with a concrete subtype.
952
     * Use addPrimitive to populate the multicurve.
953
     *
954
     * @param subType
955
     *            SubType of geometry. Must be a value defined in
956
     *            {@link Geometry.SUBTYPES}
957
     * @return A multicurve
958
     * @throws CreateGeometryException
959
     *             This exception is thrown when the manager can not create the
960
     *             geometry.
961
     */
962
    public MultiCurve createMultiCurve(int subType) throws CreateGeometryException;
963

    
964
    public MultiLine createMultiLine(int subType) throws CreateGeometryException;
965

    
966
    /**
967
     * Create a new multisurface with a concrete subtype.
968
     * Use later addPrimitive to populate.
969
     *
970
     * @param subType
971
     *            SubType of geometry. Must be a value defined in
972
     *            {@link Geometry.SUBTYPES}
973
     * @return A multisurface
974
     * @throws CreateGeometryException
975
     *             This exception is thrown when the manager can not create the
976
     *             geometry.
977
     */
978
    public MultiSurface createMultiSurface(int subType) throws CreateGeometryException;
979

    
980
    public MultiPolygon createMultiPolygon(int subType) throws CreateGeometryException;
981

    
982
    /**
983
     * <p>
984
     * Returns an operation given the Geometry type, the Geometry subtype and
985
     * and the operation code. If opCode corresponds to a common operation (a
986
     * common operation is an operation registered for all geometries), then
987
     * this method returns the common operation.
988
     * </p>
989
     * <p>
990
     * For better performance, if you need to call an operation multiple times,
991
     * use this method only once and keep the returned object in a local
992
     * variable over which you can iterate. For instance:
993
     *
994
     * <pre>
995
     * // Get the operation you need
996
     * GeometryManager gm = GeometryLocator.getGeometryManager()
997
     * GeometryOperation geomOp = null;
998
     * try {
999
     *    geomOp = gm.getGeometryOperation(Draw2D.CODE, Geometry.TYPES.POINT,
1000
     *    Geometry.SUBTYPES.GEOM2D);
1001
     * } catch (GeometryTypeNotSupportedException gtnse) {
1002
     *    // treat exception
1003
     * } catch (GeometryOperationNotSupportedException gonse) {
1004
     *    // treat exception
1005
     * }
1006
     *
1007
     *  // Fill the operation context with required params
1008
     * GeometryOperationContext ctx = new GeometryOperationContext();
1009
     *
1010
     *  // Here is the main loop where you call the operation
1011
     * for (int i=0; i<myGeometries.length; i++) {
1012
     *    Object result = geomOp.invoke(myGeometries[i], ctx);
1013
     * }
1014
     * </pre>
1015
     *
1016
     * </p>
1017
     *
1018
     * @param opCode
1019
     *            The operation code
1020
     * @param type
1021
     *            Type of geometry. Must be a value defined in
1022
     *            {@link Geometry.TYPES}
1023
     * @param subType
1024
     *            SubType of geometry. Must be a value defined in
1025
     *            {@link Geometry.SUBTYPES}
1026
     * @return Geometry operation
1027
     * @throws GeometryTypeNotSupportedException
1028
     *             Returns this exception if there is not a registered geometry
1029
     *             with
1030
     *             these type and subtype
1031
     * @throws GeometryTypeNotValidException
1032
     *             Returns this exception if the type and subtype are not valid
1033
     * @throws GeometryOperationNotSupportedException
1034
     *             Returns this exception if there is not a registered operation
1035
     *             with
1036
     *             this operation code
1037
     */
1038
    public GeometryOperation getGeometryOperation(int opCode, int type,
1039
        int subType) throws GeometryTypeNotSupportedException,
1040
        GeometryOperationNotSupportedException, GeometryTypeNotValidException;
1041

    
1042
    /**
1043
     * <p>
1044
     * Returns an common operation with given operation code. A common operation
1045
     * is an operation registered for all geometries.
1046
     * </p>
1047
     * <p>
1048
     * For better performance, if you need to call an operation multiple times,
1049
     * use this method only once and keep the returned object in a local
1050
     * variable over which you can iterate. For instance:
1051
     *
1052
     * <pre>
1053
     * // Get the operation you need
1054
     * GeometryManager gm = GeometryLocator.getGeometryManager()
1055
     * GeometryOperation geomOp = null;
1056
     * try {
1057
     *    geomOp = gm.getGeometryOperation(FromWKB.CODE);
1058
     * } catch (GeometryOperationNotSupportedException gonse) {
1059
     *    // treat exception
1060
     * }
1061
     *
1062
     *  // Fill the operation context with required params
1063
     * FromWKBGeometryOperationContext ctx = new FromWKBGeometryOperationContext();
1064
     *
1065
     *  // Here is the main loop where you call the operation
1066
     * for (int i=0; i<myGeometriesWKB.length; i++) {
1067
     *    ctx.setData(myGeometriesWKB[i]);
1068
     *    Object result = geomOp.invoke(null, ctx);
1069
     * }
1070
     * </pre>
1071
     *
1072
     * </p>
1073
     *
1074
     * @param opCode
1075
     *            The operation code
1076
     * @return Geometry operation
1077
     * @throws GeometryOperationNotSupportedException
1078
     *             Returns this exception if there is not a registered operation
1079
     *             with
1080
     *             this operation code
1081
     */
1082
    public GeometryOperation getGeometryOperation(int opCode)
1083
        throws GeometryOperationNotSupportedException;
1084

    
1085
    /**
1086
     * <p>
1087
     * Invokes an operation given its code, the geometry and the operation
1088
     * context holding the parameters required for the operation.
1089
     * </p>
1090
     *
1091
     * @param opCode
1092
     *            Operation code.
1093
     * @param geom
1094
     *            Geometry to which apply the operation
1095
     * @param ctx
1096
     *            Context holding the operation parameters
1097
     * @return
1098
     *         The object returned by an operation, depends on each operation.
1099
     */
1100
    public Object invokeOperation(int opCode, Geometry geom,
1101
        GeometryOperationContext ctx)
1102
        throws GeometryOperationNotSupportedException,
1103
        GeometryOperationException;
1104

    
1105
    /**
1106
     * <p>
1107
     * Invokes an operation given its code, the geometry and the operation
1108
     * context holding the parameters required for the operation.
1109
     * </p>
1110
     *
1111
     * @param geomOpName
1112
     *            Operation name.
1113
     * @param geom
1114
     *            Geometry to which apply the operation
1115
     * @param ctx
1116
     *            Context holding the operation parameters
1117
     * @return
1118
     *         The object returned by an operation, depends on each operation.
1119
     */
1120
    public Object invokeOperation(String geomOpName, Geometry geom,
1121
        GeometryOperationContext ctx)
1122
        throws GeometryOperationNotSupportedException,
1123
        GeometryOperationException;
1124

    
1125
    /**
1126
     * <p>
1127
     * Invokes an operation given its code, and the operation context holding
1128
     * the parameters required for the operation.
1129
     * </p>
1130
     *
1131
     * @param geomOpName
1132
     *            Operation name.
1133
     * @param ctx
1134
     *            Context holding the operation parameters
1135
     * @return
1136
     *         The object returned by an operation, depends on each operation.
1137
     */
1138
    public Object invokeOperation(String geomOpName,
1139
        GeometryOperationContext ctx)
1140
        throws GeometryOperationNotSupportedException,
1141
        GeometryOperationException;
1142

    
1143
    /**
1144
     * <p>
1145
     * Registers the unique name of one operation. If it already exists then
1146
     * this method does nothing but returning the name's corresponding index.
1147
     * </p>
1148
     * <p>
1149
     * By convention this method is used to set the value of the final and
1150
     * static variable that is located in the classes that implements the
1151
     * operation:<BR>
1152
     *
1153
     * <pre>
1154
     *
1155
     * public class MyOperation extends GeometryOperation {
1156
     *
1157
     *     public static final int CODE = GeometryLocator.getGeometryManager()
1158
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
1159
     * }
1160
     * </pre>
1161
     *
1162
     * </p>
1163
     *
1164
     * @param geomOpName
1165
     *            Name used to register the geometry operation
1166
     * @return
1167
     *         Index assigned to the operation name passed as parameter
1168
     */
1169
    public int getGeometryOperationCode(String geomOpName);
1170

    
1171
    /**
1172
     * Returns a list with the name of the operations that have been
1173
     * registered.
1174
     *
1175
     * @return
1176
     *         A list of the registered operations.
1177
     */
1178
    public List getGeometryOperationNames();
1179

    
1180
    /**
1181
     * Returns the flatness used to convert a curve is a set
1182
     * of points.
1183
     *
1184
     * @return
1185
     *         The flatness.
1186
     */
1187
    public double getFlatness();
1188

    
1189
    /**
1190
     * Sets the application flatness.
1191
     *
1192
     * @param flatness
1193
     *            The flatness to set
1194
     */
1195
    public void setFlatness(double flatness);
1196

    
1197
    /**
1198
     * Create a memory spatial index with the default implementation.
1199
     *
1200
     * @return a new SpatialIndex
1201
     */
1202
    public SpatialIndex createDefaultMemorySpatialIndex() throws ServiceException;
1203

    
1204

    
1205
    /**
1206
     * Create a spatial index with the implementation specified as name.
1207
     * If the creation of index don't requery parameters can be passed a null.
1208
     *
1209
     * @param name of the type of spatial index to create
1210
     * @param parameters used to create the index or null.
1211
     * @return the new SpatialIndex or null if not exists the type of index.
1212
     * @throws GeometryException
1213
     */
1214
    public SpatialIndex createSpatialIndex(String name, DynObject parameters) throws ServiceException;
1215

    
1216
    /**
1217
     * Return the name of the factory of the spatial index required.
1218
     *
1219
     * @param name of the spatial index factory
1220
     * @return the SpatialIndexFactory required or null if not exists
1221
     */
1222
    public SpatialIndexFactory getSpatialIndexFactory(String name);
1223

    
1224
    /**
1225
     * Create a GeneralPathX to populate a geometry.
1226
     * This method is deprecated, instead use OrientablePrimitive#addVertex(Point) to add vertex to
1227
     * primitive geometries or {@link MultiPrimitive#addPrimitive(org.gvsig.fmap.geom.primitive.Primitive)} to add geometries to an aggregate.
1228
     *
1229
     * @param rule
1230
     * @param pathIterator , can be null
1231
     * @return a GeneralPathX
1232
     * @deprecated use method of Geometry to handle this
1233
     * @see OrientablePrimitive#addVertex(Point) or {@link MultiPrimitive#addPrimitive(org.gvsig.fmap.geom.primitive.Primitive)}
1234
     *
1235
     */
1236
    public IGeneralPathX createGeneralPath(int rule, PathIterator pathIterator);
1237

    
1238
        /**
1239
         * <p>
1240
         * Create a new curve with a concrete type and sets the value for the
1241
         * coordinates using a GeneralPathX.
1242
         * </p>
1243
         *
1244
         * @param generalPathX
1245
         *            It is used to set the values for the X and Y coordinates.
1246
         * @param subType
1247
         *            SubType of geometry. Must be a value defined in
1248
         *            {@link Geometry.SUBTYPES}
1249
         * @return
1250
         *         A curve
1251
         * @throws CreateGeometryException
1252
         *             This exception is thrown when the manager can not create
1253
         *             the geometry.
1254
         * @deprecated use {@link #createCurve(int)} and OrientablePrimitive#addVertex(Point)
1255
         */
1256
        public Curve createCurve(GeneralPathX generalPathX, int subType)
1257
            throws CreateGeometryException;
1258

    
1259
         /**
1260
     * <p>
1261
     * Create a new multipoint with a concrete type and sets the value for the
1262
     * coordinates using a GeneralPathX.
1263
     * </p>
1264
     *
1265
     * @param generalPathX
1266
     *            It is used to set the values for the X and Y coordinates.
1267
     * @param subType
1268
     *            SubType of geometry. Must be a value defined in
1269
     *            {@link Geometry.SUBTYPES}
1270
     * @return A multipoint
1271
     * @throws CreateGeometryException
1272
     *             This exception is thrown when the manager can not create the
1273
     *             geometry.
1274
     * @deprecated use {@link #createMultiCurve(int)} and {@link MultiPrimitive#addPrimitive(org.gvsig.fmap.geom.primitive.Primitive)}
1275
     */
1276
    public MultiPoint createMultiPoint(GeneralPathX generalPathX, int subType)
1277
            throws CreateGeometryException;
1278
        /**
1279
         * <p>
1280
         * Create a new multicurve with a concrete type and sets the value for the
1281
         * coordinates using a GeneralPathX.
1282
         * </p>
1283
         *
1284
         * @param generalPathX
1285
         *            It is used to set the values for the X and Y coordinates.
1286
         * @param subType
1287
         *            SubType of geometry. Must be a value defined in
1288
         *            {@link Geometry.SUBTYPES}
1289
         * @return A multicurve
1290
         * @throws CreateGeometryException
1291
         *             This exception is thrown when the manager can not create the
1292
         *             geometry.
1293
         * @deprecated use {@link #createMultiCurve(int)} and {@link MultiPrimitive#addPrimitive(org.gvsig.fmap.geom.primitive.Primitive)}
1294
         */
1295
        public MultiCurve createMultiCurve(GeneralPathX generalPathX, int subType)
1296
                throws CreateGeometryException;
1297

    
1298
        /**
1299
         * <p>
1300
         * Create a new surface with a concrete type and sets the value for the
1301
         * coordinates using a GeneralPathX.
1302
         * </p>
1303
         *
1304
         * @param generalPathX
1305
         *            It is used to set the values for the X and Y coordinates.
1306
         * @param subType
1307
         *            SubType of geometry. Must be a value defined in
1308
         *            {@link Geometry.SUBTYPES}
1309
         * @return
1310
         *         A surface
1311
         * @throws CreateGeometryException
1312
         *             This exception is thrown when the manager can not create
1313
         *             the geometry.
1314
         * @deprecated use {@link #createSurface(int)} and OrientablePrimitive#addVertex(Point)
1315
         */
1316
        public Surface createSurface(GeneralPathX generalPathX, int subType)
1317
            throws CreateGeometryException;
1318

    
1319
        /**
1320
         * <p>
1321
         * Create a new multisurface with a concrete type and sets the value for the
1322
         * coordinates using a GeneralPathX.
1323
         * </p>
1324
         *
1325
         * @param generalPathX
1326
         *            It is used to set the values for the X and Y coordinates.
1327
         * @param subType
1328
         *            SubType of geometry. Must be a value defined in
1329
         *            {@link Geometry.SUBTYPES}
1330
         * @return A multisurface
1331
         * @throws CreateGeometryException
1332
         *             This exception is thrown when the manager can not create the
1333
         *             geometry.
1334
         * @deprecated use {@link #createMultiSurface(int)} and {@link MultiPrimitive#addPrimitive(org.gvsig.fmap.geom.primitive.Primitive)}
1335
         */
1336
        public MultiSurface createMultiSurface(GeneralPathX generalPathX,
1337
            int subType) throws CreateGeometryException;
1338
        
1339
    public InformationbuilderWithGeometrySupport createInformacionBuilder();
1340
    
1341
    /**
1342
     * Check if geomTypeChild is a geoemtry type deribed of geomTypeParent
1343
     * 
1344
     * @param geomTypeParent
1345
     * @param geomTypeChild
1346
     * @return 
1347
     */
1348
    public boolean isSubtype(int geomTypeParent, int geomTypeChild);
1349

    
1350
}