svn-gvsig-desktop / trunk / libraries / lib3DMap / test / com / iver / ai2 / gvsig3d / TransformacionesTest.java @ 18219
History | View | Annotate | Download (2 KB)
1 |
package com.iver.ai2.gvsig3d; |
---|---|
2 |
|
3 |
import junit.framework.TestCase; |
4 |
|
5 |
import com.iver.ai2.gvsig3d.gui.Hud; |
6 |
import com.iver.ai2.gvsig3d.utils.UtilCoord; |
7 |
|
8 |
import es.upv.ai2.osgvp.Vec3; |
9 |
import es.upv.ai2.osgvp.planets.Planet; |
10 |
import es.upv.ai2.osgvp.viewer.ViewerFactory; |
11 |
|
12 |
public class TransformacionesTest extends TestCase { |
13 |
public void testTrasnform() throws Throwable { |
14 |
|
15 |
System.out.println("De grados a radianes " + UtilCoord.radianes(180)); |
16 |
System.out
|
17 |
.println("De radianes a grados " + UtilCoord.degrees(Math.PI)); |
18 |
|
19 |
Vec3 esferica = new Vec3(6378137, 0.0, 40.0); |
20 |
Vec3 cartesianas = new Vec3(4885936.723, 0, 4099786.416); |
21 |
|
22 |
Vec3 e = UtilCoord.GeoToCarte(esferica); |
23 |
Vec3 c = UtilCoord.CarteToGeo(cartesianas); |
24 |
|
25 |
System.out.println("De geocentricas a cartesianas " + e.x() + " " |
26 |
+ e.y() + " " + e.z());
|
27 |
System.out.println("De cartesianas a geocentricas " + c.x() + " " |
28 |
+ c.y() + " " + c.z());
|
29 |
|
30 |
} |
31 |
|
32 |
public void testTraPla() throws Throwable { |
33 |
|
34 |
ViewerFactory m_canvas3d = new ViewerFactory();
|
35 |
|
36 |
m_canvas3d.startAnimator(); |
37 |
|
38 |
Planet m_planet = new Planet();
|
39 |
|
40 |
m_planet.setCoordinateSystemType(Planet.CoordinateSystemType.PROJECTED); |
41 |
|
42 |
Vec3 cartesianas = new Vec3(4886013.328, 0, 4099850.692); |
43 |
Vec3 e = m_planet.convertXYZToLatLongHeight(cartesianas); |
44 |
|
45 |
System.out.println("De geocentricas a cartesianas " + e.x() + " " |
46 |
+ e.y() + " " + e.z());
|
47 |
|
48 |
} |
49 |
|
50 |
public void testHome() throws Throwable { |
51 |
|
52 |
// System.out.println(new File("home").getCanonicalPath());
|
53 |
|
54 |
String home = System.getProperty("user.home"); |
55 |
System.out.println(home);
|
56 |
|
57 |
String wd = System.getProperty("user.dir"); |
58 |
System.out.println(wd);
|
59 |
|
60 |
} |
61 |
|
62 |
public void testGrados() throws Throwable { |
63 |
|
64 |
System.out.println(Hud.getSexagesinal(74.90555556, false)); |
65 |
|
66 |
} |
67 |
|
68 |
public void testJDialog() throws Throwable { |
69 |
//
|
70 |
// VectorLayerMenu vectorLayerMenu = new VectorLayerMenu(null);
|
71 |
// vectorLayerMenu.setModal(true);
|
72 |
// vectorLayerMenu.pack();
|
73 |
// vectorLayerMenu.setVisible(true);
|
74 |
} |
75 |
|
76 |
} |