float phi = (float) UtilAngle.radianToDegree(e.phi);
@Override public void onDraw(Canvas canvas, Matrix imageToView) { drawBitmap(canvas,imageToView); canvas.concat(imageToView); synchronized (lockGui) { for(int i = 0; i < ellipsesVis.size; i++ ) { EllipseRotated_F64 ellipse = ellipsesVis.get(i); float phi = (float) UtilAngle.radianToDegree(ellipse.phi); float cx = (float) ellipse.center.x; float cy = (float) ellipse.center.y; float w = (float) ellipse.a; float h = (float) ellipse.b; // really skinny ones are probably just a line and not what the user wants if (w <= 2 || h <= 2) return; canvas.save(); canvas.rotate(phi, cx, cy); r.set(cx - w, cy - h, cx + w + 1, cy + h + 1); canvas.drawOval(r, paint); canvas.restore(); } } } }
@Override public void mouseClicked(MouseEvent e) { GeoLL_F32 geo = new GeoLL_F32(); synchronized (distorter) { EquirectangularTools_F32 tools = distorter.getTools(); double scale = panelImage.scale; distorter.compute((int) (e.getX() / scale), (int) (e.getY() / scale)); tools.equiToLatLonFV(distorter.distX, distorter.distY, geo); panelRotate.setOrientation(UtilAngle.radianToDegree(geo.lat), UtilAngle.radianToDegree(geo.lon),0); distorter.setDirection(geo.lon, geo.lat, 0); distortImage.setModel(distorter); // let it know the transform has changed if (inputMethod == InputMethod.IMAGE) { renderOutput(inputCopy); } } } });
@Override public void mouseClicked(MouseEvent e) { GeoLL_F32 geo = new GeoLL_F32(); synchronized (distorter) { EquirectangularTools_F32 tools = distorter.getTools(); double scale = panelImage.scale; distorter.compute((int) (e.getX() / scale), (int) (e.getY() / scale)); tools.equiToLatLonFV(distorter.distX, distorter.distY, geo); panelRotate.setOrientation(UtilAngle.radianToDegree(geo.lat), UtilAngle.radianToDegree(geo.lon),0); distorter.setDirection(geo.lon, geo.lat, 0); distortImage.setModel(distorter); // let it know the transform has changed if (inputMethod == InputMethod.IMAGE) { renderOutput(inputCopy); } } } });