📄 texture2d.java
字号:
public ImageComponent2D getDetailImage() { if (isLiveOrCompiled()) { if (!this.getCapability(ALLOW_DETAIL_TEXTURE_READ)) { throw new CapabilityNotSetException( J3dI18N.getString("Texture2D0")); } } return ((Texture2DRetained)this.retained).getDetailImage(); } /** * @deprecated As of Java 3D 1.5 the optional detail texture feature is no * longer supported. * * @param mode detail texture mode. One of: DETAIL_ADD or DETAIL_MODULATE * * @exception IllegalArgumentException if * <code>mode</code> is a value other than * <code>DETAIL_ADD</code>, or <code>DETAIL_MODULATE</code> * @exception RestrictedAccessException if the method is called * when this object is part of live or compiled scene graph. * * @since Java 3D 1.3 * @see Canvas3D#queryProperties */ public void setDetailTextureMode(int mode) { checkForLiveOrCompiled(); if ((mode != DETAIL_ADD) && (mode != DETAIL_MODULATE)) { throw new IllegalArgumentException( J3dI18N.getString("Texture2D1")); } ((Texture2DRetained)this.retained).initDetailTextureMode(mode); } /** * @deprecated As of Java 3D 1.5 the optional detail texture feature is no * longer supported. * * @return the detail texture mode. * * @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 getDetailTextureMode() { if (isLiveOrCompiled()) { if (!this.getCapability(ALLOW_DETAIL_TEXTURE_READ)) { throw new CapabilityNotSetException( J3dI18N.getString("Texture2D0")); } } return ((Texture2DRetained)this.retained).getDetailTextureMode(); } /** * @deprecated As of Java 3D 1.5 the optional detail texture feature is no * longer supported. * * @param level the detail texture level. * * @exception IllegalArgumentException if <code>level</code> < 0 * @exception RestrictedAccessException if the method is called * when this object is part of live or compiled scene graph. * * @since Java 3D 1.3 * @see Canvas3D#queryProperties */ public void setDetailTextureLevel(int level) { checkForLiveOrCompiled(); if (level < 0) { throw new IllegalArgumentException( J3dI18N.getString("Texture2D2")); } ((Texture2DRetained)this.retained).initDetailTextureLevel(level); } /** * @deprecated As of Java 3D 1.5 the optional detail texture feature is no * longer supported. * * @return the detail texture level. * * @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 getDetailTextureLevel() { if (isLiveOrCompiled()) { if (!this.getCapability(ALLOW_DETAIL_TEXTURE_READ)) { throw new CapabilityNotSetException( J3dI18N.getString("Texture2D0")); } } return ((Texture2DRetained)this.retained).getDetailTextureLevel(); } /** * @deprecated As of Java 3D 1.5 the optional detail texture feature is no * longer supported. * * @param lod array containing the level-of-detail values. * @param pts array containing the function values for the corresponding * level-of-detail values. * * @exception IllegalStateException if the length of <code>lod</code> * does not match the length of <code>pts</code> * @exception RestrictedAccessException if the method is called * when this object is part of live or compiled scene graph. * * @since Java 3D 1.3 * @see Canvas3D#queryProperties */ public void setDetailTextureFunc(float[] lod, float[] pts) { checkForLiveOrCompiled(); if (((lod != null) && (pts != null) && (lod.length == pts.length)) || ((lod == null) && (pts == null))) { ((Texture2DRetained)this.retained).initDetailTextureFunc(lod, pts); } else { throw new IllegalStateException(J3dI18N.getString("Texture2D3")); } } /** * @deprecated As of Java 3D 1.5 the optional detail texture feature is no * longer supported. * * @param pts array of Point2f containing the lod as well as the * corresponding function value. * * @exception RestrictedAccessException if the method is called * when this object is part of live or compiled scene graph. * * @since Java 3D 1.3 * @see Canvas3D#queryProperties */ public void setDetailTextureFunc(Point2f[] pts) { checkForLiveOrCompiled(); ((Texture2DRetained)this.retained).initDetailTextureFunc(pts); } /** * @deprecated As of Java 3D 1.5 the optional detail texture feature is no * longer supported. * * @return the number of points in the detail texture LOD function. * * @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 getDetailTextureFuncPointsCount() { if (isLiveOrCompiled()) { if (!this.getCapability(ALLOW_DETAIL_TEXTURE_READ)) { throw new CapabilityNotSetException( J3dI18N.getString("Texture2D0")); } } return ((Texture2DRetained)this.retained).getDetailTextureFuncPointsCount(); } /** * @deprecated As of Java 3D 1.5 the optional detail texture feature is no * longer supported. * * @param lod the array to receive the level-of-detail values. * @param pts the array to receive the function values for the * corresponding level-of-detail values. * * @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 getDetailTextureFunc(float[] lod, float[] pts) { if (isLiveOrCompiled()) { if (!this.getCapability(ALLOW_DETAIL_TEXTURE_READ)) { throw new CapabilityNotSetException( J3dI18N.getString("Texture2D0")); } } ((Texture2DRetained)this.retained).getDetailTextureFunc(lod, pts); } /** * @deprecated As of Java 3D 1.5 the optional detail texture feature is no * longer supported. * * @param pts the array to receive the detail texture LOD function points * * @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 getDetailTextureFunc(Point2f[] pts) { if (isLiveOrCompiled()) { if (!this.getCapability(ALLOW_DETAIL_TEXTURE_READ)) { throw new CapabilityNotSetException( J3dI18N.getString("Texture2D0")); } } ((Texture2DRetained)this.retained).getDetailTextureFunc(pts); } /** * Creates a retained mode Texture2DRetained object that this * Texture2D component object will point to. */ void createRetained() { this.retained = new Texture2DRetained(); this.retained.setSource(this); } /** * @deprecated replaced with cloneNodeComponent(boolean forceDuplicate) */ public NodeComponent cloneNodeComponent() { Texture2DRetained t2d = (Texture2DRetained) retained; Texture2D t = new Texture2D(t2d.getMipMapMode(), t2d.format, t2d.width, t2d.height); t.duplicateNodeComponent(this); return t; } /** * NOTE: Applications should <i>not</i> call this method directly. * It should only be called by the cloneNode method. * * @deprecated replaced with duplicateNodeComponent( * NodeComponent originalNodeComponent, boolean forceDuplicate) */ public void duplicateNodeComponent(NodeComponent originalNodeComponent) { checkDuplicateNodeComponent(originalNodeComponent); } /** * Copies all node information from <code>originalNodeComponent</code> into * the current node. This method is called from the * <code>duplicateNode</code> method. This routine does * the actual duplication of all "local data" (any data defined in * this object). * * @param originalNodeComponent the original node to duplicate. * @param forceDuplicate when set to <code>true</code>, causes the * <code>duplicateOnCloneTree</code> flag to be ignored. When * <code>false</code>, the value of each node's * <code>duplicateOnCloneTree</code> variable determines whether * NodeComponent data is duplicated or copied. * * @see Node#cloneTree * @see NodeComponent#setDuplicateOnCloneTree */ void duplicateAttributes(NodeComponent originalNodeComponent, boolean forceDuplicate) { super.duplicateAttributes(originalNodeComponent, forceDuplicate); Texture2DRetained tex = (Texture2DRetained) originalNodeComponent.retained; Texture2DRetained rt = (Texture2DRetained) retained; rt.initDetailImage(tex.getDetailImage()); rt.initDetailTextureMode(tex.getDetailTextureMode()); rt.initDetailTextureLevel(tex.getDetailTextureLevel()); rt.initDetailTextureFunc(tex.getDetailTextureFunc()); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -