Revision 32344 branches/gvSIG_19_ext3D_osgVP_2_2_0/extensions/ext3Dgui/src/org/gvsig/gvsig3dgui/import3D/ControlImport3D.java
ControlImport3D.java | ||
---|---|---|
54 | 54 |
import org.gvsig.gvsig3dgui.view.View3D; |
55 | 55 |
import org.gvsig.osgvp.core.osg.Vec3; |
56 | 56 |
import org.gvsig.osgvp.viewer.Intersections; |
57 |
import org.gvsig.osgvp.core.osgdb.osgDB; |
|
58 |
import org.gvsig.osgvp.exceptions.node.LoadNodeException; |
|
57 | 59 |
|
58 | 60 |
import com.iver.ai2.gvsig3d.map3d.layers.Layer3DProps; |
59 | 61 |
import com.iver.andami.PluginServices; |
... | ... | |
333 | 335 |
} |
334 | 336 |
} |
335 | 337 |
|
336 |
OSGDriver _osgDriver = new OSGDriver(); |
|
337 |
OSGParser parser = new OSGParser("OSG", "OSG File Formats Parser"); |
|
338 |
parser.parse(_osgDriver, null, _fileOSG.toURI()); |
|
339 |
MultiGeometry root = _osgDriver.getRootFeature(); |
|
338 |
// OSGDriver _osgDriver = new OSGDriver();
|
|
339 |
// OSGParser parser = new OSGParser("OSG", "OSG File Formats Parser");
|
|
340 |
// parser.parse(_osgDriver, null, _fileOSG.toURI());
|
|
341 |
// MultiGeometry root = _osgDriver.getRootFeature();
|
|
340 | 342 |
|
341 | 343 |
IProjectView model = _view3D.getModel(); |
342 | 344 |
MapContext mapContext = model.getMapContext(); |
... | ... | |
347 | 349 |
OSGCacheService osgCache = (OSGCacheService) Layer3DProps.getLayer3DProps(actives[0]).getCacheService(); |
348 | 350 |
Vec3 scale = new Vec3(Double.parseDouble(textEscaladoX.getValue()), Double.parseDouble(textEscaladoY.getValue()), Double.parseDouble(textEscaladoZ.getValue())); |
349 | 351 |
Vec3 rotation = new Vec3(Double.parseDouble(textRotacionX.getValue()), Double.parseDouble(textRotacionY.getValue()), Double.parseDouble(textRotacionZ.getValue())); |
350 |
osgCache.AddGeometryToLayer(root,_position,rotation,scale); |
|
351 |
} |
|
352 |
else { |
|
352 |
//osgCache.AddGeometryToLayer(root,_position,rotation,scale); |
|
353 |
|
|
354 |
try { |
|
355 |
osgCache.AddNodeToLayer(osgDB.readNodeFile(_fileOSG.toString()), _position, rotation, scale); |
|
356 |
} catch (LoadNodeException e) { |
|
357 |
// TODO Auto-generated catch block |
|
358 |
e.printStackTrace(); |
|
359 |
} catch (FileNotFoundException e) { |
|
360 |
// TODO Auto-generated catch block |
|
361 |
e.printStackTrace(); |
|
362 |
} |
|
363 |
|
|
364 |
}else { |
|
353 | 365 |
JOptionPane.showMessageDialog(null, PluginServices.getText(this,"editable_layer_select_info"), |
354 | 366 |
PluginServices.getText(this,"editable_layer_select"), JOptionPane.WARNING_MESSAGE); |
355 | 367 |
return; |
Also available in: Unified diff