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

📄 indexedgeometryarrayretained.java

📁 JAVA3D矩陈的相关类
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
    }    /**     * Sets the color index associated with the vertex at     * the specified index for this object.     * @param index the vertex index     * @param colorIndex the new color index     */    final void setColorIndex(int index, int colorIndex) {	int newMax = maxColorIndex;        newMax = doIndexCheck(index, maxColorIndex, indexColor, colorIndex);        if (newMax > maxColorIndex) {            doColorCheck(newMax);        }        geomLock.getLock();        // No need to set INDEX_CHANGED since IndexBuffer        // is used only when USE_COORD_INDEX_ONLY specified.        // In this case only coordinate index array is         // considered.        this.indexColor[index] = colorIndex;        maxColorIndex = newMax;        geomLock.unLock();        if (!inUpdater && source != null && source.isLive()) {            sendDataChangedMessage(false);        }    }    /**     * Sets the color indices associated with the vertices starting at     * the specified index for this object.     * @param index the vertex index     * @param colorIndices an array of color indices     */    final void setColorIndices(int index, int colorIndices[]) {	int i, j, num = colorIndices.length;	int newMax;        newMax = doIndicesCheck(index, maxColorIndex, indexColor, colorIndices);        if (newMax > maxColorIndex) {            doColorCheck(newMax);        }        geomLock.getLock();        maxColorIndex = newMax;        for (i=0, j = index; i < num;i++, j++) {            this.indexColor[j] = colorIndices[i];        }        geomLock.unLock();        if (!inUpdater && source != null && source.isLive()) {            sendDataChangedMessage(false);        }    }    /**     * Sets the normal index associated with the vertex at     * the specified index for this object.     * @param index the vertex index     * @param normalIndex the new normal index     */    final void setNormalIndex(int index, int normalIndex) {	int newMax;        newMax = doIndexCheck(index, maxNormalIndex, indexNormal, normalIndex);        if (newMax > maxNormalIndex) {            doNormalCheck(newMax);        }        geomLock.getLock();        maxNormalIndex = newMax;        this.indexNormal[index] = normalIndex;        geomLock.unLock();        if (!inUpdater && source != null && source.isLive()) {            sendDataChangedMessage(false);        }    }    /**     * Sets the normal indices associated with the vertices starting at     * the specified index for this object.     * @param index the vertex index     * @param normalIndices an array of normal indices     */    final void setNormalIndices(int index, int normalIndices[]) {	int i, j, num = normalIndices.length;	int newMax;        newMax = doIndicesCheck(index, maxNormalIndex, indexNormal, normalIndices);        if (newMax > maxNormalIndex) {            doNormalCheck(newMax);        }        geomLock.getLock();        for (i=0, j = index; i < num;i++, j++) {            this.indexNormal[j] = normalIndices[i];        }        maxNormalIndex = newMax;        geomLock.unLock();        if (!inUpdater && source != null && source.isLive()) {            sendDataChangedMessage(false);        }    }    /**     * Sets the texture coordinate index associated with the vertex at     * the specified index for this object.     * @param texCoordSet the texture coordinate set     * @param index the vertex index     * @param texCoordIndex the new texture coordinate index     */    final void setTextureCoordinateIndex(int texCoordSet, int index, int texCoordIndex) {	int newMax;	int [] indices = this.indexTexCoord[texCoordSet];        newMax = doIndexCheck(index, maxTexCoordIndices[texCoordSet],indices, texCoordIndex);        if (newMax > maxTexCoordIndices[texCoordSet]) {            doTexCoordCheck(newMax, texCoordSet);        }        geomLock.getLock();        maxTexCoordIndices[texCoordSet] = newMax;        indices[index] = texCoordIndex;        geomLock.unLock();        if (!inUpdater && source != null && source.isLive()) {            sendDataChangedMessage(false);        }    }    /**     * Sets the texture coordinate indices associated with the vertices     * starting at the specified index for this object.     * @param texCoordSet the texture coordinate set     * @param index the vertex index     * @param texCoordIndices an array of texture coordinate indices     */    final void setTextureCoordinateIndices(int texCoordSet, int index, int texCoordIndices[]) {        int i, j, num = texCoordIndices.length;        int [] indices = this.indexTexCoord[texCoordSet];        int newMax;        newMax = doIndicesCheck(index, maxTexCoordIndices[texCoordSet], indices, texCoordIndices);        if (newMax > maxTexCoordIndices[texCoordSet]) {            doTexCoordCheck(newMax, texCoordSet);        }        geomLock.getLock();        maxTexCoordIndices[texCoordSet] = newMax;        for (i=0, j = index; i < num;i++, j++) {            indices[j] = texCoordIndices[i];        }        geomLock.unLock();        if (!inUpdater && source != null && source.isLive()) {            sendDataChangedMessage(false);        }    }    /**     * Sets the vertex attribute index associated with the vertex at     * the specified index for the specified vertex attribute number     * for this object.     */    void setVertexAttrIndex(int vertexAttrNum,                            int index,                            int vertexAttrIndex) {	int newMax;	int [] indices = this.indexVertexAttr[vertexAttrNum];        newMax = doIndexCheck(index, maxVertexAttrIndices[vertexAttrNum],indices, vertexAttrIndex);        if (newMax > maxVertexAttrIndices[vertexAttrNum]) {            doVertexAttrCheck(newMax, vertexAttrNum);        }        geomLock.getLock();        maxVertexAttrIndices[vertexAttrNum] = newMax;        indices[index] = vertexAttrIndex;        geomLock.unLock();        if (!inUpdater && source != null && source.isLive()) {            sendDataChangedMessage(false);        }    }    /**     * Sets the vertex attribute indices associated with the vertices     * starting at the specified index for the specified vertex attribute number     * for this object.     */    void setVertexAttrIndices(int vertexAttrNum,                              int index,                              int[] vertexAttrIndices) {          int i, j, num = vertexAttrIndices.length;        int [] indices = this.indexVertexAttr[vertexAttrNum];        int newMax;        newMax = doIndicesCheck(index, maxVertexAttrIndices[vertexAttrNum], indices, vertexAttrIndices);        if (newMax > maxVertexAttrIndices[vertexAttrNum]) {            doVertexAttrCheck(newMax, vertexAttrNum);        }        geomLock.getLock();        maxVertexAttrIndices[vertexAttrNum] = newMax;        for (i=0, j = index; i < num;i++, j++) {            indices[j] = vertexAttrIndices[i];        }        geomLock.unLock();        if (!inUpdater && source != null && source.isLive()) {            sendDataChangedMessage(false);        }    }    /**     * Retrieves the coordinate index associated with the vertex at     * the specified index for this object.     * @param index the vertex index     * @return the coordinate index     */    final int getCoordinateIndex(int index) {	return this.indexCoord[index];    }    /**     * Retrieves the coordinate indices associated with the vertices starting at     * the specified index for this object.     * @param index the vertex index     * @param coordinateIndices array that will receive the coordinate indices     */    final void getCoordinateIndices(int index, int coordinateIndices[]) {        int i, j, num = coordinateIndices.length;        for (i=0, j = index;i < num;i++, j++) {            coordinateIndices[i] = this.indexCoord[j];        }    }    //NVaidya    /**     * Returns a reference to the coordinate indices associated      * with the vertices     */    final int[] getCoordIndicesRef() {        return this.indexCoord;    }    /**     * Retrieves the color index associated with the vertex at     * the specified index for this object.     * @param index the vertex index     * @return the color index     */    final int getColorIndex(int index) {	return this.indexColor[index];    }    /**     * Retrieves the color indices associated with the vertices starting at     * the specified index for this object.     * @param index the vertex index     * @param colorIndices array that will receive the color indices     */    final void getColorIndices(int index, int colorIndices[]) {        int i, j, num = colorIndices.length;        for (i=0, j = index;i < num;i++, j++) {            colorIndices[i] = this.indexColor[j];        }    }    /**     * Retrieves the normal index associated with the vertex at     * the specified index for this object.     * @param index the vertex index     * @return the normal index     */    final int getNormalIndex(int index) {	return this.indexNormal[index];    }    /**     * Retrieves the normal indices associated with the vertices starting at     * the specified index for this object.     * @param index the vertex index     * @param normalIndices array that will receive the normal indices     */    final void getNormalIndices(int index, int normalIndices[]) {        int i, j, num = normalIndices.length;        for (i=0, j = index;i < num;i++, j++) {            normalIndices[i] = this.indexNormal[j];        }    }    /**     * Retrieves the texture coordinate index associated with the vertex at     * the specified index for this object.     * @param texCoordSet the texture coordinate set     * @param index the vertex index     * @return the texture coordinate index     */    final int getTextureCoordinateIndex(int texCoordSet, int index) {	int [] indices = this.indexTexCoord[texCoordSet];        return indices[index];    }    /**     * Retrieves the texture coordinate indices associated with the vertices     * starting at the specified index for this object.     * @param texCoordSet the texture coordinate set     * @param index the vertex index     * @param texCoordIndices array that will receive the texture coordinate indices     */    final void getTextureCoordinateIndices(int texCoordSet, int index, int texCoordIndices[]) {        int i, j, num = texCoordIndices.length;        int [] indices = this.indexTexCoord[texCoordSet];        for (i=0, j = index;i < num;i++, j++) {            texCoordIndices[i] = indices[j];        }    }    /**     * Retrieves the vertex attribute index associated with the vertex at     * the specified index for the specified vertex attribute number     * for this object.     */    int getVertexAttrIndex(int vertexAttrNum,                           int index) {        int [] indices = this.indexVertexAttr[vertexAttrNum];        return indices[index];    }    /**     * Retrieves the vertex attribute indices associated with the vertices     * starting at the specified index for the specified vertex attribute number     * for this object.     */    void getVertexAttrIndices(int vertexAttrNum,                              int index,                              int[] vertexAttrIndices) {        int i, j, num = vertexAttrIndices.length;        int [] indices = this.indexVertexAttr[vertexAttrNum];        for (i=0, j = index;i < num;i++, j++) {            vertexAttrIndices[i] = indices[j];        }    }    void execute(Canvas3D cv, RenderAtom ra, boolean isNonUniformScale, 		 boolean updateAlpha, float alpha,		 int screen, boolean ignoreVertexColors) {	int cdirty;	boolean useAlpha = false;	Object[] retVal;	if (mirrorGeometry != null) {	    mirrorGeometry.execute(cv, ra, isNonUniformScale, updateAlpha, alpha,				   screen, ignoreVertexColors);	    return;	}        // Check if index array is null; if yes, don't draw anything        if (indexCoord == null) {            return;        }        //By reference with java array	if ((vertexFormat & GeometryArray.USE_NIO_BUFFER) == 0) {	    if ((vertexFormat & GeometryArray.BY_REFERENCE) == 0) {		float[] vdata;

⌨️ 快捷键说明

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