@Override synchronized void createMirrorObject() { if (mirror == null) { // we can't check isStatic() since it sub-NodeComponent // create a new one, we should create a // new AppearanceRetained() even though isStatic() = true. // For simplicity, always create a retained side. mirror = new AppearanceRetained(); } initMirrorObject(); }
@Override synchronized void addAMirrorUser(Shape3DRetained shape) { super.addAMirrorUser(shape); if (shaderProgram != null) shaderProgram.addAMirrorUser(shape); if (shaderAttributeSet != null) shaderAttributeSet.addAMirrorUser(shape); }
/** * sets the appearance and send a message */ void setAppearance(Appearance app) { if (appearance != null) synchronized(appearance.liveStateLock) { appearance.clearLive(refCount); } initAppearance(app); if (appearance != null) { synchronized(appearance.liveStateLock) { appearance.setLive(inBackgroundGroup, refCount); } } // There is no need to clone the appearance's mirror sendMessage(APPEARANCE_CHANGED, (appearance != null ? appearance.mirror: null)); }
@Override void setLive(boolean backgroundGroup, int refCount) { // System.err.println("AppearceRetained.setLive()"); doSetLive(backgroundGroup, refCount); markAsLive(); }
rt.setMaterial((Material) getNodeComponent(app.getMaterial(), forceDuplicate, hashtable)); rt.setColoringAttributes((ColoringAttributes) getNodeComponent( app.getColoringAttributes(), forceDuplicate, hashtable)); rt.setTransparencyAttributes((TransparencyAttributes) getNodeComponent( app.getTransparencyAttributes(), forceDuplicate, hashtable)); rt.setRenderingAttributes((RenderingAttributes) getNodeComponent( app.getRenderingAttributes(), forceDuplicate, hashtable)); rt.setPolygonAttributes((PolygonAttributes) getNodeComponent( app.getPolygonAttributes(), forceDuplicate, hashtable)); rt.setLineAttributes((LineAttributes) getNodeComponent( app.getLineAttributes(), forceDuplicate, hashtable));
nc = rt.getMaterial(); if ((nc != null) && nc.getDuplicateOnCloneTree()) return true; nc = rt.getColoringAttributes(); if ((nc != null) && nc.getDuplicateOnCloneTree()) return true; nc = rt.getTransparencyAttributes(); if ((nc != null) && nc.getDuplicateOnCloneTree()) return true; nc = rt.getPolygonAttributes(); if ((nc != null) && nc.getDuplicateOnCloneTree()) return true; nc = rt.getLineAttributes(); if ((nc != null) && nc.getDuplicateOnCloneTree()) return true; nc = rt.getPointAttributes(); if ((nc != null) && nc.getDuplicateOnCloneTree()) return true; nc = rt.getTexture(); if ((nc != null) && nc.duplicateChild()) return true; nc = rt.getTextureAttributes();
ra.geometryAtom.source.otherAppearance.sgApp.removeAMirrorUser(ra.geometryAtom.source); app.sgApp.addAMirrorUser(ra.geometryAtom.source);
this.appearance.clearLive(refCount); for (int i=mirrorShape3D.size()-1; i>=0; i--) { this.appearance.removeAMirrorUser( (Shape3DRetained)mirrorShape3D.get(i)); ((AppearanceRetained)newAppearance.retained).setLive(inBackgroundGroup, refCount); appearance = ((AppearanceRetained)newAppearance.retained); int size= mirrorShape3D.size(); for (int i=0; i<size; i++) { appearance.addAMirrorUser((Shape3DRetained)mirrorShape3D.get(i));
synchronized(appearance.liveStateLock) { if (k == 0) { // Do only first time appearance.setLive(inBackgroundGroup, s.refCount); appearance.initMirrorObject(); if (appearance.renderingAttributes != null) visible = appearance.renderingAttributes.visible; appearance.addAMirrorUser(sh);
synchronized(appearance.liveStateLock) { if (k == 0) { appearance.clearLive(s.refCount); appearance.removeAMirrorUser(sh);
if (appearance.getInImmCtx()) { throw new IllegalSharingException(J3dI18N.getString("AlternateAppearanceRetained14")); appearance.setLive(inBackgroundGroup, s.refCount);
/** * Creates the retained mode AppearanceRetained object that this * Appearance component object will point to. */ @Override void createRetained() { this.retained = new AppearanceRetained(); this.retained.setSource(this); }
@Override public boolean equals(Object obj) { return ((obj instanceof AppearanceRetained) && equals((AppearanceRetained) obj)); }
/** * This clearLive routine first calls the superclass's method, then * it removes itself to the list of lights */ @Override void clearLive(int refCount) { super.clearLive(refCount); if (shaderProgram != null) { shaderProgram.clearLive(refCount); } if (shaderAttributeSet != null) { shaderAttributeSet.clearLive(refCount); } }
@Override void compile(CompileState compState) { super.compile(compState); if (shaderProgram != null) { shaderProgram.compile(compState); } if (shaderAttributeSet != null) { shaderAttributeSet.compile(compState); } }
/** * This method calls the setLive method of all appearance bundle * objects. */ @Override void doSetLive(boolean backgroundGroup, int refCount) { // System.err.println("ShaderAppearceRetained.doSetLive()"); if (shaderProgram != null) { shaderProgram.setLive(backgroundGroup, refCount); } if (shaderAttributeSet != null) { shaderAttributeSet.setLive(backgroundGroup, refCount); } // Increment the reference count and initialize the appearance // mirror object super.doSetLive(backgroundGroup, refCount); }
/** * Retrieves the current coloringAttributes object. * @return the coloringAttributes object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public ColoringAttributes getColoringAttributes() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COLORING_ATTRIBUTES_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance7")); return ((AppearanceRetained)this.retained).getColoringAttributes(); }
/** * Retrieves the current lineAttributes object. * @return the lineAttributes object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public LineAttributes getLineAttributes() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_LINE_ATTRIBUTES_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance15")); return ((AppearanceRetained)this.retained).getLineAttributes(); }
/** * Retrieves the current material object. * @return the material object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public Material getMaterial() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_MATERIAL_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance1")); return ((AppearanceRetained)this.retained).getMaterial(); }