/** * Returns a reference to any item that is Pickable below this BranchGroup that * intersects with <code>pickShape</code>. * @param pickShape the PickShape object * * @see SceneGraphPath * @see Locale#pickAny * @see PickShape * @exception IllegalStateException if BranchGroup is not live. * */ public SceneGraphPath pickAny( PickShape pickShape ) { if(isLive()==false) throw new IllegalStateException(J3dI18N.getString("BranchGroup3")); return ((BranchGroupRetained)this.retained).pickAny(pickShape); }
/** * Returns an array referencing all the items that are pickable below this * <code>BranchGroup</code> that intersect with PickShape. * The resultant array is unordered. * * @param pickShape the PickShape object * * @see SceneGraphPath * @see Locale#pickAll * @see PickShape * @exception IllegalStateException if BranchGroup is not live. * */ public SceneGraphPath[] pickAll( PickShape pickShape ) { if(isLive()==false) throw new IllegalStateException(J3dI18N.getString("BranchGroup3")); return ((BranchGroupRetained)this.retained).pickAll(pickShape); }
/** * Returns a SceneGraphPath that references the pickable item * closest to the origin of <code>pickShape</code>. * * Note: If pickShape is of type PickBounds, the return is any pickable node * below this BranchGroup. * @param pickShape the PickShape object * * @see SceneGraphPath * @see Locale#pickClosest * @see PickShape * @exception IllegalStateException if BranchGroup is not live. * */ public SceneGraphPath pickClosest( PickShape pickShape ) { if(isLive()==false) throw new IllegalStateException(J3dI18N.getString("BranchGroup3")); return ((BranchGroupRetained)this.retained).pickClosest(pickShape); }
/** * Returns a sorted array of references to all the Pickable items that * intersect with the pickShape. Element [0] references the item closest * to <i>origin</i> of PickShape successive array elements are further * from the <i>origin</i> * * Note: If pickShape is of type PickBounds, the resulting array * is unordered. * @param pickShape the PickShape object * * @see SceneGraphPath * @see Locale#pickAllSorted * @see PickShape * @exception IllegalStateException if BranchGroup is not live. * */ public SceneGraphPath[] pickAllSorted( PickShape pickShape ) { if(isLive()==false) throw new IllegalStateException(J3dI18N.getString("BranchGroup3")); return ((BranchGroupRetained)this.retained).pickAllSorted(pickShape); }
void validateModeFlagAndPickShape(int mode, int flags, PickShape pickShape) { if(isLive()==false) { throw new IllegalStateException(J3dI18N.getString("BranchGroup3")); } if((mode != PickInfo.PICK_BOUNDS) && (mode != PickInfo.PICK_GEOMETRY)) { throw new IllegalArgumentException(J3dI18N.getString("BranchGroup4")); } if((pickShape instanceof PickPoint) && (mode == PickInfo.PICK_GEOMETRY)) { throw new IllegalArgumentException(J3dI18N.getString("BranchGroup5")); } if(((flags & PickInfo.CLOSEST_GEOM_INFO) != 0) && ((flags & PickInfo.ALL_GEOM_INFO) != 0)) { throw new IllegalArgumentException(J3dI18N.getString("BranchGroup6")); } if((mode == PickInfo.PICK_BOUNDS) && (((flags & (PickInfo.CLOSEST_GEOM_INFO | PickInfo.ALL_GEOM_INFO | PickInfo.CLOSEST_DISTANCE | PickInfo.CLOSEST_INTERSECTION_POINT)) != 0))) { throw new IllegalArgumentException(J3dI18N.getString("BranchGroup7")); } if((pickShape instanceof PickBounds) && (((flags & (PickInfo.CLOSEST_GEOM_INFO | PickInfo.ALL_GEOM_INFO | PickInfo.CLOSEST_DISTANCE | PickInfo.CLOSEST_INTERSECTION_POINT)) != 0))) { throw new IllegalArgumentException(J3dI18N.getString("BranchGroup8")); } }
/** * Compiles the source BranchGroup associated with this object and * creates and caches a compiled scene graph. * @exception SceneGraphCycleException if there is a cycle in the * scene graph * @exception RestrictedAccessException if the method is called * when this object is part of a live scene graph. */ public void compile() { if (isLive()) { throw new RestrictedAccessException( J3dI18N.getString("BranchGroup0")); } if (isCompiled() == false) { // will throw SceneGraphCycleException if there is a cycle // in the scene graph checkForCycle(); ((BranchGroupRetained)this.retained).compile(); } }
/** * Add a new branch graph rooted at BranchGroup to * the list of branch graphs. * @param branchGroup root of the branch graph to be added * @exception IllegalStateException if this Locale has been * removed from its VirtualUniverse. * @exception MultipleParentException if the specified BranchGroup node * is already live. */ public void addBranchGraph(BranchGroup branchGroup){ if (universe == null) { throw new IllegalStateException(J3dI18N.getString("Locale4")); } // if the BranchGroup already has a parent, or has already been // added to a locale, throw MultipleParentException if ((((BranchGroupRetained)branchGroup.retained).parent != null) || (branchGroup.isLive())) { throw new MultipleParentException(J3dI18N.getString("Locale0")); } universe.notifyStructureChangeListeners(true, this, branchGroup); universe.resetWaitMCFlag(); synchronized (universe.sceneGraphLock) { doAddBranchGraph(branchGroup); universe.setLiveState.reset(this); } universe.waitForMC(); }
J3dMessage destroyMessage; if (!branchGroup.isLive()) return; bgr.attachedToLocale = false;