Revision 15441 import/ext3D/branches/ext3D_v1.1/ext3D/src/com/iver/ai2/gvsig3d/map3d/MapContext3D.java
MapContext3D.java | ||
---|---|---|
27 | 27 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
28 | 28 |
import com.iver.cit.gvsig.fmap.layers.FLyrDefault; |
29 | 29 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
30 |
import com.iver.cit.gvsig.fmap.layers.FLyrWCS; |
|
30 | 31 |
import com.iver.cit.gvsig.fmap.layers.GraphicLayer; |
31 | 32 |
import com.iver.cit.gvsig.fmap.layers.LayerEvent; |
32 | 33 |
import com.iver.cit.gvsig.fmap.layers.LayerListener; |
... | ... | |
42 | 43 |
import es.upv.ai2.libjosg.Node; |
43 | 44 |
import es.upv.ai2.libjosg.Vec3; |
44 | 45 |
import es.upv.ai2.libjosg.planets.Planet; |
46 |
import es.upv.ai2.libjosg.planets.PlanetViewer; |
|
45 | 47 |
import es.upv.ai2.libjosg.planets.RequestLayerListener; |
46 | 48 |
import es.upv.ai2.libjosg.planets.TileCreatedListener; |
47 | 49 |
import es.upv.ai2.libjosg.planets.TileEvent; |
... | ... | |
56 | 58 |
private Planet m_planet; |
57 | 59 |
|
58 | 60 |
private IViewerContainer m_canvas3d; |
61 |
|
|
62 |
private PlanetViewer planetViewer; |
|
59 | 63 |
|
60 | 64 |
// separate lists for image, elevation and vector layers |
61 | 65 |
private ArrayList m_layerLists = new ArrayList(); |
... | ... | |
137 | 141 |
|
138 | 142 |
public void setViewer(IViewerContainer canvas) { |
139 | 143 |
m_canvas3d = canvas; |
144 |
this.planetViewer = (PlanetViewer)m_canvas3d.getOSGViewer(); |
|
140 | 145 |
} |
141 | 146 |
|
142 | 147 |
public IProjection getViewProjection() { |
... | ... | |
151 | 156 |
return m_canvas3d; |
152 | 157 |
} |
153 | 158 |
|
154 |
public void setCanvas3d(IViewerContainer m_canvas3d) { |
|
155 |
this.m_canvas3d = m_canvas3d; |
|
156 |
} |
|
159 |
// public void setCanvas3d(IViewerContainer m_canvas3d) { |
|
160 |
// this.m_canvas3d = m_canvas3d; |
|
161 |
// |
|
162 |
// } |
|
157 | 163 |
|
158 | 164 |
public float getVerticalExageration() { |
159 | 165 |
return verticalExageration; |
... | ... | |
555 | 561 |
layerExtent = new Rectangle2D.Double(-20000000.0, |
556 | 562 |
-10000000.0, 40000000.0, 20000000.0); |
557 | 563 |
// TODO toggle comment because this code use WCS extension. When WCS extension runs correctly uncoment!!! |
558 |
/* |
|
564 |
|
|
559 | 565 |
if (layer instanceof FLyrWCS) |
560 | 566 |
((FLyrWCS) layer).setFullExtent(layerExtent); |
561 |
*/ |
|
567 |
/**/
|
|
562 | 568 |
} |
563 | 569 |
if (props3D.getType() == Layer3DProps.layer3DElevation) |
564 | 570 |
m_planet.addHeightfieldLayer(layerExtent, 3); |
... | ... | |
779 | 785 |
|
780 | 786 |
// UtilCoord.imprimeCamara(cam); |
781 | 787 |
|
782 |
m_canvas3d.getOSGViewer().setCamera(cam);
|
|
788 |
planetViewer.setCamera(cam);
|
|
783 | 789 |
// REPAINTING VIEWER |
784 | 790 |
if (m_canvas3d != null) |
785 | 791 |
m_canvas3d.repaint(); |
... | ... | |
1108 | 1114 |
} |
1109 | 1115 |
|
1110 | 1116 |
public GraphicLayer getGraphicsLayer() { |
1111 |
GraphicLayer3D gra3D = new GraphicLayer3D(getCanvas3d(), getPlanet());
|
|
1117 |
GraphicLayer3D gra3D = new GraphicLayer3D(this.planetViewer, getPlanet());
|
|
1112 | 1118 |
return gra3D; |
1113 | 1119 |
} |
1114 | 1120 |
|
1115 | 1121 |
public Node getSpecialNode() { |
1116 |
return this.m_canvas3d.getOSGViewer().getSpecialNode(0);
|
|
1122 |
return planetViewer.getSpecialNode(0);
|
|
1117 | 1123 |
} |
1118 | 1124 |
|
1119 | 1125 |
public ViewPort getViewPort() { |
... | ... | |
1122 | 1128 |
ViewPort3D vp = (ViewPort3D) super.getViewPort(); |
1123 | 1129 |
|
1124 | 1130 |
|
1125 |
if (m_canvas3d != null) |
|
1126 |
vp.setImageSize(new Dimension(m_canvas3d.getWidth(), m_canvas3d
|
|
1131 |
if (m_canvas3d != null)
|
|
1132 |
vp.setImageSize(new Dimension(planetViewer.getWidth(), planetViewer
|
|
1127 | 1133 |
.getHeight())); |
1128 | 1134 |
vp.setPlanet(this.getPlanet()); |
1129 | 1135 |
vp.setViewer(this.m_canvas3d); |
Also available in: Unified diff