Revision 774 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/extrusion/DefaultVectorExtrusionLoader.java
DefaultVectorExtrusionLoader.java | ||
---|---|---|
23 | 23 |
*/ |
24 | 24 |
package org.gvsig.view3d.vector.lib.impl.extrusion; |
25 | 25 |
|
26 |
import org.gvsig.fmap.dal.exception.DataException; |
|
27 | 26 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
28 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
29 |
import org.gvsig.fmap.geom.Geometry.TYPES; |
|
30 |
import org.gvsig.fmap.geom.type.GeometryType; |
|
31 | 27 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
32 | 28 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
33 | 29 |
import org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend; |
... | ... | |
35 | 31 |
import org.gvsig.view3d.lib.api.loader.Loader; |
36 | 32 |
import org.gvsig.view3d.lib.api.loader.LoaderParameters; |
37 | 33 |
import org.gvsig.view3d.vector.lib.api.VectorExtrusionLoaderParameters; |
34 |
import org.gvsig.view3d.vector.lib.api.VectorLoaderParameters; |
|
38 | 35 |
|
39 | 36 |
/** |
40 | 37 |
* |
... | ... | |
61 | 58 |
} |
62 | 59 |
FLyrVect layerVect = (FLyrVect) layer; |
63 | 60 |
FeatureStore featureStore = layerVect.getFeatureStore(); |
64 |
IVectorLegend vectorLegend = null;
|
|
61 |
IVectorLegend legend = null;
|
|
65 | 62 |
if (layerVect.getLegend() instanceof IVectorLegend) { |
66 |
vectorLegend = (IVectorLegend) layerVect.getLegend();
|
|
63 |
legend = (IVectorLegend) layerVect.getLegend();
|
|
67 | 64 |
} |
68 | 65 |
|
69 |
FeatureType featureType = null; |
|
70 |
try { |
|
71 |
featureType = featureStore.getDefaultFeatureType(); |
|
72 |
} catch (DataException e) { |
|
73 |
// TODO Auto-generated catch block |
|
74 |
throw new LoadException(null, e); |
|
75 |
} |
|
76 |
|
|
77 |
GeometryType geomType = featureType.getDefaultGeometryAttribute().getGeomType(); |
|
78 |
VectorExtrusionLoaderParameters extrusionParameters = (VectorExtrusionLoaderParameters) parameters; |
|
79 |
if (geomType.isTypeOf(TYPES.LINE) || geomType.isTypeOf(TYPES.MULTILINE)) { |
|
80 |
return new DefaultVectorExtrusionLineRenderableLayer(extrusionParameters, featureStore, vectorLegend); |
|
81 |
} else if (geomType.isTypeOf(TYPES.POINT) || geomType.isTypeOf(TYPES.MULTIPOINT)) { |
|
82 |
return new DefaultVectorExtrusionPointRenderableLayer(extrusionParameters, featureStore, vectorLegend); |
|
83 |
} else if (geomType.isTypeOf(TYPES.POLYGON) || geomType.isTypeOf(TYPES.MULTIPOLYGON)) { |
|
84 |
return new DefaultVectorExtrusionPolygonRenderableLayer(extrusionParameters, featureStore, vectorLegend); |
|
85 |
} else { |
|
86 |
return null; // TODO Auto-generated catch block |
|
87 |
} |
|
66 |
return new DefaultVectorExtrusionRenderableLayer((VectorLoaderParameters) parameters, featureStore, legend); |
|
88 | 67 |
} |
89 | 68 |
|
90 | 69 |
} |
Also available in: Unified diff