Revision 15984 trunk/libraries/lib3DMap/src/com/iver/ai2/gvsig3d/listener/canvasListener.java
canvasListener.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.awt.event.KeyEvent; |
4 | 4 |
import java.awt.event.KeyListener; |
5 |
import java.awt.event.MouseEvent; |
|
6 |
import java.awt.event.MouseListener; |
|
5 | 7 |
|
6 | 8 |
import es.upv.ai2.libjosg.Vec3; |
7 | 9 |
import es.upv.ai2.libjosg.planets.Planet; |
8 | 10 |
import es.upv.ai2.libjosg.planets.PlanetViewer; |
9 | 11 |
import es.upv.ai2.libjosg.viewer.Camera; |
10 | 12 |
import es.upv.ai2.libjosg.viewer.IViewerContainer; |
13 |
import es.upv.ai2.libjosg.viewer.Intersection; |
|
14 |
import es.upv.ai2.libjosg.viewer.Intersections; |
|
11 | 15 |
import es.upv.ai2.libjosg.viewer.OSGViewer; |
12 | 16 |
|
13 |
public class canvasListener implements KeyListener { |
|
17 |
public class canvasListener implements KeyListener, MouseListener {
|
|
14 | 18 |
private static boolean active = false; |
15 | 19 |
|
16 | 20 |
private IViewerContainer m_canvas3d = null; |
... | ... | |
158 | 162 |
this.planet = planet; |
159 | 163 |
} |
160 | 164 |
|
165 |
public void mouseClicked(MouseEvent e) { |
|
166 |
if (e.getButton() == MouseEvent.BUTTON1) { |
|
167 |
Intersections hits = m_planetViewer.rayPick(this.planet, e.getX(), e.getY()); |
|
168 |
if(hits.containsIntersections()) { |
|
169 |
Intersection hit = hits.getFirstIntersection(); |
|
170 |
System.err.println("Point:" + hit.getIntersectionPoint().toString()); |
|
171 |
Vec3 point = planet.convertXYZToLatLongHeight(hit |
|
172 |
.getIntersectionPoint()); |
|
173 |
System.err.println("LatLonHeight: " + point.toString()); |
|
174 |
} |
|
175 |
} |
|
176 |
|
|
177 |
} |
|
178 |
|
|
179 |
public void mouseEntered(MouseEvent arg0) { |
|
180 |
// TODO Auto-generated method stub |
|
181 |
|
|
182 |
} |
|
183 |
|
|
184 |
public void mouseExited(MouseEvent arg0) { |
|
185 |
// TODO Auto-generated method stub |
|
186 |
|
|
187 |
} |
|
188 |
|
|
189 |
public void mousePressed(MouseEvent arg0) { |
|
190 |
// TODO Auto-generated method stub |
|
191 |
|
|
192 |
} |
|
193 |
|
|
194 |
public void mouseReleased(MouseEvent arg0) { |
|
195 |
// TODO Auto-generated method stub |
|
196 |
|
|
197 |
} |
|
198 |
|
|
161 | 199 |
} |
Also available in: Unified diff