void setAppearanceOverrideEnable(boolean flag) { if (((Shape3D)this.source).isLive()) { // Send a message J3dMessage createMessage = new J3dMessage(); createMessage.threads = targetThreads; createMessage.type = J3dMessage.SHAPE3D_CHANGED; createMessage.universe = universe; createMessage.args[0] = this; createMessage.args[1]= new Integer(APPEARANCEOVERRIDE_CHANGED); Shape3DRetained[] s3dArr = new Shape3DRetained[mirrorShape3D.size()]; mirrorShape3D.toArray(s3dArr); createMessage.args[2] = s3dArr; Object[] obj = new Object[2]; if (flag) { obj[0] = Boolean.TRUE; } else { obj[0] = Boolean.FALSE; } obj[1] = new Integer(changedFrequent); createMessage.args[3] = obj; createMessage.args[4] = getGeomAtomsArray(mirrorShape3D); VirtualUniverse.mc.processMessage(createMessage); } appearanceOverrideEnable = flag; }
void removeAllGeometries() { int n = geometryList.size(); int i; Shape3DRetained mShape; GeometryRetained oldGeom = null; if (((Shape3D)this.source).isLive()) { for(int index = n-1; index >= 0; index--) { oldGeom = geometryList.get(index); if (oldGeom != null) { oldGeom.clearLive(refCount); oldGeom.decRefCnt(); for (i=0; i<mirrorShape3D.size(); i++) { mShape = mirrorShape3D.get(i); oldGeom.removeUser(mShape); } } geometryList.remove(index); } sendDataChangedMessage(null); } else { for(int index = n-1; index >= 0; index--) { oldGeom = geometryList.get(index); if (oldGeom != null) { oldGeom.decRefCnt(); } geometryList.remove(index); } } dirtyBoundsCache(); }
if(((Shape3D)this.source).isLive()) { if (geometry != null) {
GeometryRetained oldGeom = null; if (((Shape3D)this.source).isLive()) {
boolean visibleIsDirty = false; if (((Shape3D)this.source).isLive()) { if (appearance != null) { appearance.clearLive(refCount);
if (((Shape3D)this.source).isLive()) {
if (((Shape3D)this.source).isLive()) {
/** * Draw the specified Shape3D leaf node object. This is * a convenience method that is identical to calling the * setAppearance(Appearance) and draw(Geometry) methods * passing the appearance and geometry component objects of * the specified shape node as arguments. * * @param shape the Shape3D node containing the Appearance component * object to set and Geometry component object to draw * * @exception IllegalSharingException if the Shape3D node * is part of or is subsequently made part of a live scene graph. * * @exception IllegalSharingException if the Shape3D node's Appearance * refers to an ImageComponent2D that is being used by a * Canvas3D as an off-screen buffer. */ public void draw(Shape3D shape) { if (shape.isLive()) { throw new IllegalSharingException(J3dI18N.getString("GraphicsContext3D26")); } ((Shape3DRetained)shape.retained).setInImmCtx(true); setAppearance(shape.getAppearance()); draw(shape.getGeometry()); }