⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 indexedgeometryarray.java

📁 JAVA3D矩陈的相关类
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
     * array object is not <code>BY_REFERENCE_INDICES</code>.     *     * @since Java 3D 1.5     */  public int[] getCoordIndicesRef() {	if (isLiveOrCompiled())	    if (!this.getCapability(ALLOW_REF_DATA_READ)) 		throw new CapabilityNotSetException(J3dI18N.getString("GeometryArray87"));	int format = ((IndexedGeometryArrayRetained)this.retained).vertexFormat;	if ((format & BY_REFERENCE_INDICES) == 0)	    throw new IllegalStateException(J3dI18N.getString("IndexedGeometryArray32"));      return ((IndexedGeometryArrayRetained)this.retained).getCoordIndicesRef();  }  /**   * Retrieves the color index associated with the vertex at   * the specified index for this object.   * @param index the vertex index   * @return the color index     * @exception CapabilityNotSetException if appropriate capability is     * not set and this object is part of live or compiled scene graph     *     * @exception NullPointerException if the <code>USE_COORD_INDEX_ONLY</code>     * bit is set in <code>vertexFormat</code>.   */  public int getColorIndex(int index) {    if (isLiveOrCompiled())    if(!this.getCapability(ALLOW_COLOR_INDEX_READ))      throw new CapabilityNotSetException(J3dI18N.getString("IndexedGeometryArray11"));      return ((IndexedGeometryArrayRetained)this.retained).getColorIndex(index);  }  /**   * Retrieves the color indices associated with the vertices starting at   * the specified index for this object. The color indicies are   * copied into the specified array. The array must be large enough   * to hold all of the indices.   * @param index the vertex index   * @param colorIndices array that will receive the color indices     * @exception CapabilityNotSetException if appropriate capability is     * not set and this object is part of live or compiled scene graph     *     * @exception NullPointerException if the <code>USE_COORD_INDEX_ONLY</code>     * bit is set in <code>vertexFormat</code>.   */  public void getColorIndices(int index, int colorIndices[]) {    if (isLiveOrCompiled())    if(!this.getCapability(ALLOW_COLOR_INDEX_READ))      throw new CapabilityNotSetException(J3dI18N.getString("IndexedGeometryArray11"));      ((IndexedGeometryArrayRetained)this.retained).getColorIndices(index, colorIndices);  }  /**   * Retrieves the normal index associated with the vertex at   * the specified index for this object.   * @param index the vertex index   * @return the normal index     * @exception CapabilityNotSetException if appropriate capability is     * not set and this object is part of live or compiled scene graph     *     * @exception NullPointerException if the <code>USE_COORD_INDEX_ONLY</code>     * bit is set in <code>vertexFormat</code>.   */  public int getNormalIndex(int index) {    if (isLiveOrCompiled())    if(!this.getCapability(ALLOW_NORMAL_INDEX_READ))      throw new CapabilityNotSetException(J3dI18N.getString("IndexedGeometryArray13"));      return ((IndexedGeometryArrayRetained)this.retained).getNormalIndex(index);  }  /**   * Retrieves the normal indices associated with the vertices starting at   * the specified index for this object. The normal indicies are   * copied into the specified array. The array must be large enough   * to hold all of the normal indicies.   *    * @param index the vertex index   * @param normalIndices array that will receive the normal indices     * @exception CapabilityNotSetException if appropriate capability is     * not set and this object is part of live or compiled scene graph     *     * @exception NullPointerException if the <code>USE_COORD_INDEX_ONLY</code>     * bit is set in <code>vertexFormat</code>.   */  public void getNormalIndices(int index, int normalIndices[]) {    if (isLiveOrCompiled())    if(!this.getCapability(ALLOW_NORMAL_INDEX_READ))      throw new CapabilityNotSetException(J3dI18N.getString("IndexedGeometryArray13"));      ((IndexedGeometryArrayRetained)this.retained).getNormalIndices(index, normalIndices);  }    /**     * @deprecated As of Java 3D version 1.2, replaced by     * <code>getTextureCoordinateIndex(int texCoordSet, ...)</code>     */    public int getTextureCoordinateIndex(int index) {	return (getTextureCoordinateIndex(0, index));    }    /**     * Retrieves the texture coordinate index associated with the vertex at     * the specified index in the specified texture coordinate set     * for this object.     *     * @param texCoordSet texture coordinate set in this geometry array     * @param index the vertex index     *     * @return the texture coordinate index     *     * @exception CapabilityNotSetException if appropriate capability is     * not set and this object is part of live or compiled scene graph     *     * @exception ArrayIndexOutOfBoundsException if neither of the     * <code>TEXTURE_COORDINATE</code> bits are set in the     * <code>vertexFormat</code> or if the index or     * texCoordSet is out of range.     *     * @exception NullPointerException if the <code>USE_COORD_INDEX_ONLY</code>     * bit is set in <code>vertexFormat</code>.     *     * @since Java 3D 1.2     */    public int getTextureCoordinateIndex(int texCoordSet, int index) {	if (isLiveOrCompiled())	    if(!this.getCapability(ALLOW_COORDINATE_INDEX_READ))		throw new CapabilityNotSetException(J3dI18N.getString("IndexedGeometryArray15"));	return ((IndexedGeometryArrayRetained)this.retained).getTextureCoordinateIndex(texCoordSet, index);    }    /**     * @deprecated As of Java 3D version 1.2, replaced by     * <code>getTextureCoordinateIndices(int texCoordSet, ...)</code>     */    public void getTextureCoordinateIndices(int index, int texCoordIndices[]) {	getTextureCoordinateIndices(0, index, texCoordIndices);    }    /**     * Retrieves the texture coordinate indices associated with the vertices     * starting at the specified index in the specified texture coordinate set     * for this object. The texture     * coordinate indices are copied into the specified array. The array     * must be large enough to hold all of the indices.     *     * @param texCoordSet texture coordinate set in this geometry array     * @param index the vertex index     * @param texCoordIndices array that will receive the texture coordinate      * indices     *     * @exception CapabilityNotSetException if appropriate capability is     * not set and this object is part of live or compiled scene graph     *     * @exception ArrayIndexOutOfBoundsException if neither of the     * <code>TEXTURE_COORDINATE</code> bits are set in the     * <code>vertexFormat</code> or if the index or     * texCoordSet is out of range.     *     * @exception NullPointerException if the <code>USE_COORD_INDEX_ONLY</code>     * bit is set in <code>vertexFormat</code>.     *     * @since Java 3D 1.2     */    public void getTextureCoordinateIndices(int texCoordSet,					    int index,					    int texCoordIndices[]) {	if (isLiveOrCompiled())	    if(!this.getCapability(ALLOW_COORDINATE_INDEX_READ))		throw new CapabilityNotSetException(J3dI18N.getString("IndexedGeometryArray15"));  	((IndexedGeometryArrayRetained)this.retained).getTextureCoordinateIndices(texCoordSet, index, texCoordIndices);    }    /**     * Retrieves the vertex attribute index associated with the vertex at     * the specified index for the specified vertex attribute number     * for this object.     *     * @param vertexAttrNum vertex attribute number in this geometry array     * @param index the vertex index     *     * @return the vertex attribute index     *     * @exception CapabilityNotSetException if appropriate capability is     * not set and this object is part of live or compiled scene graph     *     * @exception ArrayIndexOutOfBoundsException if the index or     * vertexAttrNum is out of range.     *     * @exception NullPointerException if the <code>USE_COORD_INDEX_ONLY</code>     * bit is set in <code>vertexFormat</code>.     *     * @since Java 3D 1.4     */    public int getVertexAttrIndex(int vertexAttrNum,                                  int index) {	if (isLiveOrCompiled()) {	    if(!this.getCapability(ALLOW_VERTEX_ATTR_INDEX_READ)) {		throw new CapabilityNotSetException(J3dI18N.getString("IndexedGeometryArray29"));            }        }	return ((IndexedGeometryArrayRetained)this.retained).getVertexAttrIndex(vertexAttrNum, index);    }    /**     * Retrieves the vertex attribute indices associated with the vertices     * starting at the specified index for the specified vertex attribute number     * for this object. The vertex attribute indices     * are copied into the specified array. The array     * must be large enough to hold all of the indices.     *     * @param vertexAttrNum vertex attribute number in this geometry array     * @param index the vertex index     * @param vertexAttrIndices array that will receive the vertex attribute indices     *     * @exception CapabilityNotSetException if appropriate capability is     * not set and this object is part of live or compiled scene graph     *     * @exception ArrayIndexOutOfBoundsException if the index or     * vertexAttrNum is out of range.     *     * @exception NullPointerException if the <code>USE_COORD_INDEX_ONLY</code>     * bit is set in <code>vertexFormat</code>.     *     * @since Java 3D 1.4     */    public void getVertexAttrIndices(int vertexAttrNum,                                     int index,                                     int[] vertexAttrIndices) {	if (isLiveOrCompiled()) {	    if(!this.getCapability(ALLOW_VERTEX_ATTR_INDEX_READ)) {		throw new CapabilityNotSetException(J3dI18N.getString("IndexedGeometryArray29"));            }        }  	((IndexedGeometryArrayRetained)this.retained).getVertexAttrIndices(vertexAttrNum, index, vertexAttrIndices);    }   /**     * 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);	// vertexFormat, vertexCount and indexCount are copied in 	//  subclass when constructor	//  public IndexedGeometryArray(int vertexCount, int vertexFormat, 	//                              int indexCount) 	// is used in cloneNodeComponent()	IndexedGeometryArrayRetained ga = 	    (IndexedGeometryArrayRetained) originalNodeComponent.retained;	IndexedGeometryArrayRetained rt = 	    (IndexedGeometryArrayRetained) retained;        int vformat = ga.getVertexFormat();        int buffer[] = new int[ga.getIndexCount()];        if ((vformat & COORDINATES) != 0) {            ga.getCoordinateIndices(0, buffer);            rt.setCoordinateIndices(0, buffer);        }        if ((vformat & USE_COORD_INDEX_ONLY) == 0) {            if ((vformat & NORMALS) != 0) {                ga.getNormalIndices(0, buffer);                rt.setNormalIndices(0, buffer);            }            if ((vformat & COLOR) != 0) {                ga.getColorIndices(0, buffer);                rt.setColorIndices(0, buffer);            }            if ((vformat & VERTEX_ATTRIBUTES) != 0) {                for (int i = 0; i < ga.vertexAttrCount; i++) {                    ga.getVertexAttrIndices(i, 0, buffer);                    rt.setVertexAttrIndices(i, 0, buffer);                }            }            if ((vformat & TEXTURE_COORDINATE) != 0) {                for (int i = 0; i < ga.texCoordSetCount; i++) {                    ga.getTextureCoordinateIndices(i, 0, buffer);                    rt.setTextureCoordinateIndices(i, 0, buffer);                }            }        }    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -