Revision 23017
trunk/libraries/lib3DMap/src/org/gvsig/gvsig3d/cacheservices/OSGCacheService.java | ||
---|---|---|
1 | 1 |
package org.gvsig.gvsig3d.cacheservices; |
2 | 2 |
|
3 | 3 |
import java.awt.geom.Rectangle2D; |
4 |
import java.io.File; |
|
5 |
import java.io.FileNotFoundException; |
|
4 | 6 |
|
5 | 7 |
import org.apache.log4j.Logger; |
6 | 8 |
import org.cresques.cts.IProjection; |
... | ... | |
14 | 16 |
import org.gvsig.operations3D.Draw3DMultiSolid; |
15 | 17 |
import org.gvsig.operations3D.context.Draw3DContext; |
16 | 18 |
import org.gvsig.osgvp.Group; |
17 |
import org.gvsig.osgvp.Optimizer;
|
|
19 |
import org.gvsig.osgvp.Node;
|
|
18 | 20 |
import org.gvsig.osgvp.PositionAttitudeTransform; |
19 | 21 |
import org.gvsig.osgvp.Vec3; |
20 |
import org.gvsig.osgvp.Optimizer.OptimizationOptions;
|
|
22 |
import org.gvsig.osgvp.osgDB;
|
|
21 | 23 |
import org.gvsig.osgvp.exceptions.node.NodeException; |
22 | 24 |
import org.gvsig.osgvp.planets.Planet; |
23 | 25 |
import org.gvsig.osgvp.planets.PlanetViewer; |
... | ... | |
104 | 106 |
GvsigDriverOSG osgD = (GvsigDriverOSG) ((FLyrVect) _layer).getSource() |
105 | 107 |
.getDriver(); |
106 | 108 |
try { |
107 |
|
|
109 |
File file = osgD.getFile(); |
|
110 |
Node n = null; |
|
111 |
|
|
112 |
|
|
113 |
try { |
|
114 |
n = osgDB.readNodeFile(file.getAbsolutePath()); |
|
115 |
} catch (FileNotFoundException e) { |
|
116 |
// TODO Auto-generated catch block |
|
117 |
e.printStackTrace(); |
|
118 |
} |
|
108 | 119 |
MultiGeometry root = osgD.getOSGDriver().getRootFeature(); |
109 | 120 |
// Insert the geometry in the root node of the graph. |
110 | 121 |
Group g = new Group(); |
111 |
buildGeometry(root, g); |
|
112 |
|
|
122 |
// buildGeometry(root, g);
|
|
123 |
g.addChild(n); |
|
113 | 124 |
_layerNode.addChild(g); |
114 | 125 |
} catch (NodeException e) { |
115 | 126 |
// TODO Auto-generated catch block |
116 | 127 |
e.printStackTrace(); |
117 | 128 |
} |
118 | 129 |
} |
130 |
this._canvas3D.repaint(); |
|
119 | 131 |
} |
120 | 132 |
|
121 | 133 |
public void RefreshFeaturesToPlanet() { |
... | ... | |
143 | 155 |
posAttTrasn = new PositionAttitudeTransform(); |
144 | 156 |
posAttTrasn.setPosition(position); |
145 | 157 |
posAttTrasn.setScale(scale); |
146 |
// posAttTrasn.setAttitude((float) rotation.x(), new Vec3(1,0,0));
|
|
147 |
// posAttTrasn.setAttitude((float) rotation.y(), new Vec3(0,1,0));
|
|
148 |
// posAttTrasn.setAttitude((float) rotation.z(), new Vec3(0,0,1));
|
|
158 |
posAttTrasn.setAttitude((float) rotation.x(), new Vec3(1,0,0)); |
|
159 |
posAttTrasn.setAttitude((float) rotation.y(), new Vec3(0,1,0)); |
|
160 |
posAttTrasn.setAttitude((float) rotation.z(), new Vec3(0,0,1)); |
|
149 | 161 |
buildGeometry(multiGeometry, group); |
150 | 162 |
posAttTrasn.addChild(group); |
151 | 163 |
_layerNode.addChild(posAttTrasn); |
Also available in: Unified diff