📄 appearance.java
字号:
* 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(); } /** * Sets the coloringAttributes object to the specified object. * Setting it to null will result in default attribute usage. * @param coloringAttributes object that specifies the desired * coloringAttributes parameters * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void setColoringAttributes(ColoringAttributes coloringAttributes) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COLORING_ATTRIBUTES_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance6")); ((AppearanceRetained)this.retained).setColoringAttributes(coloringAttributes); } /** * 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(); } /** * Sets the transparencyAttributes object to the specified object. * Setting it to null will result in default attribute usage. * @param transparencyAttributes object that specifies the desired * transparencyAttributes parameters * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void setTransparencyAttributes(TransparencyAttributes transparencyAttributes) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_TRANSPARENCY_ATTRIBUTES_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance8")); ((AppearanceRetained)this.retained).setTransparencyAttributes(transparencyAttributes); } /** * Retrieves the current transparencyAttributes object. * @return the transparencyAttributes object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public TransparencyAttributes getTransparencyAttributes() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_TRANSPARENCY_ATTRIBUTES_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance9")); return ((AppearanceRetained)this.retained).getTransparencyAttributes(); } /** * Sets the renderingAttributes object to the specified object. * Setting it to null will result in default attribute usage. * @param renderingAttributes object that specifies the desired * renderingAttributes parameters * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void setRenderingAttributes(RenderingAttributes renderingAttributes) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_RENDERING_ATTRIBUTES_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance10")); ((AppearanceRetained)this.retained).setRenderingAttributes(renderingAttributes); } /** * Retrieves the current renderingAttributes object. * @return the renderingAttributes object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public RenderingAttributes getRenderingAttributes() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_RENDERING_ATTRIBUTES_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance11")); return ((AppearanceRetained)this.retained).getRenderingAttributes(); } /** * Sets the polygonAttributes object to the specified object. * Setting it to null will result in default attribute usage. * @param polygonAttributes object that specifies the desired * polygonAttributes parameters * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void setPolygonAttributes(PolygonAttributes polygonAttributes) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_POLYGON_ATTRIBUTES_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance12")); ((AppearanceRetained)this.retained).setPolygonAttributes(polygonAttributes); } /** * Retrieves the current polygonAttributes object. * @return the polygonAttributes object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public PolygonAttributes getPolygonAttributes() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_POLYGON_ATTRIBUTES_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance13")); return ((AppearanceRetained)this.retained).getPolygonAttributes(); } /** * Sets the lineAttributes object to the specified object. * Setting it to null will result in default attribute usage. * @param lineAttributes object that specifies the desired * lineAttributes parameters * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void setLineAttributes(LineAttributes lineAttributes) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_LINE_ATTRIBUTES_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance14")); ((AppearanceRetained)this.retained).setLineAttributes(lineAttributes); } /** * 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(); } /** * Sets the pointAttributes object to the specified object. * Setting it to null will result in default attribute usage. * @param pointAttributes object that specifies the desired * pointAttributes parameters * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void setPointAttributes(PointAttributes pointAttributes) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_POINT_ATTRIBUTES_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance16")); ((AppearanceRetained)this.retained).setPointAttributes(pointAttributes); } /** * Retrieves the current pointAttributes object. * @return the pointAttributes object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public PointAttributes getPointAttributes() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_POINT_ATTRIBUTES_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance17")); return ((AppearanceRetained)this.retained).getPointAttributes(); } /** * Sets the texture object to the specified object. * Setting it to null disables texture mapping. * * <p> * Applications must not set individual texture component objects * (texture, textureAttributes, or texCoordGeneration) and * the texture unit state array in the same Appearance object. * Doing so will result in an exception being thrown. * * @param texture object that specifies the desired texture * map and texture parameters * * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @exception IllegalStateException if the specified texture * object is non-null and the texture unit state array in this * appearance object is already non-null. * * @exception IllegalSharingException if this Appearance is live and * the specified texture refers to an ImageComponent2D that is being used * by a Canvas3D as an off-screen buffer. * * @exception IllegalSharingException if this Appearance is * being used by an immediate mode context and * the specified texture refers to an ImageComponent2D that is being used * by a Canvas3D as an off-screen buffer. */ public void setTexture(Texture texture) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_TEXTURE_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance2")); // Do illegal sharing check if(texture != null) { ImageComponent[] images = ((TextureRetained)(texture.retained)).getImages(); if(images != null) { for(int i=0; i<images.length; i++) { validateImageIllegalSharing(images[i]); } } } ((AppearanceRetained)this.retained).setTexture(texture); } /** * Retrieves the current texture object. * @return the texture object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public Texture getTexture() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_TEXTURE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance3")); return ((AppearanceRetained)this.retained).getTexture(); } /** * Sets the textureAttributes object to the specified object. * Setting it to null will result in default attribute usage. * * <p> * Applications must not set individual texture component objects * (texture, textureAttributes, or texCoordGeneration) and * the texture unit state array in the same Appearance object. * Doing so will result in an exception being thrown. * * @param textureAttributes object that specifies the desired * textureAttributes map and textureAttributes parameters * * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @exception IllegalStateException if the specified textureAttributes * object is non-null and the texture unit state array in this * appearance object is already non-null. */ public void setTextureAttributes(TextureAttributes textureAttributes) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_TEXTURE_ATTRIBUTES_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance4")); ((AppearanceRetained)this.retained).setTextureAttributes(textureAttributes); } /** * Retrieves the current textureAttributes object. * @return the textureAttributes object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public TextureAttributes getTextureAttributes() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_TEXTURE_ATTRIBUTES_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance5")); return ((AppearanceRetained)this.retained).getTextureAttributes(); } /** * Sets the texCoordGeneration object to the specified object. * Setting it to null disables texture coordinate generation. * * <p> * Applications must not set individual texture component objects * (texture, textureAttributes, or texCoordGeneration) and * the texture unit state array in the same Appearance object. * Doing so will result in an exception being thrown. * * @param texCoordGeneration object that specifies the texture coordinate * generation parameters * * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @exception IllegalStateException if the specified texCoordGeneration * object is non-null and the texture unit state array in this * appearance object is already non-null. */ public void setTexCoordGeneration(TexCoordGeneration texCoordGeneration) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_TEXGEN_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance18")); ((AppearanceRetained)this.retained).setTexCoordGeneration(texCoordGeneration); } /** * Retrieves the current texCoordGeneration object. * @return the texCoordGeneration object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public TexCoordGeneration getTexCoordGeneration() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_TEXGEN_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance19")); return ((AppearanceRetained)this.retained).getTexCoordGeneration(); } /** * Sets the texture unit state array for this appearance object to the * specified array. A shallow copy of the array of references to * the TextureUnitState objects is made. If the specified array * is null or if the length of the array is 0, multi-texture is * disabled. Within the array, a null TextureUnitState element * disables the corresponding texture unit. * * <p> * Applications must not set individual texture component objects * (texture, textureAttributes, or texCoordGeneration) and * the texture unit state array in the same Appearance object. * Doing so will result in an exception being thrown. * * @param stateArray array of TextureUnitState objects that * specify the desired texture state for each unit. The length of * this array specifies the maximum number of texture units that * will be used by this appearance object. The texture units are
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -