/** * 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()); }
@Override public void mouseClicked(final MouseEvent e) { if (e.isConsumed()) return; select(picker.getPickedContent(e.getX(), e.getY())); }
return; final Picker picker = univ.getPicker(); final Content c = picker.getPickedContent(me.getX(), me.getY()); if (null == c) return; final Point3d point = picker.getPickPointGeometry(c, me.getX(), me.getY());
picker.addPoint(sel, e); e.consume(); picker.deletePoint(sel, e); e.consume(); picker.movePoint(c, e); e.consume(); picker.stopMoving(); e.consume();
function Picker() { this.status = [0, 0, 0]; Object.defineProperty(this, 'progress', { get : function(){ return this.status[0] }, set : function(p){ this.status[0] = p }, enumerable : true }); } var picker = new Picker(); picker.progress = 2; console.log(picker.status[0]) // logs 2
if (c.getType() != ContentConstants.VOLUME) return intersection; final float v = getVolumePoint(c, intersection); if (v > 20) return intersection;
return; final Picker picker = univ.getPicker(); final Content c = picker.getPickedContent(p.x, p.y); if (null == c) return; final Point3d point = picker.getPickPointGeometry(c, p.x, p.y); final double diagonalLength = tracerPlugin.getStackDiagonalLength();
picker = new Picker(this); setInteractiveBehavior(new InteractiveBehavior(this));
if (c.getType() != ContentConstants.VOLUME) return intersection; final float v = getVolumePoint(c, intersection); if (v > 20) return intersection;
final Content content = picker.getPickedContent(e.getX(),e.getY()); if(content==null) return; final Point3d p = picker.getPickPointGeometry(content,e); if(p==null) { Utils.log("No point was found on content "+content);
/** * 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); } }
@Override public void mouseMoved(final MouseEvent e) { final Content c = picker.getPickedContent(e.getX(), e.getY()); if (c != null) IJ.showStatus(c.getName()); else IJ.showStatus(""); } });
final float v = getVolumePoint(c, intersection); if (v > 20) return c;
/** * 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); } }
public void showPopup(final MouseEvent e) { content = univ.getPicker().getPickedContent(e.getX(), e.getY()); if (content == null) return; univ.select(content); shaded.setState(content.isShaded()); saturated.setState(content.isSaturatedVolumeRendering()); if (popup.isPopupTrigger(e)) popup.show(e.getComponent(), e.getX(), e .getY()); }
/** * 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); } }
final Point3d p = univ.getPicker().getPickPointGeometry(c, x, y); float r = 0, dD = 0; if (p != null) {