Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_geometries / src / org / gvsig / fmap / geom / impl / DefaultGeometryLibrary.java @ 30580

History | View | Annotate | Download (5.75 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
*
3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4
* of the Valencian Government (CIT)
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 2
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
*/
22

    
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2009 {Iver T.I.}   {Task}
26
*/
27

    
28
package org.gvsig.fmap.geom.impl;
29

    
30
import org.gvsig.fmap.geom.GeometryLocator;
31
import org.gvsig.fmap.geom.GeometryManager;
32
import org.gvsig.fmap.geom.Geometry.SUBTYPES;
33
import org.gvsig.fmap.geom.Geometry.TYPES;
34
import org.gvsig.fmap.geom.aggregate.impl.BaseMultiPrimitive2D;
35
import org.gvsig.fmap.geom.aggregate.impl.MultiCurve2D;
36
import org.gvsig.fmap.geom.aggregate.impl.MultiCurve2DZ;
37
import org.gvsig.fmap.geom.aggregate.impl.MultiPoint2D;
38
import org.gvsig.fmap.geom.aggregate.impl.MultiPoint2DZ;
39
import org.gvsig.fmap.geom.aggregate.impl.MultiSurface2D;
40
import org.gvsig.fmap.geom.primitive.impl.Arc2D;
41
import org.gvsig.fmap.geom.primitive.impl.Arc2DZ;
42
import org.gvsig.fmap.geom.primitive.impl.Circle2D;
43
import org.gvsig.fmap.geom.primitive.impl.Circle2DZ;
44
import org.gvsig.fmap.geom.primitive.impl.Curve2D;
45
import org.gvsig.fmap.geom.primitive.impl.Curve2DZ;
46
import org.gvsig.fmap.geom.primitive.impl.DefaultNullGeometry;
47
import org.gvsig.fmap.geom.primitive.impl.Ellipse2D;
48
import org.gvsig.fmap.geom.primitive.impl.Ellipse2DZ;
49
import org.gvsig.fmap.geom.primitive.impl.EllipticArc2D;
50
import org.gvsig.fmap.geom.primitive.impl.EllipticArc2DZ;
51
import org.gvsig.fmap.geom.primitive.impl.Point2D;
52
import org.gvsig.fmap.geom.primitive.impl.Point2DZ;
53
import org.gvsig.fmap.geom.primitive.impl.Solid2DZ;
54
import org.gvsig.fmap.geom.primitive.impl.Spline2D;
55
import org.gvsig.fmap.geom.primitive.impl.Spline2DZ;
56
import org.gvsig.fmap.geom.primitive.impl.Surface2D;
57
import org.gvsig.fmap.geom.primitive.impl.Surface2DZ;
58
import org.gvsig.tools.library.LibraryException;
59
import org.gvsig.tools.library.impl.BaseLibrary;
60

    
61
/**
62
 * Registers the default implementation for {@link GeometryManager}
63
 *
64
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
65
 */
66
public class DefaultGeometryLibrary extends BaseLibrary  {
67

    
68
        protected void doInitialize() throws LibraryException {
69
        //Register the default GeometryManager
70
        GeometryLocator.registerGeometryManager(DefaultGeometryManager.class);
71
        }
72

    
73
        protected void doPostInitialize() throws LibraryException {
74
                GeometryManager geometryManager = GeometryLocator.getGeometryManager();
75
                
76
                //Register the geometries in 2D
77
                geometryManager.registerGeometryType(DefaultNullGeometry.class, "Null", TYPES.NULL, SUBTYPES.GEOM2D);
78
                geometryManager.registerGeometryType(Geometry2D.class, "Goemtry2D", TYPES.GEOMETRY, SUBTYPES.GEOM2D);
79
                geometryManager.registerGeometryType(Arc2D.class, "Arc2D", TYPES.ARC, SUBTYPES.GEOM2D);
80
        geometryManager.registerGeometryType(Circle2D.class, "Circle2D", TYPES.CIRCLE, SUBTYPES.GEOM2D);
81
        geometryManager.registerGeometryType(Curve2D.class, "Curve2D", TYPES.CURVE, SUBTYPES.GEOM2D);
82
        geometryManager.registerGeometryType(Ellipse2D.class, "Ellipse2D", TYPES.ELLIPSE, SUBTYPES.GEOM2D);
83
        geometryManager.registerGeometryType(EllipticArc2D.class, "EllipticArc2D", TYPES.ELLIPTICARC, SUBTYPES.GEOM2D);
84
        geometryManager.registerGeometryType(Point2D.class, "Point2D", TYPES.POINT, SUBTYPES.GEOM2D);
85
        geometryManager.registerGeometryType(Spline2D.class, "Spline2D", TYPES.SPLINE, SUBTYPES.GEOM2D);
86
        geometryManager.registerGeometryType(Surface2D.class, "Surface2D", TYPES.SURFACE, SUBTYPES.GEOM2D);
87
        geometryManager.registerGeometryType(BaseMultiPrimitive2D.class, "MultiPrimitive2D", TYPES.AGGREGATE, SUBTYPES.GEOM2D);
88
        geometryManager.registerGeometryType(MultiCurve2D.class, "MultiCurve2D", TYPES.MULTICURVE, SUBTYPES.GEOM2D);
89
        geometryManager.registerGeometryType(MultiCurve2DZ.class, "MultiCurve2DZ", TYPES.MULTICURVE, SUBTYPES.GEOM2DZ);
90
        geometryManager.registerGeometryType(MultiPoint2D.class, "MultiPoint2D", TYPES.MULTIPOINT, SUBTYPES.GEOM2D);
91
        geometryManager.registerGeometryType(MultiSurface2D.class, "MultiSurface", TYPES.MULTISURFACE, SUBTYPES.GEOM2D);
92

    
93
      //Register the geometries in 2DZ
94
                geometryManager.registerGeometryType(DefaultNullGeometry.class, TYPES.NULL, SUBTYPES.GEOM2DZ);
95
        geometryManager.registerGeometryType(Arc2DZ.class, TYPES.ARC, SUBTYPES.GEOM2DZ);
96
        geometryManager.registerGeometryType(Circle2DZ.class, TYPES.CIRCLE, SUBTYPES.GEOM2DZ);
97
        geometryManager.registerGeometryType(Curve2DZ.class, TYPES.CURVE, SUBTYPES.GEOM2DZ);
98
        geometryManager.registerGeometryType(Ellipse2DZ.class, TYPES.ELLIPSE, SUBTYPES.GEOM2DZ);
99
        geometryManager.registerGeometryType(EllipticArc2DZ.class, TYPES.ELLIPTICARC, SUBTYPES.GEOM2DZ);
100
        geometryManager.registerGeometryType(Point2DZ.class, TYPES.POINT, SUBTYPES.GEOM2DZ);
101
        geometryManager.registerGeometryType(Spline2DZ.class, TYPES.SPLINE, SUBTYPES.GEOM2DZ);
102
        geometryManager.registerGeometryType(Surface2DZ.class, TYPES.SURFACE, SUBTYPES.GEOM2DZ);
103
        geometryManager.registerGeometryType(MultiPoint2DZ.class, TYPES.MULTIPOINT, SUBTYPES.GEOM2DZ);
104
        geometryManager.registerGeometryType(Solid2DZ.class, TYPES.SOLID, SUBTYPES.GEOM2DZ);
105
        }
106
}