Revision 15492 import/ext3D/branches/ext3D_v1.1/lib3DMap/src/com/iver/ai2/gvsig3d/map3d/MapContext3D.java
MapContext3D.java | ||
---|---|---|
58 | 58 |
private Planet m_planet; |
59 | 59 |
|
60 | 60 |
private IViewerContainer m_canvas3d; |
61 |
|
|
61 |
|
|
62 | 62 |
private PlanetViewer planetViewer; |
63 | 63 |
|
64 | 64 |
// separate lists for image, elevation and vector layers |
... | ... | |
141 | 141 |
|
142 | 142 |
public void setViewer(IViewerContainer canvas) { |
143 | 143 |
m_canvas3d = canvas; |
144 |
this.planetViewer = (PlanetViewer)m_canvas3d.getOSGViewer(); |
|
144 |
this.planetViewer = (PlanetViewer) m_canvas3d.getOSGViewer();
|
|
145 | 145 |
} |
146 | 146 |
|
147 | 147 |
public IProjection getViewProjection() { |
... | ... | |
156 | 156 |
return m_canvas3d; |
157 | 157 |
} |
158 | 158 |
|
159 |
// public void setCanvas3d(IViewerContainer m_canvas3d) {
|
|
160 |
// this.m_canvas3d = m_canvas3d;
|
|
161 |
// |
|
162 |
// }
|
|
159 |
// public void setCanvas3d(IViewerContainer m_canvas3d) {
|
|
160 |
// this.m_canvas3d = m_canvas3d;
|
|
161 |
//
|
|
162 |
// }
|
|
163 | 163 |
|
164 | 164 |
public float getVerticalExageration() { |
165 | 165 |
return verticalExageration; |
... | ... | |
264 | 264 |
} |
265 | 265 |
layer.addLayerListener((LayerListener) this); |
266 | 266 |
|
267 |
// LINEAS COMETADAS PARA Q NO PREGUNTE DOS VECES QUE SI QUEREMOS REPROYECTAR LA CAPA |
|
268 |
// SI SE COMENTA LAS LINEAS CUANDO SE COPIA Y PEGA UNA CAPA NO PREGUNTA SI QUEREMOS REPROJECTAR |
|
269 |
// if (!m_bLoading) |
|
270 |
// checkProjection(layer, getViewPort().getProjection()); |
|
267 |
// LINEAS COMETADAS PARA Q NO PREGUNTE DOS VECES QUE SI QUEREMOS |
|
268 |
// REPROYECTAR LA CAPA |
|
269 |
// SI SE COMENTA LAS LINEAS CUANDO SE COPIA Y PEGA UNA CAPA NO PREGUNTA |
|
270 |
// SI QUEREMOS REPROJECTAR |
|
271 |
// if (!m_bLoading) |
|
272 |
// checkProjection(layer, getViewPort().getProjection()); |
|
271 | 273 |
|
272 | 274 |
int order = addLayerByType(layer); |
273 | 275 |
if (order == -1) { |
... | ... | |
560 | 562 |
else |
561 | 563 |
layerExtent = new Rectangle2D.Double(-20000000.0, |
562 | 564 |
-10000000.0, 40000000.0, 20000000.0); |
563 |
// TODO toggle comment because this code use WCS extension. When WCS extension runs correctly uncoment!!! |
|
564 |
|
|
565 |
// TODO toggle comment because this code use WCS extension. When |
|
566 |
// WCS extension runs correctly uncoment!!! |
|
567 |
|
|
565 | 568 |
if (layer instanceof FLyrWCS) |
566 | 569 |
((FLyrWCS) layer).setFullExtent(layerExtent); |
567 | 570 |
/**/ |
... | ... | |
574 | 577 |
.get(Layer3DProps.layer3DImage); |
575 | 578 |
int currentOrder = imageList.size() - 1; |
576 | 579 |
if (currentOrder != order) { // had to be added to non-last |
577 |
// position
|
|
580 |
// position |
|
578 | 581 |
m_planet.reorderTextureLayer(currentOrder, order); |
579 | 582 |
for (int iLayer = 0; iLayer < imageList.size(); iLayer++) { |
580 | 583 |
FLayer eachLayer = (FLayer) imageList.get(iLayer); |
... | ... | |
1114 | 1117 |
} |
1115 | 1118 |
|
1116 | 1119 |
public GraphicLayer getGraphicsLayer() { |
1117 |
GraphicLayer3D gra3D = new GraphicLayer3D(this.planetViewer, getPlanet()); |
|
1120 |
GraphicLayer3D gra3D = new GraphicLayer3D(this.planetViewer, |
|
1121 |
getPlanet()); |
|
1118 | 1122 |
return gra3D; |
1119 | 1123 |
} |
1120 | 1124 |
|
... | ... | |
1124 | 1128 |
|
1125 | 1129 |
public ViewPort getViewPort() { |
1126 | 1130 |
|
1127 |
|
|
1128 | 1131 |
ViewPort3D vp = (ViewPort3D) super.getViewPort(); |
1129 | 1132 |
|
1130 |
|
|
1131 |
if (m_canvas3d != null) |
|
1133 |
if (m_canvas3d != null) |
|
1132 | 1134 |
vp.setImageSize(new Dimension(planetViewer.getWidth(), planetViewer |
1133 | 1135 |
.getHeight())); |
1134 | 1136 |
vp.setPlanet(this.getPlanet()); |
... | ... | |
1152 | 1154 |
// System.out.println("extend seleccionado: \n Centro: " |
1153 | 1155 |
// + extentAux.getCenterX() + "\n Alto: " + extentAux.getHeight() |
1154 | 1156 |
// + "\n Ancho: " + extentAux.getWidth()); |
1157 |
|
|
1158 |
// TEST |
|
1159 |
|
|
1160 |
// Updating all the layers. This operation synchronize the |
|
1161 |
// transparency layer with layer transparency planet layer. |
|
1162 |
// Getting all selected Extent |
|
1163 |
FLayer[] selectedExtent = getLayers().getActives(); |
|
1164 |
|
|
1165 |
if (selectedExtent.length > 0) { |
|
1166 |
for (int i = 0; i < selectedExtent.length; i++) { |
|
1167 |
if (selectedExtent[0].isAvailable()){ |
|
1168 |
|
|
1169 |
FLayer lyr3D = selectedExtent[i]; |
|
1170 |
Layer3DProps layer3DProps = Layer3DProps.getLayer3DProps(lyr3D); |
|
1171 |
|
|
1172 |
int order = layer3DProps.getPlanetOrder(); |
|
1173 |
float opacity = layer3DProps.getOpacity(); |
|
1174 |
// Notify the opacity to planet |
|
1175 |
this.m_planet.setTextureOpacityLayer(order, opacity); |
|
1176 |
} |
|
1177 |
} |
|
1178 |
|
|
1179 |
|
|
1180 |
} |
|
1181 |
|
|
1155 | 1182 |
} |
1156 | 1183 |
// super.invalidate(); |
1157 | 1184 |
|
Also available in: Unified diff