/** * Get the picked point, using geometry picking, for the specified canvas * position. * * @param c * @param e * @return */ public Point3d getPickPointGeometry(final Content c, final MouseEvent e) { return getPickPointGeometry(c, e.getX(), e.getY()); }
return; final Point3d point = picker.getPickPointGeometry(c, me.getX(), me.getY());
/** * Adds a landmark point specfied by the position of the MouseEvent. * * @param c * @param e */ public void addPoint(final Content c, final MouseEvent e) { if (c == null) { IJ.error("Selection required"); return; } final Point3d p3d = getPickPointGeometry(c, e); if (p3d == null) return; final PointList pl = c.getPointList(); final float tol = c.getLandmarkPointSize(); final BenesNamedPoint bnp = pl.pointAt(p3d.x, p3d.y, p3d.z, tol); if (bnp == null) { pl.add(p3d.x, p3d.y, p3d.z); } }
/** * Deletes a landmark point of the specified Content at the given mouse * position * * @param c * @param e */ public void deletePoint(final Content c, final MouseEvent e) { if (c == null) { IJ.error("Selection required"); return; } final Point3d p3d = getPickPointGeometry(c, e); if (p3d == null) return; final PointList pl = c.getPointList(); final float tol = c.getLandmarkPointSize(); final int ind = pl.indexOfPointAt(p3d.x, p3d.y, p3d.z, tol); if (ind != -1) { pl.remove(ind); } }
/** * Adds a landmark point specfied by the canvas position * * @param c * @param x position in the canvas * @param y position in the canvas */ public void addPoint(final Content c, final int x, final int y) { if (c == null) { IJ.error("Selection required"); return; } final Point3d p3d = getPickPointGeometry(c, x, y); if (p3d == null) return; final PointList pl = c.getPointList(); final float tol = c.getLandmarkPointSize(); final BenesNamedPoint bnp = pl.pointAt(p3d.x, p3d.y, p3d.z, tol); if (bnp == null) { pl.add(p3d.x, p3d.y, p3d.z); } }
/** * Moves the picked landmark point to the position specified by the * MouseEvent. * * @param c * @param e */ public synchronized void movePoint(final Content c, final MouseEvent e) { if (c == null) { IJ.error("Selection required"); return; } final Point3d p3d = getPickPointGeometry(c, e); if (p3d == null) return; final PointList pl = c.getPointList(); if (movingIndex == -1) movingIndex = pl.indexOfPointAt(p3d.x, p3d.y, p3d.z, c.getLandmarkPointSize()); if (movingIndex != -1) { pl.placePoint(pl.get(movingIndex), p3d.x, p3d.y, p3d.z); } }
if (null == c) return; final Point3d point = picker.getPickPointGeometry(c, p.x, p.y); final double diagonalLength = tracerPlugin.getStackDiagonalLength();
if(content==null) return; final Point3d p = picker.getPickPointGeometry(content,e); if(p==null) { Utils.log("No point was found on content "+content);
final Point3d p = univ.getPicker().getPickPointGeometry(c, x, y); float r = 0, dD = 0; if (p != null) {