/** * Copies the transform component of this TransformGroup into * the passed transform object. * @param t1 the transform object to be copied into * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void getTransform(Transform3D t1) { if (isLiveOrCompiled()) if(!this.getCapability(ALLOW_TRANSFORM_READ)) throw new CapabilityNotSetException(J3dI18N.getString("TransformGroup2")); ((TransformGroupRetained)this.retained).getTransform(t1); }
/** * Update the scene to manipulate any nodes. This is not meant to be * called by users. Behavior automatically calls this. You can call * this only if you know what you are doing. * * @param xpos Current mouse X pos. * @param ypos Current mouse Y pos. **/ @Override public void updateScene(int xpos, int ypos){ TransformGroup tg = null; if (mevent.isAltDown() && !mevent.isMetaDown()){ tg =(TransformGroup)pickScene.pickNode(pickScene.pickClosest(xpos, ypos, pickMode), PickObject.TRANSFORM_GROUP); // Check for valid selection if ((tg != null) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_READ)) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_WRITE))){ zoom.setTransformGroup(tg); zoom.wakeup(); currentTG = tg; } else if (callback!=null) callback.transformChanged( PickingCallback.NO_PICK, null ); } }
/** * Update the scene to manipulate any nodes. This is not meant to be * called by users. Behavior automatically calls this. You can call * this only if you know what you are doing. * * @param xpos Current mouse X pos. * @param ypos Current mouse Y pos. **/ @Override public void updateScene(int xpos, int ypos){ TransformGroup tg = null; if (!mevent.isAltDown() && mevent.isMetaDown()){ tg =(TransformGroup)pickScene.pickNode(pickScene.pickClosest(xpos, ypos, pickMode), PickObject.TRANSFORM_GROUP); //Check for valid selection. if ((tg != null) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_READ)) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_WRITE))){ translate.setTransformGroup(tg); translate.wakeup(); currentTG = tg; } else if (callback!=null) callback.transformChanged( PickingCallback.NO_PICK, null ); } }
/** * Update the scene to manipulate any nodes. This is not meant to be * called by users. Behavior automatically calls this. You can call * this only if you know what you are doing. * * @param xpos Current mouse X pos. * @param ypos Current mouse Y pos. **/ @Override public void updateScene(int xpos, int ypos){ TransformGroup tg = null; if (!mevent.isMetaDown() && !mevent.isAltDown()){ // tg = (TransformGroup) pickScene.pickNode(pickScene.pickClosest(xpos, ypos), // PickObject.TRANSFORM_GROUP); tg =(TransformGroup)pickScene.pickNode(pickScene.pickClosest(xpos, ypos,pickMode), PickObject.TRANSFORM_GROUP); // Make sure the selection exists and is movable. if ((tg != null) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_READ)) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_WRITE))){ drag.setTransformGroup(tg); drag.wakeup(); currentTG = tg; } else if (callback!=null) callback.transformChanged( PickingCallback.NO_PICK, null ); } }
/** * Update the scene to manipulate any nodes. This is not meant to be * called by users. Behavior automatically calls this. You can call * this only if you know what you are doing. * * @param xpos Current mouse X pos. * @param ypos Current mouse Y pos. **/ @Override public void updateScene(int xpos, int ypos){ TransformGroup tg = null; if (mevent.isAltDown() && !mevent.isMetaDown()){ pickCanvas.setShapeLocation(xpos, ypos); PickResult pr = pickCanvas.pickClosest(); if ((pr != null) && ((tg = (TransformGroup)pr.getNode(PickResult.TRANSFORM_GROUP)) != null) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_READ)) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_WRITE))){ zoom.setTransformGroup(tg); zoom.wakeup(); currentTG = tg; // Need to clean up Issue 123 --- Chien // freePickResult(pr); } else if (callback!=null) callback.transformChanged( PickingCallback.NO_PICK, null ); } }
/** * Update the scene to manipulate any nodes. This is not meant to be * called by users. Behavior automatically calls this. You can call * this only if you know what you are doing. * * @param xpos Current mouse X pos. * @param ypos Current mouse Y pos. **/ @Override public void updateScene(int xpos, int ypos){ TransformGroup tg = null; if (!mevent.isAltDown() && mevent.isMetaDown()){ pickCanvas.setShapeLocation(xpos, ypos); PickResult pr = pickCanvas.pickClosest(); if ((pr != null) && ((tg = (TransformGroup)pr.getNode(PickResult.TRANSFORM_GROUP)) != null) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_READ)) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_WRITE))){ translate.setTransformGroup(tg); translate.wakeup(); currentTG = tg; // Need to clean up Issue 123 --- Chien // freePickResult(pr); } else if (callback!=null) callback.transformChanged( PickingCallback.NO_PICK, null ); } }
/** * Update the scene to manipulate any nodes. This is not meant to be * called by users. Behavior automatically calls this. You can call * this only if you know what you are doing. * * @param xpos Current mouse X pos. * @param ypos Current mouse Y pos. **/ @Override public void updateScene(int xpos, int ypos){ TransformGroup tg = null; if (!mevent.isMetaDown() && !mevent.isAltDown()){ pickCanvas.setShapeLocation(xpos, ypos); PickResult pr = pickCanvas.pickClosest(); if ((pr != null) && ((tg = (TransformGroup)pr.getNode(PickResult.TRANSFORM_GROUP)) != null) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_READ)) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_WRITE))){ drag.setTransformGroup(tg); drag.wakeup(); currentTG = tg; // free the PickResult // Need to clean up Issue 123 --- Chien // freePickResult(pr); } else if (callback!=null) callback.transformChanged( PickingCallback.NO_PICK, null ); } }
/** * Update the scene to manipulate any nodes. This is not meant to be * called by users. Behavior automatically calls this. You can call * this only if you know what you are doing. * * @param xpos Current mouse X pos. * @param ypos Current mouse Y pos. **/ @Override public void updateScene(int xpos, int ypos){ TransformGroup tg = null; if(!mevent.isAltDown() && mevent.isMetaDown()){ pickCanvas.setShapeLocation(xpos, ypos); // System.out.println("PickTranslateBeh : using pickfast pkg : PickInfo ..."); pickCanvas.setFlags(PickInfo.NODE | PickInfo.SCENEGRAPHPATH); PickInfo pickInfo = pickCanvas.pickClosest(); if(pickInfo != null) { // System.out.println("Intersected!"); tg = (TransformGroup) pickCanvas.getNode(pickInfo, PickTool.TYPE_TRANSFORM_GROUP); if((tg != null) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_READ)) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_WRITE))) { translate.setTransformGroup(tg); translate.wakeup(); currentTG = tg; } } else if (callback!=null) callback.transformChanged( PickingCallback.NO_PICK, null ); } }
/** * Update the scene to manipulate any nodes. This is not meant to be * called by users. Behavior automatically calls this. You can call * this only if you know what you are doing. * * @param xpos Current mouse X pos. * @param ypos Current mouse Y pos. **/ @Override public void updateScene(int xpos, int ypos) { TransformGroup tg = null; if (!mevent.isMetaDown() && !mevent.isAltDown()){ // System.out.println("PickRotateBeh : using pickfast pkg : PickInfo ..."); pickCanvas.setFlags(PickInfo.NODE | PickInfo.SCENEGRAPHPATH); pickCanvas.setShapeLocation(xpos, ypos); PickInfo pickInfo = pickCanvas.pickClosest(); if(pickInfo != null) { // System.out.println("Intersected!"); tg = (TransformGroup) pickCanvas.getNode(pickInfo, PickTool.TYPE_TRANSFORM_GROUP); if((tg != null) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_READ)) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_WRITE))) { rotate.setTransformGroup(tg); rotate.wakeup(); currentTG = tg; } } else if (callback!=null) callback.transformChanged( PickingCallback.NO_PICK, null ); } }
/** * Update the scene to manipulate any nodes. This is not meant to be * called by users. Behavior automatically calls this. You can call * this only if you know what you are doing. * * @param xpos Current mouse X pos. * @param ypos Current mouse Y pos. **/ @Override public void updateScene(int xpos, int ypos){ TransformGroup tg = null; if (mevent.isAltDown() && !mevent.isMetaDown()){ pickCanvas.setShapeLocation(xpos, ypos); // System.out.println("PickZoomBeh : using pickfast pkg : PickInfo ..."); pickCanvas.setFlags(PickInfo.NODE | PickInfo.SCENEGRAPHPATH); PickInfo pickInfo = pickCanvas.pickClosest(); if(pickInfo != null) { // System.out.println("Intersected!"); tg = (TransformGroup) pickCanvas.getNode(pickInfo, PickTool.TYPE_TRANSFORM_GROUP); if((tg != null) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_READ)) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_WRITE))) { zoom.setTransformGroup(tg); zoom.wakeup(); currentTG = tg; } } else if (callback!=null) callback.transformChanged( PickingCallback.NO_PICK, null ); } }
/** * Sets the transform component of this TransformGroup to the value of * the passed transform. * @param t1 the transform to be copied * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * @exception BadTransformException if the transform is not affine. */ public void setTransform(Transform3D t1) { if (isLiveOrCompiled()) if(!this.getCapability(ALLOW_TRANSFORM_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("TransformGroup1")); if (!t1.isAffine()) { throw new BadTransformException(J3dI18N.getString("TransformGroup0")); } ((TransformGroupRetained)this.retained).setTransform(t1); }