/** * Gets an image panel in this group with the specified axis. * @param axis the axis. * @return the image panel; null, if none has the axis specified. */ public ImagePanel getImagePanel(Axis axis) { for (ImagePanel ip:_ipList) { if (axis==ip.getFrame().getAxis()) return ip; } return null; }
/** * Gets a 1st image panel in this group with the specified axis. * @param axis the axis. * @return the image panel; null, if none has the axis specified. */ public ImagePanel getImagePanel1(Axis axis) { for (ImagePanel ip:_ip1List) { if (axis==ip.getFrame().getAxis()) return ip; } return null; }
/** * Gets a 2nd image panel in this group with the specified axis. * @param axis the axis. * @return the image panel; null, if none has the axis specified. */ public ImagePanel getImagePanel2(Axis axis) { for (ImagePanel ip:_ip2List) { if (axis==ip.getFrame().getAxis()) return ip; } return null; }
protected void draw(DrawContext dc) { AxisAlignedFrame aaf = this.getFrame(); if (aaf==null) return; Axis axis = aaf.getAxis(); drawEllipsoids(axis); }
for (ImagePanel ip:_ipList) { AxisAlignedFrame frame = ip.getFrame(); Axis axis = frame.getAxis(); if (axis==Axis.X) { frame.setCorners(new Point3(xk,fy,fz),new Point3(xk,ly,lz));
for (ImagePanel ip:_ip1List) { AxisAlignedFrame frame = ip.getFrame(); Axis axis = frame.getAxis(); if (axis==Axis.X) { frame.setCorners(new Point3(xk,fy,fz),new Point3(xk,ly,lz));
public void dragBegin(DragContext dc) { Point3 p = dc.getPointWorld(); Vector3 n = null; Axis axis = _frame.getAxis(); if (axis==Axis.X) { n = new Vector3(1.0,0.0,0.0); } else if (axis==Axis.Y) { n = new Vector3(0.0,1.0,0.0); } else if (axis==Axis.Z) { n = new Vector3(0.0,0.0,1.0); } MouseEvent event = dc.getMouseEvent(); Point3 origin = getLocation(); Plane plane = new Plane(p,n); Matrix44 worldToPixel = dc.getWorldToPixel(); _mouseOnPlane = new MouseOnPlane(event,origin,plane,worldToPixel); } public void drag(DragContext dc) {
public void dragBegin(DragContext dc) { Point3 origin = dc.getPointWorld(); Vector3 normal = null; Axis axis = _frame.getAxis(); if (axis==Axis.X) { normal = new Vector3(1.0,0.0,0.0); } else if (axis==Axis.Y) { normal = new Vector3(0.0,1.0,0.0); } else if (axis==Axis.Z) { normal = new Vector3(0.0,0.0,1.0); } Plane plane = new Plane(origin,normal); MouseEvent event = dc.getMouseEvent(); Matrix44 worldToPixel = dc.getWorldToPixel(); if (event.isControlDown() || event.isAltDown()) { // Alt/Option for Mac _mouseConstrained = new MouseOnPlane(event,origin,plane,worldToPixel); } else { _mouseConstrained = new MouseOnLine(event,origin,normal,worldToPixel); } _origin = origin; _qa = _frame.getCornerMin(); _qb = _frame.getCornerMax(); } public void drag(DragContext dc) {
Axis axis = frame.getAxis(); if (_axis!=axis) updateSampling(axis,_sx,_sy,_sz);