Revision 762 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/DefaultVectorExtrusionPointRenderableLayer.java
DefaultVectorExtrusionPointRenderableLayer.java | ||
---|---|---|
1 | 1 |
package org.gvsig.view3d.vector.lib.impl.extrusion; |
2 | 2 |
|
3 |
import java.awt.Color; |
|
3 | 4 |
import java.util.ArrayList; |
4 | 5 |
import java.util.List; |
5 | 6 |
|
... | ... | |
15 | 16 |
import org.gvsig.fmap.geom.aggregate.MultiPoint; |
16 | 17 |
import org.gvsig.fmap.geom.primitive.Point; |
17 | 18 |
import org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend; |
19 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
20 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.ISimpleMarkerSymbol; |
|
18 | 21 |
import org.gvsig.view3d.vector.lib.api.VectorElevationMode; |
19 | 22 |
import org.gvsig.view3d.vector.lib.api.VectorExtrusionLoaderParameters; |
20 |
import org.gvsig.view3d.vector.lib.impl.AbstractPointRenderableLayer;
|
|
23 |
import org.gvsig.view3d.vector.lib.impl.AbstractRenderableLayer; |
|
21 | 24 |
|
22 | 25 |
import gov.nasa.worldwind.geom.Position; |
26 |
import gov.nasa.worldwind.render.Material; |
|
23 | 27 |
import gov.nasa.worldwind.render.PointPlacemark; |
28 |
import gov.nasa.worldwind.render.PointPlacemarkAttributes; |
|
24 | 29 |
import gov.nasa.worldwind.render.Renderable; |
25 | 30 |
|
26 |
public class DefaultVectorExtrusionPointRenderableLayer extends AbstractPointRenderableLayer { |
|
31 |
public class DefaultVectorExtrusionPointRenderableLayer extends AbstractRenderableLayer { |
|
32 |
|
|
33 |
private PointPlacemarkAttributes markAttributes; |
|
27 | 34 |
|
28 | 35 |
public DefaultVectorExtrusionPointRenderableLayer(VectorExtrusionLoaderParameters parameters, FeatureStore featureStore, |
29 | 36 |
IVectorLegend legend) { |
30 |
super(parameters, featureStore, legend); |
|
37 |
super(parameters, featureStore); |
|
38 |
this.markAttributes = getBasicMarkerAttributes(legend); |
|
31 | 39 |
} |
32 | 40 |
|
33 | 41 |
@Override |
... | ... | |
97 | 105 |
} |
98 | 106 |
return featureQuery; |
99 | 107 |
} |
108 |
|
|
109 |
private PointPlacemarkAttributes getBasicMarkerAttributes(IVectorLegend legend) { |
|
100 | 110 |
|
111 |
if (this.markAttributes != null) { |
|
112 |
return this.markAttributes; |
|
113 |
} |
|
114 |
|
|
115 |
double markerSize = 0; |
|
116 |
Material fillMaterial = null; |
|
117 |
|
|
118 |
if (legend == null) { |
|
119 |
fillMaterial = new Material(parameters.getDefaultColor()); |
|
120 |
markerSize = 0.3; |
|
121 |
} else { |
|
122 |
ISymbol symbol = legend.getDefaultSymbol(); |
|
123 |
if (symbol instanceof ISimpleMarkerSymbol) { |
|
124 |
ISimpleMarkerSymbol markerSymbol = (ISimpleMarkerSymbol) symbol; |
|
125 |
Color fillColor = markerSymbol.getColor(); |
|
126 |
markerSize = markerSymbol.getSize(); |
|
127 |
fillMaterial = new Material(fillColor); |
|
128 |
} else { |
|
129 |
fillMaterial = new Material(parameters.getDefaultColor()); |
|
130 |
markerSize = 4; |
|
131 |
} |
|
132 |
} |
|
133 |
markAttributes = new PointPlacemarkAttributes(); |
|
134 |
Color color = fillMaterial.getDiffuse(); |
|
135 |
markAttributes.setImageColor(color); |
|
136 |
markAttributes.setLineMaterial(fillMaterial); |
|
137 |
markAttributes.setLineWidth(1d); |
|
138 |
markAttributes.setUsePointAsDefaultImage(true); |
|
139 |
markAttributes.setScale(markerSize); |
|
140 |
return markAttributes; |
|
141 |
} |
|
142 |
|
|
101 | 143 |
} |
Also available in: Unified diff