Revision 617

View differences:

2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.impl/src/main/java/org/gvsig/view3d/lib/impl/DefaultView3DLibrary.java
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.impl.properties.LayerProperties3DPersistenceFactory;
35
import org.gvsig.view3d.lib.impl.properties.RasterLayerProperties3DPersistenceFactory;
36
import org.gvsig.view3d.lib.impl.properties.VectorialLayerProperties3DPersistenceFactory;
37

  
38
/**
39
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
40
 *
41
 */
42
public class DefaultView3DLibrary extends AbstractLibrary {
43

  
44
    @Override
45
    public void doRegistration() {
46
        registerAsImplementationOf(View3DLibrary.class);
47
        require(DALLibrary.class);
48
    }
49

  
50
    @Override
51
    protected void doInitialize() throws LibraryException {
52
        View3DLocator.registerManager(DefaultView3DManger.class);
53
        
54
        // Register persitence
55
        registerPersistence();
56
    }
57

  
58
    private void registerPersistence() {
59
        PersistenceManager persistenceManager =
60
            ToolsLocator.getPersistenceManager();
61
        persistenceManager
62
            .registerFactory(new LayerProperties3DPersistenceFactory());
63
        persistenceManager
64
            .registerFactory(new VectorialLayerProperties3DPersistenceFactory());
65
        persistenceManager
66
            .registerFactory(new RasterLayerProperties3DPersistenceFactory());
67
    }
68

  
69
    @Override
70
    protected void doPostInitialize() throws LibraryException {
71
    }
72

  
73
}
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.impl/src/main/java/org/gvsig/view3d/lib/impl/properties/DefaultRasterLayerProperties3D.java
1
package org.gvsig.view3d.lib.impl.properties;
2

  
3
import org.gvsig.fmap.mapcontext.layers.FLayer;
4
import org.gvsig.view3d.lib.api.properties.RasterLayerProperties3D;
5

  
6
public class DefaultRasterLayerProperties3D extends BasicLayerProperties3D
7
    implements RasterLayerProperties3D {
8
    
9
    public DefaultRasterLayerProperties3D(FLayer theLayer) {
10
        super(theLayer);
11
    }
12
}
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.impl/src/main/java/org/gvsig/view3d/lib/impl/properties/VectorialLayerProperties3DPersistenceFactory.java
1
package org.gvsig.view3d.lib.impl.properties;
2

  
3
import org.gvsig.fmap.mapcontext.layers.FLayer;
4
import org.gvsig.tools.ToolsLocator;
5
import org.gvsig.tools.dynobject.DynStruct;
6
import org.gvsig.tools.persistence.AbstractSinglePersistenceFactory;
7
import org.gvsig.tools.persistence.PersistenceManager;
8
import org.gvsig.tools.persistence.PersistentState;
9
import org.gvsig.tools.persistence.exception.PersistenceException;
10
import org.gvsig.view3d.lib.api.properties.LayerProperties3D;
11
import org.gvsig.view3d.lib.api.properties.VectorialLayerProperties3D;
12

  
13
public class VectorialLayerProperties3DPersistenceFactory extends
14
    AbstractSinglePersistenceFactory {
15

  
16
    private static final String DYNCLASS_NAME = "Vectorial3DProperties";
17
    private static final String DYNCLASS_DESCRIPTION =
18
        "Vectorial layer 3D properties persistence definition";
19

  
20
    protected static final String FIELD_ELEVATION_FIELD = "elevationField";
21
    protected static final String FIELD_RASTERIZED = "rasterized";
22
    
23
    public VectorialLayerProperties3DPersistenceFactory() {
24
        super(VectorialLayerProperties3D.class, DYNCLASS_NAME,
25
            DYNCLASS_DESCRIPTION, null, null);
26

  
27
        DynStruct definition = this.getDefinition();
28

  
29
        PersistenceManager manager = ToolsLocator.getPersistenceManager();
30
        definition.extend(manager.getDefinition(LayerProperties3D.class));
31

  
32
        definition.addDynFieldString(FIELD_ELEVATION_FIELD);
33
        definition.addDynFieldBoolean(FIELD_RASTERIZED);
34
    }
35

  
36
    public Object createFromState(PersistentState state)
37
        throws PersistenceException {
38

  
39
        FLayer layer =
40
            (FLayer) state.get(LayerProperties3DPersistenceFactory.FIELD_LAYER);
41
        VectorialLayerProperties3D properties =
42
            new DefaultVectorialLayerProperties3D(layer);
43

  
44
        properties.setElevation(state
45
            .getBoolean(LayerProperties3DPersistenceFactory.FIELD_ELEVATION));
46
        properties
47
            .setElevationUnits(state
48
                .getString(LayerProperties3DPersistenceFactory.FIELD_ELEVATION_UNITS));
49
        properties
50
            .setLevelZeroResolutionMultiplier(state
51
                .getDouble(LayerProperties3DPersistenceFactory.FIELD_LEVEL_ZERO_RESOLUTION_MULTIPLIER));
52
        properties.setMaxLevel(state
53
            .getInt(LayerProperties3DPersistenceFactory.FIELD_MAXLEVEL));
54
        properties.setMinLevel(state
55
            .getInt(LayerProperties3DPersistenceFactory.FIELD_MINLEVEL));
56
        properties.setNoDataValue(state
57
            .getDouble(LayerProperties3DPersistenceFactory.FIELD_NODATA_VALUE));
58
        properties.setTileHeight(state
59
            .getInt(LayerProperties3DPersistenceFactory.FIELD_TILE_HEIGHT));
60
        properties.setTileWidth(state
61
            .getInt(LayerProperties3DPersistenceFactory.FIELD_TILE_WIDTH));
62
        properties.setElevationField(state.getString(FIELD_ELEVATION_FIELD));
63
        properties.setRasterized(state.getBoolean(FIELD_RASTERIZED));
64

  
65
        return properties;
66
    }
67

  
68
    public void saveToState(PersistentState state, Object obj)
69
        throws PersistenceException {
70

  
71
        VectorialLayerProperties3D properties =
72
            (VectorialLayerProperties3D) obj;
73

  
74
        state.set(LayerProperties3DPersistenceFactory.FIELD_ELEVATION,
75
            properties.getElevation());
76
        state.set(LayerProperties3DPersistenceFactory.FIELD_ELEVATION_UNITS,
77
            properties.getElevationUnits());
78
        state
79
            .set(
80
                LayerProperties3DPersistenceFactory.FIELD_LEVEL_ZERO_RESOLUTION_MULTIPLIER,
81
                properties.getLevelZeroResolutionMultiplier());
82
        state.set(LayerProperties3DPersistenceFactory.FIELD_MAXLEVEL,
83
            properties.getMaxLevel());
84
        state.set(LayerProperties3DPersistenceFactory.FIELD_MINLEVEL,
85
            properties.getMinLevel());
86
        state.set(LayerProperties3DPersistenceFactory.FIELD_NODATA_VALUE,
87
            properties.getNoDataValue());
88
        state.set(LayerProperties3DPersistenceFactory.FIELD_TILE_HEIGHT,
89
            properties.getTileHeight());
90
        state.set(LayerProperties3DPersistenceFactory.FIELD_TILE_WIDTH,
91
            properties.getTileWidth());
92
        state.set(LayerProperties3DPersistenceFactory.FIELD_LAYER,
93
            properties.getLayer());
94
        state.set(FIELD_ELEVATION_FIELD, properties.getElevationField());
95
        state.set(FIELD_RASTERIZED, properties.getRasterized());
96
    }
97

  
98
}
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.impl/src/main/java/org/gvsig/view3d/lib/impl/properties/LayerProperties3DPersistenceFactory.java
1
package org.gvsig.view3d.lib.impl.properties;
2

  
3
import org.gvsig.fmap.mapcontext.layers.FLayer;
4
import org.gvsig.tools.dynobject.DynStruct;
5
import org.gvsig.tools.persistence.AbstractSinglePersistenceFactory;
6
import org.gvsig.tools.persistence.PersistentState;
7
import org.gvsig.tools.persistence.exception.PersistenceException;
8
import org.gvsig.view3d.lib.api.properties.LayerProperties3D;
9

  
10

  
11
public class LayerProperties3DPersistenceFactory extends
12
    AbstractSinglePersistenceFactory {
13
    
14
    private static final String DYNCLASS_NAME = "Layer3DProperties";
15
    private static final String DYNCLASS_DESCRIPTION =
16
        "Basic layer 3D properties persistence definition";
17

  
18
    protected static final String FIELD_ELEVATION = "elevation";
19
    protected static final String FIELD_ELEVATION_UNITS = "elevationUnits";
20
    protected static final String FIELD_LEVEL_ZERO_RESOLUTION_MULTIPLIER = "lezelZeroResolutionMultiPlier";
21
    protected static final String FIELD_MAXLEVEL = "maxLevel";
22
    protected static final String FIELD_MINLEVEL = "minLevel";
23
    protected static final String FIELD_NODATA_VALUE= "noDataValue";
24
    protected static final String FIELD_TILE_HEIGHT = "tileHeight";
25
    protected static final String FIELD_TILE_WIDTH = "tileWidth";
26
    protected static final String FIELD_LAYER = "layer";
27
    
28
    public LayerProperties3DPersistenceFactory() {
29
        super(LayerProperties3D.class, DYNCLASS_NAME, DYNCLASS_DESCRIPTION,
30
            null, null);
31
        
32
        DynStruct definition = this.getDefinition();
33
        definition.addDynFieldBoolean(FIELD_ELEVATION);
34
        definition.addDynFieldString(FIELD_ELEVATION_UNITS);
35
        definition.addDynFieldDouble(FIELD_LEVEL_ZERO_RESOLUTION_MULTIPLIER);
36
        definition.addDynFieldInt(FIELD_MAXLEVEL);
37
        definition.addDynFieldInt(FIELD_MINLEVEL);
38
        definition.addDynFieldDouble(FIELD_NODATA_VALUE);
39
        definition.addDynFieldInt(FIELD_TILE_HEIGHT);
40
        definition.addDynFieldInt(FIELD_TILE_WIDTH);
41
        definition.addDynFieldObject(FIELD_LAYER);
42
    }
43

  
44
    public Object createFromState(PersistentState state)
45
        throws PersistenceException {
46
        
47
        FLayer layer = (FLayer) state.get(FIELD_LAYER);
48
        
49
        LayerProperties3D properties = new DefaultVectorialLayerProperties3D(layer);
50
        
51
        properties.setElevation(state.getBoolean(FIELD_ELEVATION));
52
        properties.setElevationUnits(state.getString(FIELD_ELEVATION_UNITS));
53
        properties.setLevelZeroResolutionMultiplier(state
54
            .getDouble(FIELD_LEVEL_ZERO_RESOLUTION_MULTIPLIER));
55
        properties.setMaxLevel(state.getInt(FIELD_MAXLEVEL));
56
        properties.setMinLevel(state.getInt(FIELD_MINLEVEL));
57
        properties.setNoDataValue(state.getDouble(FIELD_NODATA_VALUE));
58
        properties.setTileHeight(state.getInt(FIELD_TILE_HEIGHT));
59
        properties.setTileWidth(state.getInt(FIELD_TILE_WIDTH));
60
        
61
        return properties;
62
    }
63

  
64
    public void saveToState(PersistentState state, Object obj)
65
        throws PersistenceException {
66
        
67
        LayerProperties3D properties = (LayerProperties3D) obj;
68
        
69
        state.set(FIELD_ELEVATION, properties.getElevation());
70
        state.set(FIELD_ELEVATION_UNITS, properties.getElevationUnits());
71
        state.set(FIELD_LEVEL_ZERO_RESOLUTION_MULTIPLIER,
72
            properties.getLevelZeroResolutionMultiplier());
73
        state.set(FIELD_MAXLEVEL, properties.getMaxLevel());
74
        state.set(FIELD_MINLEVEL, properties.getMinLevel());
75
        state.set(FIELD_NODATA_VALUE, properties.getNoDataValue());
76
        state.set(FIELD_TILE_HEIGHT, properties.getTileHeight());
77
        state.set(FIELD_TILE_WIDTH, properties.getTileWidth());
78
        state.set(FIELD_LAYER, properties.getLayer());
79
    }
80

  
81
}
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.impl/src/main/java/org/gvsig/view3d/lib/impl/properties/DefaultVectorialLayerProperties3D.java
1
package org.gvsig.view3d.lib.impl.properties;
2

  
3
import org.gvsig.fmap.mapcontext.layers.FLayer;
4
import org.gvsig.view3d.lib.api.properties.VectorialLayerProperties3D;
5

  
6
public class DefaultVectorialLayerProperties3D extends BasicLayerProperties3D
7
    implements VectorialLayerProperties3D {
8

  
9
    private boolean rasterized = true;
10
    private String elevationField;
11

  
12
    public DefaultVectorialLayerProperties3D(FLayer theLayer) {
13
        super(theLayer);
14
    }
15

  
16
    public String getElevationField() {
17
        return elevationField;
18
    }
19

  
20
    public boolean getRasterized() {
21
        return this.rasterized;
22
    }
23

  
24
    public void setElevationField(String field) {
25
        this.elevationField = field;
26
        fireDrawValueChangedEvent("elevationField");
27
    }
28

  
29
    public void setRasterized(boolean rasterized) {
30
        this.rasterized = rasterized;
31
        fireDrawValueChangedEvent("rasterized");
32
    }
33
}
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.impl/src/main/java/org/gvsig/view3d/lib/impl/properties/RasterLayerProperties3DPersistenceFactory.java
1
package org.gvsig.view3d.lib.impl.properties;
2

  
3
import org.gvsig.fmap.mapcontext.layers.FLayer;
4
import org.gvsig.tools.ToolsLocator;
5
import org.gvsig.tools.dynobject.DynStruct;
6
import org.gvsig.tools.persistence.AbstractSinglePersistenceFactory;
7
import org.gvsig.tools.persistence.PersistenceManager;
8
import org.gvsig.tools.persistence.PersistentState;
9
import org.gvsig.tools.persistence.exception.PersistenceException;
10
import org.gvsig.view3d.lib.api.properties.LayerProperties3D;
11
import org.gvsig.view3d.lib.api.properties.RasterLayerProperties3D;
12

  
13
public class RasterLayerProperties3DPersistenceFactory extends
14
    AbstractSinglePersistenceFactory {
15

  
16
    private static final String DYNCLASS_NAME = "Raster3DProperties";
17
    private static final String DYNCLASS_DESCRIPTION =
18
        "Raster layer 3D properties persistence definition";
19

  
20
    public RasterLayerProperties3DPersistenceFactory() {
21
        super(RasterLayerProperties3D.class, DYNCLASS_NAME,
22
            DYNCLASS_DESCRIPTION, null, null);
23

  
24
        DynStruct definition = this.getDefinition();
25

  
26
        PersistenceManager manager = ToolsLocator.getPersistenceManager();
27
        definition.extend(manager.getDefinition(LayerProperties3D.class));
28
    }
29

  
30
    public Object createFromState(PersistentState state)
31
        throws PersistenceException {
32

  
33
        FLayer layer =
34
            (FLayer) state.get(LayerProperties3DPersistenceFactory.FIELD_LAYER);
35
        RasterLayerProperties3D properties =
36
            new DefaultRasterLayerProperties3D(layer);
37

  
38
        properties.setElevation(state
39
            .getBoolean(LayerProperties3DPersistenceFactory.FIELD_ELEVATION));
40
        properties
41
            .setElevationUnits(state
42
                .getString(LayerProperties3DPersistenceFactory.FIELD_ELEVATION_UNITS));
43
        properties
44
            .setLevelZeroResolutionMultiplier(state
45
                .getDouble(LayerProperties3DPersistenceFactory.FIELD_LEVEL_ZERO_RESOLUTION_MULTIPLIER));
46
        properties.setMaxLevel(state
47
            .getInt(LayerProperties3DPersistenceFactory.FIELD_MAXLEVEL));
48
        properties.setMinLevel(state
49
            .getInt(LayerProperties3DPersistenceFactory.FIELD_MINLEVEL));
50
        properties.setNoDataValue(state
51
            .getDouble(LayerProperties3DPersistenceFactory.FIELD_NODATA_VALUE));
52
        properties.setTileHeight(state
53
            .getInt(LayerProperties3DPersistenceFactory.FIELD_TILE_HEIGHT));
54
        properties.setTileWidth(state
55
            .getInt(LayerProperties3DPersistenceFactory.FIELD_TILE_WIDTH));
56

  
57
        return properties;
58
    }
59

  
60
    public void saveToState(PersistentState state, Object obj)
61
        throws PersistenceException {
62

  
63
        RasterLayerProperties3D properties = (RasterLayerProperties3D) obj;
64

  
65
        state.set(LayerProperties3DPersistenceFactory.FIELD_ELEVATION,
66
            properties.getElevation());
67
        state.set(LayerProperties3DPersistenceFactory.FIELD_ELEVATION_UNITS,
68
            properties.getElevationUnits());
69
        state
70
            .set(
71
                LayerProperties3DPersistenceFactory.FIELD_LEVEL_ZERO_RESOLUTION_MULTIPLIER,
72
                properties.getLevelZeroResolutionMultiplier());
73
        state.set(LayerProperties3DPersistenceFactory.FIELD_MAXLEVEL,
74
            properties.getMaxLevel());
75
        state.set(LayerProperties3DPersistenceFactory.FIELD_MINLEVEL,
76
            properties.getMinLevel());
77
        state.set(LayerProperties3DPersistenceFactory.FIELD_NODATA_VALUE,
78
            properties.getNoDataValue());
79
        state.set(LayerProperties3DPersistenceFactory.FIELD_TILE_HEIGHT,
80
            properties.getTileHeight());
81
        state.set(LayerProperties3DPersistenceFactory.FIELD_TILE_WIDTH,
82
            properties.getTileWidth());
83
        state.set(LayerProperties3DPersistenceFactory.FIELD_LAYER,
84
            properties.getLayer());
85
    }
86

  
87
}
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.impl/src/main/java/org/gvsig/view3d/lib/impl/properties/BasicLayerProperties3D.java
1
package org.gvsig.view3d.lib.impl.properties;
2

  
3
import org.gvsig.fmap.mapcontext.layers.FLayer;
4
import org.gvsig.fmap.mapcontext.layers.FLyrDefault;
5
import org.gvsig.fmap.mapcontext.layers.LayerEvent;
6
import org.gvsig.fmap.mapcontext.layers.LayerListener;
7
import org.gvsig.view3d.lib.api.properties.LayerProperties3D;
8

  
9

  
10
public class BasicLayerProperties3D implements LayerProperties3D {
11
    
12
    private boolean elevation = false;
13
    private String elevationUnits;
14
    private double levelZeroResolutionMultiplier = 1;
15
    private int maxLevel = 0;
16
    private int minLevel = 0;
17
    private double noDataValue = -99999;
18
    private int tileWidth = 512;
19
    private int tileHeight = 512;
20
    private FLayer layer;
21
    
22
    public BasicLayerProperties3D(FLayer layer) {
23
        this.layer = layer;
24
    }
25

  
26
    public boolean getElevation() {
27
        return elevation;
28
    }
29

  
30
    public String getElevationUnits() {
31
        return elevationUnits;
32
    }
33

  
34
    public double getLevelZeroResolutionMultiplier() {
35
        return levelZeroResolutionMultiplier;
36
    }
37

  
38
    public int getMaxLevel() {
39
        return maxLevel;
40
    }
41

  
42
    public int getMinLevel() {
43
        return minLevel;
44
    }
45

  
46
    public double getNoDataValue() {
47
        return noDataValue;
48
    }
49

  
50
    public int getTileHeight() {
51
        return tileHeight;
52
    }
53

  
54
    public int getTileWidth() {
55
        return tileWidth;
56
    }
57

  
58
    public void setElevation(boolean elevation) {
59
        this.elevation = elevation;
60
        fireDrawValueChangedEvent("elevation");
61
    }
62

  
63
    public void setElevationUnits(String elevation) {
64
        this.elevationUnits = elevation;
65
        fireDrawValueChangedEvent("elevationUnits");
66
    }
67

  
68
    public void setLevelZeroResolutionMultiplier(double multiplier) {
69
        this.levelZeroResolutionMultiplier = multiplier;
70
        fireDrawValueChangedEvent("lezelZeroResolutionMultiPlier");
71
    }
72

  
73
    public void setMaxLevel(int maxLevel) {
74
        this.maxLevel = maxLevel;
75
        fireDrawValueChangedEvent("maxLevel");
76
    }
77

  
78
    public void setMinLevel(int minLevel) {
79
        this.minLevel = minLevel;
80
        fireDrawValueChangedEvent("minLevel");
81
    }
82

  
83
    public void setNoDataValue(double noDataValue) {
84
        this.noDataValue = noDataValue;
85
        fireDrawValueChangedEvent("noDataValue");
86

  
87
    }
88

  
89
    public void setTileHeight(int height) {
90
        this.tileHeight = height;
91
        fireDrawValueChangedEvent("tileHeight");
92

  
93
    }
94

  
95
    public void setTileWidth(int width) {
96
        this.tileWidth = width;
97
        fireDrawValueChangedEvent("tileWidth");
98
    }
99
    
100
    protected void fireDrawValueChangedEvent(String property) {
101
        LayerListener[] layerListeners = this.layer.getLayerListeners();
102
        for (int i = 0; i < layerListeners.length; i++) {
103
            layerListeners[i].drawValueChanged(LayerEvent
104
                .createDrawValuesChangedEvent((FLyrDefault) this.layer,
105
                    property));
106
        }
107
    }
108

  
109
    public FLayer getLayer() {
110
        return this.layer;
111
    }
112

  
113
    public void setLayer(FLayer theLayer) {
114
        this.layer = theLayer;
115
    }
116
}
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.impl/src/main/java/org/gvsig/view3d/lib/impl/DefaultView3DManger.java
1
/**
2
 *
3
 * Copyright ? 2007-2015 gvSIG Association
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., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23

  
24
package org.gvsig.view3d.lib.impl;
25

  
26
import org.gvsig.fmap.mapcontext.layers.FLayer;
27
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
28
import org.gvsig.view3d.lib.api.View3DManager;
29
import org.gvsig.view3d.lib.api.properties.LayerProperties3D;
30
import org.gvsig.view3d.lib.impl.properties.DefaultRasterLayerProperties3D;
31
import org.gvsig.view3d.lib.impl.properties.DefaultVectorialLayerProperties3D;
32

  
33

  
34
/**
35
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
36
 *
37
 */
38
public class DefaultView3DManger implements View3DManager {
39
    
40
    public LayerProperties3D getLayerProperties(FLayer layer) {
41
        Object properties = layer.getProperty("properties3D");
42
        if(properties == null){
43
            LayerProperties3D layerProperties;
44
            if(layer instanceof FLyrVect){
45
                layerProperties =
46
                    new DefaultVectorialLayerProperties3D(layer);
47
            } else {
48
                layerProperties = new DefaultRasterLayerProperties3D(layer);
49
            }
50
            setLayerProperties(layer, layerProperties);
51
            return layerProperties;
52
        }
53
        return (LayerProperties3D) properties;
54
    }
55

  
56
    public void setLayerProperties(FLayer layer, LayerProperties3D properties) {
57
        layer.setProperty("properties3D", properties);
58
    }
59
}
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.view3d.lib.impl.DefaultView3DLibrary
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.impl/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2
  <modelVersion>4.0.0</modelVersion>
3
  <parent>
4
    <groupId>org.gvsig</groupId>
5
    <artifactId>org.gvsig.view3d.lib</artifactId>
6
    <version>1.0.12</version>
7
  </parent>
8
  <artifactId>org.gvsig.view3d.lib.impl</artifactId>
9
  <name>org.gvsig.view3d.lib.impl</name>
10
  
11
  <dependencies>
12
    <dependency>
13
        <groupId>org.gvsig</groupId>
14
        <artifactId>org.gvsig.view3d.lib.api</artifactId>
15
    </dependency>
16
  </dependencies>
17
</project>
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2
  <modelVersion>4.0.0</modelVersion>
3
  <parent>
4
    <groupId>org.gvsig</groupId>
5
    <artifactId>org.gvsig.view3d</artifactId>
6
    <version>1.0.12</version>
7
  </parent>
8
  <artifactId>org.gvsig.view3d.lib</artifactId>
9
  <packaging>pom</packaging>
10
  <name>org.gvsig.view3d.lib</name>
11
  <modules>
12
  	<module>org.gvsig.view3d.lib.api</module>
13
  	<module>org.gvsig.view3d.lib.impl</module>
14
  </modules>
15
</project>
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.api/src/main/java/org/gvsig/view3d/lib/api/View3DLocator.java
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.api;
26

  
27
import org.gvsig.tools.locator.BaseLocator;
28
import org.gvsig.tools.locator.LocatorException;
29

  
30

  
31
/**
32
 * This locator is the entry point for the View 3D library, providing
33
 * access to View3D services through the {@link View3DManager} .
34
 *
35
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
36
 * @version $Id$
37
 */
38
public class View3DLocator extends BaseLocator {
39

  
40
    private static final String LOCATOR_NAME = "View3DLocator";
41

  
42
    public static final String MANAGER_NAME = "View3D.Manager";
43

  
44
    private static final String MANAGER_DESCRIPTION = "View 3D Manager";
45

  
46
    private static final View3DLocator instance = new View3DLocator();
47

  
48
    /**
49
     * Return the singleton instance.
50
     * 
51
     * @return the singleton instance
52
     */
53
    public static View3DLocator getInstance() {
54
        return instance;
55
    }
56

  
57
    public String getLocatorName() {
58
        return LOCATOR_NAME;
59
    }
60

  
61
    /**
62
     * Return a reference to View3DManager.
63
     * 
64
     * @return a reference to View3DManager
65
     * @throws LocatorException
66
     *             if there is no access to the class or the class
67
     *             cannot be instantiated
68
     * @see Locator#get(String)View3DManager
69
     */
70
    public static View3DManager getManager() throws LocatorException {
71
        return (View3DManager) getInstance().get(MANAGER_NAME);
72
    }
73

  
74
    /**
75
     * Registers the Class implementing the View3DLocator interface.
76
     * 
77
     * @param clazz
78
     *            implementing the View3DManager interface
79
     */
80
    public static void registerManager(Class clazz) {
81
        getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
82
    }
83

  
84
    public static void registerDefaultManager(Class clazz) {
85
        getInstance().registerDefault(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
86
    }
87
}
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.api/src/main/java/org/gvsig/view3d/lib/api/View3DLibrary.java
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.api;
26

  
27
import org.gvsig.fmap.dal.DALLibrary;
28
import org.gvsig.tools.library.AbstractLibrary;
29
import org.gvsig.tools.library.LibraryException;
30
import org.gvsig.tools.locator.ReferenceNotRegisteredException;
31

  
32

  
33
/**
34
 * Library for API initialization and configuration.
35
 * 
36
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
37
 */
38
public class View3DLibrary extends AbstractLibrary {
39
    
40
    @Override
41
    public void doRegistration() {
42
        registerAsAPI(View3DLibrary.class);
43
        require(DALLibrary.class);
44
    }
45

  
46
    @Override
47
    protected void doInitialize() throws LibraryException {
48
    }
49

  
50
    @Override
51
    protected void doPostInitialize() throws LibraryException {
52
        View3DManager manager = View3DLocator.getManager();
53
        if (manager == null) {
54
            throw new ReferenceNotRegisteredException(
55
                View3DLocator.MANAGER_NAME, View3DLocator.getInstance());
56
        }
57

  
58
    }
59

  
60
}
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.api/src/main/java/org/gvsig/view3d/lib/api/View3DManager.java
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.api;
26

  
27
import org.gvsig.fmap.mapcontext.layers.FLayer;
28
import org.gvsig.view3d.lib.api.properties.LayerProperties3D;
29

  
30
/**
31
 * This class is responsible of the management of the application logic.
32
 * It is the library's main entry point, and provides all the
33
 * services to manage logic components.
34
 * 
35
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
36
 */
37
public interface View3DManager {
38

  
39
    /**
40
     * Gets 3D properties of the layer
41
     * 
42
     * @param layer
43
     * @return
44
     */
45
    public LayerProperties3D getLayerProperties(FLayer layer);
46

  
47
    /**
48
     * Sets 3D properties to the layer
49
     * 
50
     * @param layer
51
     * @param properties
52
     */
53
    public void setLayerProperties(FLayer layer, LayerProperties3D properties);
54
}
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.api/src/main/java/org/gvsig/view3d/lib/api/properties/VectorialLayerProperties3D.java
1
package org.gvsig.view3d.lib.api.properties;
2

  
3
/**
4
 * This class defines the layer 3D vectorial properties.
5
 * 
6
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
7
 *
8
 */
9
public interface VectorialLayerProperties3D extends LayerProperties3D {
10
    
11
    /**
12
     * Gets elevation field that defines elevation values.
13
     * 
14
     * @return
15
     */
16
    public String getElevationField();
17
    
18
    /**
19
     * Gets if layer will be loaded as vectorial rasterized.
20
     * 
21
     * @return
22
     */
23
    public boolean getRasterized();
24
    
25
    /**
26
     * Sets field elevation that defines elevation values.
27
     * 
28
     * @param field
29
     */
30
    public void setElevationField(String field);
31
    
32
    /**
33
     * Sets if layer will be loaded as vectorial rasterized.
34
     * 
35
     * @param rasterized
36
     */
37
    public void setRasterized(boolean rasterized);
38
    
39
}
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.api/src/main/java/org/gvsig/view3d/lib/api/properties/LayerProperties3D.java
1
package org.gvsig.view3d.lib.api.properties;
2

  
3
import org.gvsig.fmap.mapcontext.layers.FLayer;
4

  
5
/**
6
 * This class defines the layer 3D properties. 
7
 * 
8
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
9
 *
10
 */
11
public interface LayerProperties3D{
12
    
13
    /**
14
     * Gets if layer will be loaded as elevation.  
15
     * 
16
     * @return
17
     */
18
    public boolean getElevation();
19
    
20
    /**
21
     * Gets the units of elevation values.
22
     * 
23
     * @return
24
     */
25
    public String getElevationUnits();
26
    
27
    /**
28
     * Gets layer of this 3D properties.
29
     * 
30
     * @return
31
     */
32
    public FLayer getLayer();
33
    
34
    /**
35
     * Gets the level zero resolution multiplier. The level zero resolution
36
     * multiplier indicates the relationship between resolution showed at zero
37
     * level.
38
     * 
39
     * @return
40
     */
41
    public double getLevelZeroResolutionMultiplier();
42
    
43
    /**
44
     * Gets the maximum level of deatil showed.
45
     * 
46
     * @return
47
     */
48
    public int getMaxLevel();
49
    
50
    /**
51
     * Gets the minimum level of detail showed. 
52
     * 
53
     * @return
54
     */
55
    public int getMinLevel();
56
    
57
    /**
58
     * Gets NoData value.
59
     * 
60
     * @return
61
     */
62
    public double getNoDataValue();
63
    
64
    /**
65
     * Gets height of tile.
66
     * 
67
     * @return
68
     */
69
    public int getTileHeight();
70
    
71
    /**
72
     * Gets width of tile.
73
     *  
74
     * @return
75
     */
76
    public int getTileWidth();
77
    
78
    /**
79
     * Sets the elevation mode.
80
     * 
81
     * @param elevation
82
     */
83
    public void setElevation(boolean elevation);
84
    
85
    /**
86
     * Sets the units of elevation values.
87
     * 
88
     * @param units
89
     */
90
    public void setElevationUnits(String units);
91
    
92
    /**
93
     * Sets layer of this 3D properties. 
94
     * 
95
     * @param layer
96
     */
97
    public void setLayer(FLayer layer);
98
    
99
    /**
100
     * Sets level zero resolution multiplier.
101
     * 
102
     * @param multiplier
103
     * @see LayerProperties3D#getLevelZeroResolutionMultiplier()
104
     */
105
    public void setLevelZeroResolutionMultiplier(double multiplier);
106
    
107
    /**
108
     * Set maximum level of detail showed.
109
     * 
110
     * @param maxLevel
111
     */
112
    public void setMaxLevel(int maxLevel);
113
    
114
    /**
115
     * Set minimum level of detail showed.
116
     * 
117
     * @param minLevel
118
     */
119
    public void setMinLevel(int minLevel);
120
    
121
    /**
122
     * Set NoData value.
123
     * 
124
     * @param noDataValue
125
     */
126
    public void setNoDataValue(double noDataValue);
127
    
128
    /**
129
     * Sets height of tile
130
     * 
131
     * @param height
132
     */
133
    public void setTileHeight(int height);
134
    
135
    /**
136
     * Sets width of tile
137
     * 
138
     * @param width
139
     */
140
    public void setTileWidth(int width);
141
}
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.api/src/main/java/org/gvsig/view3d/lib/api/properties/RasterLayerProperties3D.java
1
package org.gvsig.view3d.lib.api.properties;
2

  
3
/**
4
 * This class defines the layer 3D raster properties.
5
 * 
6
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
7
 *
8
 */
9
public interface RasterLayerProperties3D extends LayerProperties3D {
10
    
11
}
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.view3d.lib.api.View3DLibrary
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.lib/org.gvsig.view3d.lib.api/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2
  <modelVersion>4.0.0</modelVersion>
3
  <parent>
4
    <groupId>org.gvsig</groupId>
5
    <artifactId>org.gvsig.view3d.lib</artifactId>
6
    <version>1.0.12</version>
7
  </parent>
8
  <artifactId>org.gvsig.view3d.lib.api</artifactId>
9
  <name>org.gvsig.view3d.lib.api</name>
10
  <dependencies>
11
  	<dependency>
12
        <groupId>org.gvsig</groupId>
13
        <artifactId>org.gvsig.tools.lib</artifactId>
14
    </dependency>
15
    <dependency>
16
        <groupId>org.gvsig</groupId>
17
        <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
18
    </dependency>
19
  </dependencies>
20
</project>
2.1/tags/org.gvsig.view3d-1.0.12/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2
	<modelVersion>4.0.0</modelVersion>
3
	<groupId>org.gvsig</groupId>
4
	<artifactId>org.gvsig.view3d</artifactId>
5
	<version>1.0.12</version>
6
	<packaging>pom</packaging>
7
	<name>org.gvsig.view3d</name>
8
	<parent>
9
		<groupId>org.gvsig</groupId>
10
		<artifactId>org.gvsig.desktop</artifactId>
11
		<version>2.0.129</version>
12
	</parent>
13
	<url>https://devel.gvsig.org/sites/org.gvsig.view3d/${project.version}</url>
14
	<scm>
15
		<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-3d/2.1/tags/org.gvsig.view3d-1.0.12</connection>
16
		<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-3d/2.1/tags/org.gvsig.view3d-1.0.12</developerConnection>
17
		<url>https://redmine.gvsig.net/redmine/projects/gvsig-3d/repository/show/2.1/tags/org.gvsig.view3d-1.0.12</url>
18
	</scm>
19
	<repositories>
20
		<repository>
21
			<id>gvsig-public-http-repository</id>
22
			<name>gvSIG maven public HTTP repository</name>
23
			<url>http://devel.gvsig.org/m2repo/j2se</url>
24
			<releases>
25
				<enabled>true</enabled>
26
				<updatePolicy>daily</updatePolicy>
27
				<checksumPolicy>warn</checksumPolicy>
28
			</releases>
29
			<snapshots>
30
				<enabled>true</enabled>
31
				<updatePolicy>daily</updatePolicy>
32
				<checksumPolicy>warn</checksumPolicy>
33
			</snapshots>
34
		</repository>
35
	</repositories>
36
	<distributionManagement>
37
		<site>
38
			<id>gvsig-repository</id>
39
			<url>dav:https://devel.gvsig.org/sites/org.gvsig.view3d/${project.version}</url>
40
		</site>
41
	</distributionManagement>
42
	<build>
43
		<plugins>
44
			<plugin>
45
				<groupId>org.apache.maven.plugins</groupId>
46
				<artifactId>maven-release-plugin</artifactId>
47
				<configuration>
48
					<tagBase>https://devel.gvsig.org/svn/gvsig-3d/2.1/tags</tagBase>
49
					<goal>deploy</goal>
50
				</configuration>
51
			</plugin>
52
		</plugins>
53
	</build>
54
	<modules>
55
		<module>org.gvsig.view3d.app</module>
56
		<module>org.gvsig.view3d.swing</module>
57
		<module>org.gvsig.view3d.main</module>
58
		<module>org.gvsig.view3d.lib</module>
59
	</modules>
60
	<dependencyManagement>
61
		<dependencies>
62
			<dependency>
63
				<groupId>org.gvsig</groupId>
64
				<artifactId>org.gvsig.view3d.app.common</artifactId>
65
				<version>1.0.12</version>
66
			</dependency>
67
			<dependency>
68
				<groupId>org.gvsig</groupId>
69
				<artifactId>org.gvsig.view3d.swing.api</artifactId>
70
				<version>1.0.12</version>
71
			</dependency>
72
			<dependency>
73
				<groupId>org.gvsig</groupId>
74
				<artifactId>org.gvsig.view3d.swing.impl</artifactId>
75
				<version>1.0.12</version>
76
			</dependency>
77
			<dependency>
78
                <groupId>org.gvsig</groupId>
79
                <artifactId>org.gvsig.view3d.lib.api</artifactId>
80
                <version>1.0.12</version>
81
            </dependency>
82
            <dependency>
83
                <groupId>org.gvsig</groupId>
84
                <artifactId>org.gvsig.view3d.lib.impl</artifactId>
85
                <version>1.0.12</version>
86
            </dependency>
87
			<dependency>
88
				<groupId>org.gvsig</groupId>
89
				<artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
90
				<version>2.0.85</version>
91
			</dependency>
92
			<dependency>
93
				<groupId>org.gvsig</groupId>
94
				<artifactId>org.gvsig.fmap.mapcontext.impl</artifactId>
95
				<version>2.0.85</version>
96
				<scope>runtime</scope>
97
			</dependency>
98
			<dependency>
99
				<groupId>org.gvsig</groupId>
100
				<artifactId>org.gvsig.raster.gdal.io</artifactId>
101
				<version>2.2.7</version>
102
			</dependency>
103
			<dependency>
104
				<groupId>org.gvsig</groupId>
105
				<artifactId>org.gvsig.raster.lib.api</artifactId>
106
				<version>2.2.10</version>
107
			</dependency>
108
			<dependency>
109
				<groupId>org.gvsig</groupId>
110
				<artifactId>org.gvsig.raster.lib.impl</artifactId>
111
				<version>2.2.10</version>
112
			</dependency>
113
			<dependency>
114
				<groupId>org.gvsig</groupId>
115
				<artifactId>org.gvsig.raster.swing.api</artifactId>
116
				<version>2.2.6</version>
117
			</dependency>
118
			<dependency>
119
				<groupId>org.gvsig</groupId>
120
				<artifactId>org.gvsig.raster.swing.impl</artifactId>
121
				<version>2.2.6</version>
122
				<scope>runtime</scope>
123
			</dependency>
124
			<dependency>
125
				<groupId>org.gvsig</groupId>
126
				<artifactId>org.gvsig.raster.fmap</artifactId>
127
				<version>2.2.6</version>
128
			</dependency>
129
			<dependency>
130
				<groupId>org.gvsig</groupId>
131
				<artifactId>org.gvsig.gpe.app.mainplugin</artifactId>
132
				<version>2.1.4</version>
133
				<scope>runtime</scope>
134
			</dependency>
135
			<dependency>
136
				<groupId>org.gvsig</groupId>
137
				<artifactId>org.gvsig.gpe.exportto.generic</artifactId>
138
				<version>2.1.4</version>
139
				<scope>runtime</scope>
140
			</dependency>
141
			<dependency>
142
				<groupId>org.gvsig</groupId>
143
				<artifactId>org.gvsig.gpe.exportto.kml</artifactId>
144
				<version>2.1.4</version>
145
				<scope>runtime</scope>
146
			</dependency>
147
			<dependency>
148
				<groupId>org.gvsig</groupId>
149
				<artifactId>org.gvsig.gpe.lib.api</artifactId>
150
				<version>2.1.4</version>
151
			</dependency>
152
			<dependency>
153
				<groupId>org.gvsig</groupId>
154
				<artifactId>org.gvsig.gpe.lib.impl</artifactId>
155
				<version>2.1.4</version>
156
				<scope>runtime</scope>
157
			</dependency>
158
			<dependency>
159
				<groupId>org.gvsig</groupId>
160
				<artifactId>org.gvsig.gpe.prov.gml</artifactId>
161
				<version>2.1.4</version>
162
				<scope>runtime</scope>
163
			</dependency>
164
			<dependency>
165
				<groupId>org.gvsig</groupId>
166
				<artifactId>org.gvsig.gpe.prov.kml</artifactId>
167
				<version>2.1.4</version>
168
				<scope>runtime</scope>
169
			</dependency>
170
			<dependency>
171
				<groupId>org.gvsig</groupId>
172
				<artifactId>org.gvsig.gpe.prov.xml</artifactId>
173
				<version>2.1.4</version>
174
				<scope>runtime</scope>
175
			</dependency>
176
			<dependency>
177
				<groupId>gov.nasa</groupId>
178
				<artifactId>worldwind</artifactId>
179
				<version>2.0.0</version>
180
			</dependency>
181
			<dependency>
182
				<groupId>org.jogamp.jogl</groupId>
183
				<artifactId>jogl-all</artifactId>
184
				<version>2.2.1</version>
185
			</dependency>
186
			<dependency>
187
				<groupId>org.jogamp.gluegen</groupId>
188
				<artifactId>gluegen-rt</artifactId>
189
				<version>2.2.1</version>
190
			</dependency>
191
		</dependencies>
192
	</dependencyManagement>
193
</project>
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.swing/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2
  <modelVersion>4.0.0</modelVersion>
3
  <parent>
4
    <groupId>org.gvsig</groupId>
5
    <artifactId>org.gvsig.view3d</artifactId>
6
    <version>1.0.12</version>
7
  </parent>
8
  <artifactId>org.gvsig.view3d.swing</artifactId>
9
  <packaging>pom</packaging>
10
  <name>org.gvsig.view3d.swing</name>
11
  <modules>
12
  	<module>org.gvsig.view3d.swing.api</module>
13
  	<module>org.gvsig.view3d.swing.impl</module>
14
  </modules>
15
</project>
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2
	<modelVersion>4.0.0</modelVersion>
3
	<parent>
4
		<groupId>org.gvsig</groupId>
5
		<artifactId>org.gvsig.view3d.swing</artifactId>
6
		<version>1.0.12</version>
7
	</parent>
8
	<artifactId>org.gvsig.view3d.swing.impl</artifactId>
9
	<name>org.gvsig.view3d.swing.impl</name>
10
	<dependencies>
11
		<dependency>
12
			<groupId>org.gvsig</groupId>
13
			<artifactId>org.gvsig.view3d.swing.api</artifactId>
14
		</dependency>
15
		<dependency>
16
			<groupId>org.gvsig</groupId>
17
			<artifactId>org.gvsig.tools.swing.api</artifactId>
18
		</dependency>
19
    <dependency>
20
      <groupId>org.gvsig</groupId>
21
      <artifactId>org.gvsig.ui</artifactId>
22
    </dependency>
23
		<dependency>
24
			<groupId>org.gvsig</groupId>
25
			<artifactId>org.gvsig.tools.swing.impl</artifactId>
26
			<scope>runtime</scope>
27
		</dependency>
28
		<dependency>
29
		  <groupId>org.gvsig</groupId>
30
		  <artifactId>org.gvsig.view3d.lib.api</artifactId>
31
		</dependency>
32
    <dependency>
33
      <groupId>org.gvsig</groupId>
34
      <artifactId>org.gvsig.raster.fmap</artifactId>
35
    </dependency>
36
	</dependencies>
37
</project>
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/DefaultView3DSwingLibrary.java
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.swing.impl;
26

  
27
import org.gvsig.fmap.dal.DALLibrary;
28
import org.gvsig.tools.library.AbstractLibrary;
29
import org.gvsig.tools.library.LibraryException;
30
import org.gvsig.view3d.swing.api.View3DSwingLibrary;
31
import org.gvsig.view3d.swing.api.View3DSwingLocator;
32
import org.gvsig.view3d.swing.impl.properties.DefaultMapControlProperties3D;
33

  
34
/**
35
 * Default implementation of {@link View3DSwingLibrary}.
36
 * 
37
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
38
 */
39
public class DefaultView3DSwingLibrary extends AbstractLibrary {
40

  
41
    @Override
42
    public void doRegistration() {
43
        registerAsImplementationOf(View3DSwingLibrary.class);
44
        require(DALLibrary.class);
45
    }
46

  
47
    @Override
48
    protected void doInitialize() throws LibraryException {
49
        View3DSwingLocator.registerManager(DefaultView3DSwingManager.class);
50

  
51
        // Load configuration file
52
        System.setProperty("gov.nasa.worldwind.app.config.document",
53
            "config/view3d.worldwind.xml");
54
        
55
        registerPersistence();
56
    }
57

  
58
    private void registerPersistence() {
59
        DefaultMapControlProperties3D.registerPersistence();
60
    }
61

  
62
    @Override
63
    protected void doPostInitialize() throws LibraryException {
64
    }
65
}
2.1/tags/org.gvsig.view3d-1.0.12/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/DefaultView3DPanel.java
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.swing.impl;
26

  
27
import java.awt.BorderLayout;
28
import java.awt.Component;
29
import java.awt.Dimension;
30
import java.awt.Toolkit;
31
import java.awt.Window;
32
import java.awt.event.ActionEvent;
33
import java.awt.event.ComponentEvent;
34
import java.awt.event.ComponentListener;
35
import java.awt.event.HierarchyEvent;
36
import java.awt.event.HierarchyListener;
37
import java.awt.event.KeyEvent;
38
import java.awt.event.WindowEvent;
39
import java.awt.event.WindowFocusListener;
40

  
41
import javax.swing.AbstractAction;
42
import javax.swing.Action;
43
import javax.swing.JComponent;
44
import javax.swing.JFrame;
45
import javax.swing.JPanel;
46
import javax.swing.KeyStroke;
47
import javax.swing.SwingUtilities;
48

  
49
import org.gvsig.fmap.mapcontext.MapContext;
50
import org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport;
51
import org.gvsig.tools.ToolsLocator;
52
import org.gvsig.tools.i18n.I18nManager;
53
import org.gvsig.tools.observer.ObservableHelper;
54
import org.gvsig.tools.observer.Observer;
55
import org.gvsig.tools.swing.api.ToolsSwingLocator;
56
import org.gvsig.tools.swing.api.windowmanager.WindowManager;
57
import org.gvsig.view3d.swing.api.MapControl3D;
58
import org.gvsig.view3d.swing.api.View3DPanel;
59
import org.gvsig.view3d.swing.api.View3DSwingLocator;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff