Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_geometries / src / org / gvsig / fmap / geom / GeometryManager.java @ 30323

History | View | Annotate | Download (23.3 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.fmap.geom;
42

    
43
import java.util.List;
44

    
45
import org.gvsig.fmap.geom.aggregate.MultiCurve;
46
import org.gvsig.fmap.geom.aggregate.MultiSurface;
47
import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
48
import org.gvsig.fmap.geom.exception.CreateGeometryException;
49
import org.gvsig.fmap.geom.operation.GeometryOperation;
50
import org.gvsig.fmap.geom.operation.GeometryOperationContext;
51
import org.gvsig.fmap.geom.operation.GeometryOperationException;
52
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
53
import org.gvsig.fmap.geom.primitive.Curve;
54
import org.gvsig.fmap.geom.primitive.Envelope;
55
import org.gvsig.fmap.geom.primitive.GeneralPathX;
56
import org.gvsig.fmap.geom.primitive.NullGeometry;
57
import org.gvsig.fmap.geom.primitive.Point;
58
import org.gvsig.fmap.geom.primitive.Surface;
59
import org.gvsig.fmap.geom.type.GeometryType;
60
import org.gvsig.fmap.geom.type.GeometryTypeNotSupportedException;
61
import org.gvsig.fmap.geom.type.GeometryTypeNotValidException;
62

    
63
/**
64
 * This singleton provides a centralized access to gvSIG's Geometry Model.
65
 * Its responsibilities are:<br>
66
 *
67
 * <ul>
68
 * <li>Offering a set of convenient methods for registering and retrieving geometry types.
69
 * <li>Offering a set of convenient methods for registering and retrieving geometry operations associated
70
 * to one or more geometry types.
71
 * <li>Offering a set of convenient methods for registering and retrieving new geometries.
72
 * </ul>
73
 *
74
 * @author jiyarza
75
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
76
 */
77
public interface GeometryManager {
78
        /**
79
         * <p>
80
         * Registers a GeometryOperation associated to a GeometryType.
81
         * Returns an unique index that is used later to identify and invoke the operation.
82
         * </p>
83
         * <p>
84
         * By convention this index should be in a final and static variable in the 
85
         * class that implements the operation. The value of this variable must be set 
86
         * using the method {@link GeometryManager#getGeometryOperationCode(String)}:<BR>        
87
         * <pre>
88
         * public class MyOperation extends GeometryOperation {
89
         *   public static final int CODE =
90
         *     GeometryLocator.getGeometryManager()
91
         *        .getGeometryOperationCode("MyOperation");
92
         * }
93
         * </pre>
94
         * </p>
95
         * @param geomOpName Operation's unique name
96
         * @param geomOp Specific GeometryOperation's instance implementing this operation
97
         * @param geomType GeometryType instance to which this operation should be associated
98
         * @return Index assigned to this operation. This index is used later to access the operation.
99
         *
100
         */
101
        public int registerGeometryOperation(String geomOpName,
102
                        GeometryOperation geomOp, GeometryType geomType);
103

    
104
        /**
105
         * <p>
106
         * Registers a GeometryOperation that is common for all GeometryType (registered yet or not).
107
         * Returns an unique index that is used later to identify and invoke the operation.
108
         * </p>
109
         * <p>
110
         * By convention this index should be in a final and static variable in the 
111
         * class that implements the operation. The value of this variable must be set 
112
         * using the method {@link GeometryManager#getGeometryOperationCode(String)}:<BR>        
113
         * <pre>
114
         * public class MyOperation extends GeometryOperation {
115
         *   public static final int CODE =
116
         *     GeometryLocator.getGeometryManager()
117
         *        .getGeometryOperationCode("MyOperation");
118
         * }
119
         * </pre>
120
         * </p>
121
         * @param geomOpName Operation's unique name
122
         * @param geomOp Specific GeometryOperation's instance implementing this operation
123
         * @return Index assigned to this operation. This index is used later to access the operation.
124
         */
125
        public int registerGeometryOperation(String geomOpName,
126
                        GeometryOperation geomOp);
127

    
128
        /**
129
         * <p>
130
         * Registers a GeometryOperation associated to a GeometryType, that has been specified
131
         * using the type code and the subtype code.
132
         * Returns an unique index that is used later to identify and invoke the operation.
133
         * </p>
134
         * <p>
135
         * By convention this index should be in a final and static variable in the 
136
         * class that implements the operation. The value of this variable must be set 
137
         * using the method {@link GeometryManager#getGeometryOperationCode(String)}:<BR>        
138
         * <pre>
139
         * public class MyOperation extends GeometryOperation {
140
         *   public static final int CODE =
141
         *     GeometryLocator.getGeometryManager()
142
         *        .getGeometryOperationCode("MyOperation");
143
         * }
144
         * </pre>
145
         * </p>
146
         * <p>
147
         * This method is only used if you have not a reference to the GeometryType associated to the
148
         * geometry class. If you have such reference then it is slightly faster to use the method that receives
149
         * the GeometryType.<br>
150
         * </p>
151
         * @param geomOpName Operation's unique name
152
         * @param geomOp Specific GeometryOperation's instance implementing this operation
153
         * @param type
154
         * Type of geometry. Must be a value defined in {@link Geometry.TYPES}
155
         * @param subType
156
         * SubType of geometry. Must be a value defined in {@link Geometry.SUBTYPES}
157
         * @return Index assigned to this operation. This index is used later to access the operation.
158
         * @throws GeometryTypeNotSupportedException
159
         * Returns this exception if there is not a registered geometry with
160
         * these type and subtype
161
         * @throws GeometryTypeNotValidException
162
         * Returns if the type and subtype are not valid
163
         */
164
        public int registerGeometryOperation(String geomOpName,
165
                        GeometryOperation geomOp, int type, int subType) throws GeometryTypeNotSupportedException, GeometryTypeNotValidException;
166

    
167
        /**
168
         * <p>
169
         * Registers a GeometryOperation associated to all the geometries with a concrete type.
170
         * Returns an unique index that is used later to identify and invoke the operation.<br>
171
         * </p>
172
         * <p>
173
         * By convention this index should be in a final and static variable in the 
174
         * class that implements the operation. The value of this variable must be set 
175
         * using the method {@link GeometryManager#getGeometryOperationCode(String)}:<BR>        
176
         * <pre>
177
         * public class MyOperation extends GeometryOperation {
178
         *   public static final int CODE =
179
         *     GeometryLocator.getGeometryManager()
180
         *        .getGeometryOperationCode("MyOperation");
181
         * }
182
         * </pre>
183
         * </p>
184
         * @param geomOpName Operation's unique name
185
         * @param geomOp Specific GeometryOperation's instance implementing this operation
186
         * @param type
187
         * Type of geometry. Must be a value defined in {@link Geometry.TYPES}
188
         * @return Index assigned to this operation. This index is used later to access the operation.
189
         */
190
        public int registerGeometryOperation(String geomOpName,
191
                        GeometryOperation geomOp, int type);
192

    
193

    
194
        /**
195
         * <p>
196
         * Registers a GeometryOperation associated to all the geometries with a concrete subtype.
197
         * Returns an unique index that is used later to identify and invoke the operation.<br>
198
         * </p>
199
         * <p>
200
         * By convention this index should be in a final and static variable in the 
201
         * class that implements the operation. The value of this variable must be set 
202
         * using the method {@link GeometryManager#getGeometryOperationCode(String)}:<BR>        
203
         * <pre>
204
         * public class MyOperation extends GeometryOperation {
205
         *   public static final int CODE =
206
         *     GeometryLocator.getGeometryManager()
207
         *        .getGeometryOperationCode("MyOperation");
208
         * }
209
         * </pre>
210
         * </p>
211
         * @param geomOpName Operation's unique name
212
         * @param geomOp Specific GeometryOperation's instance implementing this operation
213
         * @param subType
214
         * SubType of geometry. Must be a value defined in {@link Geometry.SUBTYPES}
215
         * @return Index assigned to this operation. This index is used later to access the operation.
216
         */
217
        public int registerGeometryOperationBySubtype(String geomOpName,
218
                        GeometryOperation geomOp, int subType);
219

    
220
        /**
221
         * <p>
222
         * Registers a Geometry implementation class with a predefined geometry type and returns the
223
         * associated GeometryType instance. Available predefined types are defined in {@link Geometry.TYPES}
224
         * and the subtypes are defined in {@link Geometry.SUBTYPES}.
225
         * </p>
226
         * <p>
227
         * How to register a geometry class with a predefined type:
228
         * <pre>
229
         *   GeometryType geomType = GeometryLocator.getGeometryManager().
230
         *      registerBasicGeometryType(Point2D.class, "Point2D", Geometry.TYPES.POINT, Geometry.SYBTYPES.GEOM2D);
231
         * </pre>
232
         * </p>
233
         * @param geomClass
234
         *            Geometry subclass. It must not be null and must implement Geometry, otherwise an exception
235
         *            is raised.
236
         * @param name
237
         *                           Symbolic name for the geometry type, it can be null. If it is null then the symbolic name
238
         *                       will be the simple class name.
239
         * @param type
240
         * Type of geometry. Must be a value defined in {@link Geometry.TYPES}
241
         * @param subType
242
         * SubType of geometry. Must be a value defined in {@link Geometry.SUBTYPES}
243
         * @return Instance of GeometryType associated to the Geometry implementation class
244
         *         geomClass
245
         * @throws IllegalArgumentException
246
         *             If geomClass is null or does not implement Geometry
247
         */
248
        public GeometryType registerGeometryType(Class geomClass, String name, int type, int subType);
249

    
250
        /**
251
         * <p>
252
         * Registers a Geometry implementation class with a predefined geometry type and returns the
253
         * associated GeometryType instance. Available predefined types are defined in {@link Geometry.TYPES}
254
         * and the subtypes are defined in {@link Geometry.SUBTYPES}.
255
         * </p>
256
         * <p>
257
         * In this case the symbolic name will be the geometry's simple class name
258
         * </p>
259
         * How to register a new geometry type:
260
         * <pre>
261
         * GeometryType geomType = GeometryLocator.getGeometryManager().
262
         *      registerBasicGeometryType(Point2D.class, Geometry.TYPES.POINT, Geometry.SYBTYPES.GEOM2D);
263
         * </pre>
264
         *
265
         * @param geomClass Geometry implementation class. It must not be null and must implement Geometry,
266
         * otherwise an exception is thrown.
267
         * @param type
268
         * Type of geometry. Must be a value defined in {@link Geometry.TYPES}
269
         * @param subType
270
         * SubType of geometry. Must be a value defined in {@link Geometry.SUBTYPES}
271
         * @return Instance of GeometryType associated to the Geometry implementation class
272
         * @throws IllegalArgumentException
273
         *             If geomClass is null or does not implement Geometry
274
         */
275
        public GeometryType registerGeometryType(Class geomClass, int type, int subType);
276

    
277
        /**
278
         * <p>
279
         * Returns an instance of GeometryType given the Geometry type
280
         * and the subtype.
281
         * </p>
282
         * @param type
283
         * Type of geometry. Must be a value defined in {@link Geometry.TYPES}
284
         * @param subType
285
         * SubType of geometry. Must be a value defined in {@link Geometry.SUBTYPES}
286
         * @return Instance of GeometryType associated to the type and the subtype
287
         * @throws GeometryTypeNotSupportedException
288
         * Returns this exception if there is not a registered geometry with
289
         * these type and subtype
290
         * @throws GeometryTypeNotValidException
291
         * Returns if the type and subtype are not valid
292
         */
293
        public GeometryType getGeometryType(int type, int subType) throws GeometryTypeNotSupportedException, GeometryTypeNotValidException;
294

    
295
        /**
296
         * <p>
297
         * This method creates a {@link Geometry} with the type specified
298
         * by this GeometryType. The geometry is empty, and all the internal
299
         * attributes must be assigned to a value when the geometry has
300
         * been created.
301
         * </p>
302
         * <p>
303
         * This example creates a point2D and sets the coordinates to 1,1:
304
         *
305
         * <pre>
306
         * Point point = (Point)GeometryLocator
307
         *                 .getGeometryManager().create(GEOMETRY.TYPES.POINT, GEOMETRY.SUBTYPES.GEOM2D);
308
         *         point.setX(1);
309
         *         point.setY(1);
310
         * </pre>
311
         * </p>
312
         * @param geomType
313
         * The geometry type
314
         * @return
315
         * A instance of a geometry.
316
         * @throws CreateGeometryException
317
         * This exception is thrown when the manager can not create
318
         * the geometry.
319
         */
320
        public Geometry create(GeometryType geomType) throws CreateGeometryException;
321

    
322
        /**
323
         * <p>
324
         * Creates a Envelope with a concrete subtype. The envelope is empty
325
         * and it have to be filled with the corners once has been created.
326
         * </p>
327
         * @param subType
328
         * SubType of envelope. Must be a value defined in {@link Geometry.SUBTYPES}
329
         * @return
330
         * A Envelope
331
         * @throws CreateEnvelopeException
332
         * If it is not possible to create the envelope.
333
         */
334
        public Envelope createEnvelope(int subType) throws CreateEnvelopeException;
335

    
336
        /**
337
         * <p>
338
         * Creates a Envelope with a concrete subtype. It sets the values
339
         * for the lower corner and the upper corner (in 2D) using the
340
         * method parameters.
341
         * </p>
342
         * @param minX
343
         * The minimum value for the X coordinate.
344
         * @param minY
345
         * The minimum value for the Y coordinate.
346
         * @param maxX
347
         * The maximum value for the X coordinate.
348
         * @param maxY
349
         * The maximum value for the Y coordinate.
350
         * @param subType
351
         * SubType of envelope. Must be a value defined in {@link Geometry.SUBTYPES}
352
         * @return
353
         * @throws CreateEnvelopeException
354
         */
355
        public Envelope createEnvelope(double minX, double minY, double maxX, double maxY, int subType) throws CreateEnvelopeException;
356

    
357
        /**
358
         * <p>
359
         * This method creates a {@link Geometry} with the type specified
360
         * by this name. If a geometry with this name doesn't exist, a
361
         * {@link IllegalArgumentException} is thrown. The geometry is empty,
362
         * and all the internal attributes must be assigned to a value when
363
         * the geometry has  been created.
364
         * </p>
365
         * <p>
366
         * This example creates a point2D and sets the coordinates to 1,1:
367
         * It supposes that there is a Point2D class with name "Point2D".
368
         * </p>
369
         * <pre>
370
         * Point point = (Point)GeometryLocator
371
         *                 .getGeometryManager().create("Point2D");
372
         * point.setX(1);
373
         * point.setY(1);
374
         * </pre>
375
         *
376
         * @param name
377
         * The name of the geometry type
378
         * @return
379
         * A instance of a geometry.
380
         * @throws CreateGeometryException
381
         * This exception is thrown when the manager can not create
382
         * the geometry.
383
         */
384
        public Geometry create(String name) throws CreateGeometryException;
385

    
386
        /**
387
         * <p>
388
         * This method creates a {@link Geometry} with a concrete type and subtype.
389
         * The geometry is empty, and all the internal attributes must be assigned
390
         * to a value when the geometry has  been created.
391
         * </p>
392
         * <p>
393
         * This example creates a point2D and sets the coordinates to 1,1.
394
         * It supposes that there is a Point2D class with the id 1.
395
         * </p>
396
         * <pre>
397
         * Point point = (Point)GeometryLocator
398
         *                 .getGeometryManager().create(Geometry.TYPES.POINT, Geometry.SYBTYPES.GEOM2D);
399
         *         point.setX(1);
400
         *         point.setY(1);
401
         * </pre>
402
         * @param type
403
         * Type of geometry. Must be a value defined in {@link Geometry.TYPES}
404
         * @param subType
405
         * SubType of geometry. Must be a value defined in {@link Geometry.SUBTYPES}
406
         * @return
407
         * A instance of a geometry.
408
         * @throws CreateGeometryException
409
         * This exception is thrown when the manager can not create
410
         * the geometry.
411
         */
412
        public Geometry create(int type, int subType) throws CreateGeometryException;
413

    
414
        /**
415
         * <p>
416
         * It creates a null geometry with a concrete subtype.
417
         * <p>
418
         * @param subType
419
         * SubType of geometry. Must be a value defined in {@link Geometry.SUBTYPES}
420
         * @return
421
         * A NullGeometry
422
         * @throws CreateGeometryException
423
         * This exception is thrown when the manager can not create
424
         * the geometry.
425
         */
426
        public NullGeometry createNullGeometry(int subType) throws CreateGeometryException;
427

    
428
        /**
429
         * <p>
430
         * Create a new point with a concrete type and sets the value
431
         * for the X and the Y.
432
         * </p>
433
         * @param x
434
         * The X coordinate
435
         * @param y
436
         * The y coordinate
437
         * @param subType
438
         * SubType of geometry. Must be a value defined in {@link Geometry.SUBTYPES}
439
         * @throws CreateGeometryException
440
         * This exception is thrown when the manager can not create
441
         * the geometry.
442
         * @return
443
         * The Point
444
         */
445
        public Point createPoint(double x, double y, int subType) throws CreateGeometryException;
446

    
447
        /**
448
         * <p>
449
         * Create a new curve with a concrete type and sets the value
450
         * for the coordinates using a GeneralPathX.
451
         * </p>
452
         * @param generalPathX
453
         * It is used to set the values for the X and Y coordinates.
454
         * @param subType
455
         * SubType of geometry. Must be a value defined in {@link Geometry.SUBTYPES}
456
         * @return
457
         * A curve
458
         * @throws CreateGeometryException
459
         * This exception is thrown when the manager can not create
460
         * the geometry.
461
         */
462
        public Curve createCurve(GeneralPathX generalPathX, int subType) throws CreateGeometryException;
463

    
464

    
465
        /**
466
         * <p>
467
         * Create a new multicurve with a concrete type and sets the value for the
468
         * coordinates using a GeneralPathX.
469
         * </p>
470
         *
471
         * @param generalPathX
472
         *            It is used to set the values for the X and Y coordinates.
473
         * @param subType
474
         *            SubType of geometry. Must be a value defined in
475
         *            {@link Geometry.SUBTYPES}
476
         * @return A multicurve
477
         * @throws CreateGeometryException
478
         *             This exception is thrown when the manager can not create the
479
         *             geometry.
480
         */
481
        public MultiCurve createMultiCurve(GeneralPathX generalPathX, int subType) throws CreateGeometryException;
482

    
483

    
484
        /**
485
         * <p>
486
         * Create a new surface with a concrete type and sets the value
487
         * for the coordinates using a GeneralPathX.
488
         * </p>
489
         * @param generalPathX
490
         * It is used to set the values for the X and Y coordinates.
491
         * @param subType
492
         * SubType of geometry. Must be a value defined in {@link Geometry.SUBTYPES}
493
         * @return
494
         * A surface
495
         * @throws CreateGeometryException
496
         * This exception is thrown when the manager can not create
497
         * the geometry.
498
         */
499
        public Surface createSurface(GeneralPathX generalPathX, int subType) throws CreateGeometryException;
500

    
501
        /**
502
         * <p>
503
         * Create a new multisurface with a concrete type and sets the value for the
504
         * coordinates using a GeneralPathX.
505
         * </p>
506
         * 
507
         * @param generalPathX
508
         *            It is used to set the values for the X and Y coordinates.
509
         * @param subType
510
         *            SubType of geometry. Must be a value defined in
511
         *            {@link Geometry.SUBTYPES}
512
         * @return A multisurface
513
         * @throws CreateGeometryException
514
         *             This exception is thrown when the manager can not create the
515
         *             geometry.
516
         */
517
        public MultiSurface createMultiSurface(GeneralPathX generalPathX, int subType) throws CreateGeometryException;
518

    
519
        /**
520
         * <p>
521
         * Returns an operation given the Geometry type, the Geometry subtype and and the operation
522
         * code. If opCode corresponds to a common operation (a common operation is an operation
523
         * registered for all geometries), then this method returns the common operation.
524
         * </p>
525
         * <p>
526
         * For better performance, if you need to call an operation multiple times,
527
         * use this method only once and keep the returned object in a local variable
528
         * over which you can iterate. For instance:
529
         *
530
         * <pre>
531
         * // Get the operation you need
532
         * GeometryManager gm = GeometryLocator.getGeometryManager()
533
         * GeometryOperation geomOp = null;
534
         * try {
535
         *    geomOp = gm.getGeometryOperation(Draw2D.CODE);
536
         * } catch (GeometryTypeNotSupportedException gtnse) {
537
         *    // treat exception
538
         * } catch (GeometryOperationNotSupportedException gonse) {
539
         *    // treat exception
540
         * }
541
         *
542
         *  // Fill the operation context with required params
543
         * GeometryOperationContext ctx = new GeometryOperationContext();
544
         *
545
         *  // Here is the main loop where you call the operation
546
         * for (int i=0; i<MyGeometries.length; i++) {
547
         *    Object result = geomOp.invoke(myGeometries[i], ctx);
548
         * }
549
         * </pre>
550
         * </p>
551
         * @param opCode
552
         * The operation code
553
         * @param type
554
         * Type of geometry. Must be a value defined in {@link Geometry.TYPES}
555
         * @param subType
556
         * SubType of geometry. Must be a value defined in {@link Geometry.SUBTYPES}
557
         * @return Geometry operation
558
         * @throws GeometryTypeNotSupportedException
559
         * Returns this exception if there is not a registered geometry with
560
         * these type and subtype
561
         * @throws GeometryTypeNotValidException
562
         * Returns this exception if the type and subtype are not valid
563
         * @throws GeometryOperationNotSupportedException
564
         * Returns this exception if there is not a registered operation with
565
         * this operation code
566
         */
567
        public GeometryOperation getGeometryOperation(int opCode, int type, int subType) throws GeometryTypeNotSupportedException, GeometryOperationNotSupportedException, GeometryTypeNotValidException;
568

    
569
        /**
570
         * <p>
571
         * Invokes an operation given its code, the geometry and the operation context holding the
572
         * parameters required for the operation.
573
         * </p>
574
         * @param opCode
575
         * Operation code.
576
         * @param geom
577
         * Geometry to which apply the operation
578
         * @param ctx
579
         * Context holding the operation parameters
580
         * @return
581
         * The object returned by an operation, depends on each operation.
582
         */
583
        public Object invokeOperation(int opCode, Geometry geom, GeometryOperationContext ctx) throws GeometryOperationNotSupportedException, GeometryOperationException;
584

    
585
        /**
586
         * <p>
587
         * Invokes an operation given its code, the geometry and the operation context holding the
588
         * parameters required for the operation.
589
         * </p>
590
         * @param geomOpName
591
         * Operation name.
592
         * @param geom
593
         * Geometry to which apply the operation
594
         * @param ctx
595
         * Context holding the operation parameters
596
         * @return
597
         * The object returned by an operation, depends on each operation.
598
         */
599
        public Object invokeOperation(String geomOpName, Geometry geom, GeometryOperationContext ctx) throws GeometryOperationNotSupportedException, GeometryOperationException;
600
        
601
        /**
602
         * <p>
603
         * Registers the unique name of one operation. If it already exists 
604
         * then this method does nothing but returning the name's corresponding 
605
         * index.
606
         * </p>
607
         * <p>
608
         * By convention this method is used to set the value of the final and static 
609
         * variable that is located in the classes that implements the operation:<BR>        
610
         * <pre>
611
         * public class MyOperation extends GeometryOperation {
612
         *   public static final int CODE =
613
         *     GeometryLocator.getGeometryManager()
614
         *        .getGeometryOperationCode("MyOperation");
615
         * }
616
         * </pre>
617
         * </p>
618
         * @param geomOpName
619
         * Name used to register the geometry operation
620
         * @return
621
         * Index assigned to the operation name passed as parameter
622
         */
623
        public int getGeometryOperationCode(String geomOpName);
624
        
625
        /**
626
         * Returns a list with the name of the operations that have been
627
         * registered.
628
         * @return
629
         * A list of the registered operations.
630
         */
631
        public List getGeometryOperationNames();
632
        
633
        /**
634
         * Returns the flatness used to convert a curve is a set
635
         * of points.
636
         * @return
637
         * The flatness.
638
         */
639
        public double getFlatness();
640
        
641
        /**
642
         * Sets the application flatness.
643
         * @param flatness
644
         * The flatness to set
645
         */
646
        public void setFlatness(double flatness);        
647
}