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 @ 42982

History | View | Annotate | Download (48.4 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

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

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

    
77
    public interface OPERATIONS {
78

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
795
    public Geometry createFrom(String wkt) throws CreateGeometryException,
796
        GeometryException;
797

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

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

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

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

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

    
901
    /**
902
     * @deprecated use createLine
903
     */
904
    public Curve createCurve(int subType) throws CreateGeometryException;
905

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

    
922
    /**
923
     * @deprecated use createPolygon
924
     */
925
    public Surface createSurface(int subType)
926
        throws CreateGeometryException;
927

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

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

    
957
    public MultiLine createMultiLine(int subType) throws CreateGeometryException;
958

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

    
973
    public MultiPolygon createMultiPolygon(int subType) throws CreateGeometryException;
974

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

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

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

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

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

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

    
1164
    /**
1165
     * Returns a list with the name of the operations that have been
1166
     * registered.
1167
     *
1168
     * @return
1169
     *         A list of the registered operations.
1170
     */
1171
    public List getGeometryOperationNames();
1172

    
1173
    /**
1174
     * Returns the flatness used to convert a curve is a set
1175
     * of points.
1176
     *
1177
     * @return
1178
     *         The flatness.
1179
     */
1180
    public double getFlatness();
1181

    
1182
    /**
1183
     * Sets the application flatness.
1184
     *
1185
     * @param flatness
1186
     *            The flatness to set
1187
     */
1188
    public void setFlatness(double flatness);
1189

    
1190
    /**
1191
     * Create a memory spatial index with the default implementation.
1192
     *
1193
     * @return a new SpatialIndex
1194
     */
1195
    public SpatialIndex createDefaultMemorySpatialIndex() throws ServiceException;
1196

    
1197

    
1198
    /**
1199
     * Create a spatial index with the implementation specified as name.
1200
     * If the creation of index don't requery parameters can be passed a null.
1201
     *
1202
     * @param name of the type of spatial index to create
1203
     * @param parameters used to create the index or null.
1204
     * @return the new SpatialIndex or null if not exists the type of index.
1205
     * @throws GeometryException
1206
     */
1207
    public SpatialIndex createSpatialIndex(String name, DynObject parameters) throws ServiceException;
1208

    
1209
    /**
1210
     * Return the name of the factory of the spatial index required.
1211
     *
1212
     * @param name of the spatial index factory
1213
     * @return the SpatialIndexFactory required or null if not exists
1214
     */
1215
    public SpatialIndexFactory getSpatialIndexFactory(String name);
1216

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

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

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

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

    
1312
        /**
1313
         * <p>
1314
         * Create a new multisurface with a concrete type and sets the value for the
1315
         * coordinates using a GeneralPathX.
1316
         * </p>
1317
         *
1318
         * @param generalPathX
1319
         *            It is used to set the values for the X and Y coordinates.
1320
         * @param subType
1321
         *            SubType of geometry. Must be a value defined in
1322
         *            {@link Geometry.SUBTYPES}
1323
         * @return A multisurface
1324
         * @throws CreateGeometryException
1325
         *             This exception is thrown when the manager can not create the
1326
         *             geometry.
1327
         * @deprecated use {@link #createMultiSurface(int)} and {@link MultiPrimitive#addPrimitive(org.gvsig.fmap.geom.primitive.Primitive)}
1328
         */
1329
        public MultiSurface createMultiSurface(GeneralPathX generalPathX,
1330
            int subType) throws CreateGeometryException;
1331

    
1332
}