gvsig-3d / 2.1 / branches / org.gvsig.view3d_vector_and_extrusion_2.3 / org.gvsig.view3d / org.gvsig.view3d / org.gvsig.view3d.lib / org.gvsig.view3d.lib.impl / src / main / java / org / gvsig / view3d / lib / impl / DefaultView3DLibrary.java @ 708
History | View | Annotate | Download (3.63 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright � 2007-2015 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 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 |
* 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 |
|
25 |
package org.gvsig.view3d.lib.impl; |
26 |
|
27 |
import org.gvsig.fmap.dal.DALLibrary; |
28 |
import org.gvsig.tools.ToolsLocator; |
29 |
import org.gvsig.tools.library.AbstractLibrary; |
30 |
import org.gvsig.tools.library.LibraryException; |
31 |
import org.gvsig.tools.persistence.PersistenceManager; |
32 |
import org.gvsig.view3d.lib.api.View3DLibrary; |
33 |
import org.gvsig.view3d.lib.api.View3DLocator; |
34 |
import org.gvsig.view3d.lib.api.View3DManager; |
35 |
import org.gvsig.view3d.lib.impl.layers.loaders.ExtrudedVectorLayerLoaderFactory; |
36 |
import org.gvsig.view3d.lib.impl.layers.loaders.VectorLayerLoaderFactory; |
37 |
import org.gvsig.view3d.lib.impl.layers.persistence.ElevationLayerProperties3DPersistenceFactory; |
38 |
import org.gvsig.view3d.lib.impl.layers.persistence.ExtrudedVectorLayerProperties3DPersistenceFactory; |
39 |
import org.gvsig.view3d.lib.impl.layers.persistence.LayerProperties3DPersistenceFactory; |
40 |
import org.gvsig.view3d.lib.impl.layers.persistence.RasterLayerProperties3DPersistenceFactory; |
41 |
import org.gvsig.view3d.lib.impl.layers.persistence.RasterizedVectorLayerProperties3DPersistenceFactory; |
42 |
import org.gvsig.view3d.lib.impl.layers.persistence.VectorLayerProperties3DPersistenceFactory; |
43 |
|
44 |
/**
|
45 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
|
46 |
* @author Andrea Antonello andrea.antonello@gmail.com
|
47 |
*
|
48 |
*/
|
49 |
public class DefaultView3DLibrary extends AbstractLibrary { |
50 |
|
51 |
@Override
|
52 |
public void doRegistration() { |
53 |
registerAsImplementationOf(View3DLibrary.class); |
54 |
require(DALLibrary.class); |
55 |
} |
56 |
|
57 |
@Override
|
58 |
protected void doInitialize() throws LibraryException { |
59 |
View3DLocator.registerManager(DefaultView3DManger.class); |
60 |
|
61 |
// Register persistence
|
62 |
registerPersistence(); |
63 |
|
64 |
// register default loading modes
|
65 |
View3DManager manager = View3DLocator.getManager(); |
66 |
manager.registerVectorLoaderFactory(new VectorLayerLoaderFactory());
|
67 |
manager.registerVectorLoaderFactory(new ExtrudedVectorLayerLoaderFactory());
|
68 |
} |
69 |
|
70 |
private void registerPersistence() { |
71 |
PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager(); |
72 |
persistenceManager.registerFactory(new LayerProperties3DPersistenceFactory());
|
73 |
|
74 |
persistenceManager.registerFactory(new VectorLayerProperties3DPersistenceFactory());
|
75 |
persistenceManager.registerFactory(new ExtrudedVectorLayerProperties3DPersistenceFactory());
|
76 |
|
77 |
persistenceManager.registerFactory(new RasterLayerProperties3DPersistenceFactory());
|
78 |
persistenceManager.registerFactory(new ElevationLayerProperties3DPersistenceFactory());
|
79 |
persistenceManager.registerFactory(new RasterizedVectorLayerProperties3DPersistenceFactory());
|
80 |
} |
81 |
|
82 |
@Override
|
83 |
protected void doPostInitialize() throws LibraryException { |
84 |
} |
85 |
|
86 |
} |