/** * Retrieves the appearance component of this shape node. * @return the appearance component of this shape node * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public Appearance getAppearance() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_APPEARANCE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D5")); return ((Shape3DRetained)this.retained).getAppearance(); }
/** * Returns the collision bounding object of this node. * @return the node's collision bounding object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public Bounds getCollisionBounds() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COLLISION_BOUNDS_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D1")); return ((Shape3DRetained)this.retained).getCollisionBounds(id); }
/** * Retrieves the geometry component at index 0 from this Shape3D node's * list of geometry components. * @return the geometry component at index 0. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public Geometry getGeometry() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_GEOMETRY_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D3")); return ((Shape3DRetained)retained).getGeometry(0, id); }
/** * Sets the collision bounds of a node. * @param bounds the collision bounding object for a node * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void setCollisionBounds(Bounds bounds) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COLLISION_BOUNDS_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D0")); ((Shape3DRetained)this.retained).setCollisionBounds(bounds); }
/** * Sets the appearance component of this Shape3D node. Setting it to null * specifies that default values are used for all appearance attributes. * @param appearance the new appearance component for this shape node * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void setAppearance(Appearance appearance) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_APPEARANCE_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D4")); ((Shape3DRetained)this.retained).setAppearance(appearance); }
/** * Retrieves the appearanceOverrideEnable flag for this node. * @return true if the appearance can be overridden; false * otherwise. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @since Java 3D 1.2 */ public boolean getAppearanceOverrideEnable() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_APPEARANCE_OVERRIDE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D9")); return ((Shape3DRetained)this.retained).getAppearanceOverrideEnable(); }
/** * Removes all geometry components from this Shape3D node. * * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @since Java 3D 1.3 */ public void removeAllGeometries() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_GEOMETRY_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D2")); ((Shape3DRetained)retained).removeAllGeometries(); }
/** * Returns an enumeration of this Shape3D node's list of geometry * components. * @return an Enumeration object containing all geometry components in * this Shape3D node's list of geometry components. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @since Java 3D 1.2 */ public Enumeration getAllGeometries() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_GEOMETRY_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D3")); return ((Shape3DRetained)retained).getAllGeometries(id); }
/** * Removes the geometry component at the specified index from * this Shape3D node's list of geometry components. * @param index the index of the geometry component to be removed. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @since Java 3D 1.2 */ public void removeGeometry(int index) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_GEOMETRY_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D2")); ((Shape3DRetained)retained).removeGeometry(index); }
/** * Retrieves the index of the specified geometry component in * this Shape3D node's list of geometry components. * * @param geometry the geometry component to be looked up. * @return the index of the specified geometry component; * returns -1 if the object is not in the list. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @since Java 3D 1.3 */ public int indexOfGeometry(Geometry geometry) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_GEOMETRY_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D3")); return ((Shape3DRetained)retained).indexOfGeometry(geometry); }
/** * Retrieves the geometry component at the specified index from * this Shape3D node's list of geometry components. * @param index the index of the geometry component to be returned. * @return the geometry component at the specified index. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @since Java 3D 1.2 */ public Geometry getGeometry(int index) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_GEOMETRY_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D3")); return ((Shape3DRetained)retained).getGeometry(index, id); }
/** * Returns the number of geometry components in this Shape3D node's * list of geometry components. * @return the number of geometry components in this Shape3D node's * list of geometry components. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @since Java 3D 1.2 */ public int numGeometries() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_GEOMETRY_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D3")); return ((Shape3DRetained)retained).numGeometries(id); }
/** * Removes the specified geometry component from this * Shape3D node's list of geometry components. * If the specified object is not in the list, the list is not modified. * * @param geometry the geometry component to be removed. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @since Java 3D 1.3 */ public void removeGeometry(Geometry geometry) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_GEOMETRY_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D2")); ((Shape3DRetained)retained).removeGeometry(geometry); }
/** * Sets a flag that indicates whether this node's appearance can * be overridden. If the flag is true, then this node's * appearance may be overridden by an AlternateAppearance leaf * node, regardless of the value of the ALLOW_APPEARANCE_WRITE * capability bit. * The default value is false. * * @param flag the apperance override enable flag. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @see AlternateAppearance * * @since Java 3D 1.2 */ public void setAppearanceOverrideEnable(boolean flag) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_APPEARANCE_OVERRIDE_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D8")); ((Shape3DRetained)this.retained).setAppearanceOverrideEnable(flag); }
/** * Replaces the geometry component at index 0 in this Shape3D node's * list of geometry components with the specified geometry component. * If there are existing geometry components in the list (besides * the one being replaced), the new geometry component must be of * the same equivalence class (point, line, polygon, CompressedGeometry, * Raster, Text3D) as the others. * @param geometry the geometry component to be stored at index 0. * @exception IllegalArgumentException if the new geometry * component is not of of the same equivalence class as the * existing geometry components. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void setGeometry(Geometry geometry) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_GEOMETRY_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D2")); ((Shape3DRetained)retained).setGeometry(geometry, 0); }
/** * Checks whether the geometry in this shape node intersects with * the specified pickRay. * * @param path the SceneGraphPath to this shape node * @param pickRay the PickRay to be intersected * @param dist the closest distance of the intersection * * @return true if the pick shape intersects this node; false * otherwise. If true, dist contains the closest distance of * intersection. * * @exception CapabilityNotSetException if the Geometry.ALLOW_INTERSECT * capability bit is not set in all of the Geometry objects * referred to by this shape node. */ public boolean intersect(SceneGraphPath path, PickRay pickRay, double[] dist) { if (isLiveOrCompiled()) { if (!((Shape3DRetained)retained).allowIntersect()) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D6")); } return ((Shape3DRetained)this.retained).intersect(path, pickRay, dist); }
/** * See parent class for the documentation on getBounds(). */ @Override public Bounds getBounds() { if (isLiveOrCompiled()) { if(!this.getCapability(ALLOW_BOUNDS_READ)) { throw new CapabilityNotSetException(J3dI18N.getString("Node2")); } } else { // this will throw a SceneGraphCycleException if there is // a cycle checkForCycle(); } return ((Shape3DRetained)this.retained).getBounds(); }
/** * Appends the specified geometry component to this Shape3D * node's list of geometry components. * If there are existing geometry components in the list, the new * geometry component must be of the same equivalence class * (point, line, polygon, CompressedGeometry, Raster, Text3D) as * the others. * @param geometry the geometry component to be appended. * @exception IllegalArgumentException if the new geometry * component is not of of the same equivalence class as the * existing geometry components. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @since Java 3D 1.2 */ public void addGeometry(Geometry geometry) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_GEOMETRY_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D2")); ((Shape3DRetained)retained).addGeometry(geometry); }
/** * Inserts the specified geometry component into this Shape3D * node's list of geometry components at the specified index. * If there are existing geometry components in the list, the new * geometry component must be of the same equivalence class * (point, line, polygon, CompressedGeometry, Raster, Text3D) as * the others. * @param geometry the geometry component to be inserted at the * specified index. * @param index the index at which the geometry component is inserted. * @exception IllegalArgumentException if the new geometry * component is not of of the same equivalence class as the * existing geometry components. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @since Java 3D 1.2 */ public void insertGeometry(Geometry geometry, int index) { if (isLiveOrCompiled()) if(!this.getCapability(ALLOW_GEOMETRY_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D2")); ((Shape3DRetained)retained).insertGeometry(geometry, index); }
/** * Replaces the geometry component at the specified index in this * Shape3D node's list of geometry components with the specified * geometry component. * If there are existing geometry components in the list (besides * the one being replaced), the new geometry component must be of * the same equivalence class (point, line, polygon, CompressedGeometry, * Raster, Text3D) as the others. * @param geometry the geometry component to be stored at the * specified index. * @param index the index of the geometry component to be replaced. * @exception IllegalArgumentException if the new geometry * component is not of of the same equivalence class as the * existing geometry components. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @since Java 3D 1.2 */ public void setGeometry(Geometry geometry, int index) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_GEOMETRY_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Shape3D2")); ((Shape3DRetained)retained).setGeometry(geometry, index); }