0001: /*
0002: * $RCSfile: GeometryArray.java,v $
0003: *
0004: * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
0005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0006: *
0007: * This code is free software; you can redistribute it and/or modify it
0008: * under the terms of the GNU General Public License version 2 only, as
0009: * published by the Free Software Foundation. Sun designates this
0010: * particular file as subject to the "Classpath" exception as provided
0011: * by Sun in the LICENSE file that accompanied this code.
0012: *
0013: * This code is distributed in the hope that it will be useful, but WITHOUT
0014: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0015: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0016: * version 2 for more details (a copy is included in the LICENSE file that
0017: * accompanied this code).
0018: *
0019: * You should have received a copy of the GNU General Public License version
0020: * 2 along with this work; if not, write to the Free Software Foundation,
0021: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0022: *
0023: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0024: * CA 95054 USA or visit www.sun.com if you need additional information or
0025: * have any questions.
0026: *
0027: * $Revision: 1.7 $
0028: * $Date: 2008/02/28 20:17:21 $
0029: * $State: Exp $
0030: */
0031:
0032: package javax.media.j3d;
0033:
0034: import javax.vecmath.*;
0035:
0036: /**
0037: * The GeometryArray object contains separate arrays of positional
0038: * coordinates, colors, normals, texture coordinates, and vertex
0039: * attributes that
0040: * describe point, line, or polygon geometry. This class is extended
0041: * to create the various primitive types (such as lines,
0042: * triangle strips, etc.).
0043: * Vertex data may be passed to this geometry array in one of two
0044: * ways: by copying the data into the array using the existing
0045: * methods, or by passing a reference to the data.
0046: * <p>
0047: * <ul>
0048: * <li>
0049: * <b>By Copying:</b>
0050: * The existing methods for setting positional coordinates, colors,
0051: * normals, texture coordinates, and vertex attributes
0052: * (such as <code>setCoordinate</code>,
0053: * <code>setColors</code>, etc.) copy the data into this
0054: * GeometryArray. This is appropriate for many applications and
0055: * offers an application much flexibility in organizing its data.
0056: * This is the default mode.
0057: * </li>
0058: * <li><b>By Reference:</b>
0059: * A new set of methods in Java 3D version 1.2 allows data to be
0060: * accessed by reference, directly from the user's arrays. To use
0061: * this feature, set the <code>BY_REFERENCE</code> bit in the
0062: * <code>vertexFormat</code> field of the constructor for this
0063: * GeometryArray. In this mode, the various set methods for
0064: * coordinates, normals, colors, texture coordinates, and vertex attributes
0065: * are not used.
0066: * Instead, new methods are used to set a reference to user-supplied
0067: * coordinate, color, normal, texture coordinate, and vertex attribute
0068: * arrays (such as
0069: * <code>setCoordRefFloat</code>, <code>setColorRefFloat</code>,
0070: * etc.). Data in any array that is referenced by a live or compiled
0071: * GeometryArray object may only be modified via the
0072: * <code>updateData</code> method (subject to the
0073: * <code>ALLOW_REF_DATA_WRITE</code> capability bit). Applications
0074: * must exercise care not to violate this rule. If any referenced
0075: * geometry data is modified outside of the <code>updateData</code>
0076: * method, the results are undefined.
0077: * </li>
0078: * </ul>
0079: * <p>
0080: * All colors used in the geometry array object must be in the range [0.0,1.0].
0081: * Values outside this range will cause undefined results.
0082: * All normals used in the geometry array object must be unit length
0083: * vectors. That is their geometric length must be 1.0. Normals that
0084: * are not unit length vectors will cause undefined results.
0085: * <p>
0086: * Note that the term <i>coordinate</i>, as used in the method names
0087: * and method descriptions, actually refers to a set of <i>x</i>,
0088: * <i>y</i>, and <i>z</i> coordinates representing the position of a
0089: * single vertex. The term <i>coordinates</i> (plural) is used to
0090: * indicate sets of <i>x</i>, <i>y</i>, and <i>z</i> coordinates for
0091: * multiple vertices. This is somewhat at odds with the mathematical
0092: * definition of a coordinate, but is used as a convenient shorthand.
0093: * Similarly, the term <i>texture coordinate</i> is used to indicate a
0094: * set of texture coordinates for a single vertex, while the term
0095: * <i>texture coordinates</i> (plural) is used to indicate sets of
0096: * texture coordinates for multiple vertices.
0097: */
0098:
0099: public abstract class GeometryArray extends Geometry {
0100:
0101: /**
0102: * Specifies that this GeometryArray allows reading the array of
0103: * coordinates.
0104: */
0105: public static final int ALLOW_COORDINATE_READ = CapabilityBits.GEOMETRY_ARRAY_ALLOW_COORDINATE_READ;
0106:
0107: /**
0108: * Specifies that this GeometryArray allows writing the array of
0109: * coordinates.
0110: */
0111: public static final int ALLOW_COORDINATE_WRITE = CapabilityBits.GEOMETRY_ARRAY_ALLOW_COORDINATE_WRITE;
0112:
0113: /**
0114: * Specifies that this GeometryArray allows reading the array of
0115: * colors.
0116: */
0117: public static final int ALLOW_COLOR_READ = CapabilityBits.GEOMETRY_ARRAY_ALLOW_COLOR_READ;
0118:
0119: /**
0120: * Specifies that this GeometryArray allows writing the array of
0121: * colors.
0122: */
0123: public static final int ALLOW_COLOR_WRITE = CapabilityBits.GEOMETRY_ARRAY_ALLOW_COLOR_WRITE;
0124:
0125: /**
0126: * Specifies that this GeometryArray allows reading the array of
0127: * normals.
0128: */
0129: public static final int ALLOW_NORMAL_READ = CapabilityBits.GEOMETRY_ARRAY_ALLOW_NORMAL_READ;
0130:
0131: /**
0132: * Specifies that this GeometryArray allows writing the array of
0133: * normals.
0134: */
0135: public static final int ALLOW_NORMAL_WRITE = CapabilityBits.GEOMETRY_ARRAY_ALLOW_NORMAL_WRITE;
0136:
0137: /**
0138: * Specifies that this GeometryArray allows reading the array of
0139: * texture coordinates.
0140: */
0141: public static final int ALLOW_TEXCOORD_READ = CapabilityBits.GEOMETRY_ARRAY_ALLOW_TEXCOORD_READ;
0142:
0143: /**
0144: * Specifies that this GeometryArray allows writing the array of
0145: * texture coordinates.
0146: */
0147: public static final int ALLOW_TEXCOORD_WRITE = CapabilityBits.GEOMETRY_ARRAY_ALLOW_TEXCOORD_WRITE;
0148:
0149: /**
0150: * Specifies that this GeometryArray allows reading the array of
0151: * vertex attributes.
0152: *
0153: * @since Java 3D 1.4
0154: */
0155: public static final int ALLOW_VERTEX_ATTR_READ = CapabilityBits.GEOMETRY_ARRAY_ALLOW_VERTEX_ATTR_READ;
0156:
0157: /**
0158: * Specifies that this GeometryArray allows writing the array of
0159: * vertex attributes.
0160: *
0161: * @since Java 3D 1.4
0162: */
0163: public static final int ALLOW_VERTEX_ATTR_WRITE = CapabilityBits.GEOMETRY_ARRAY_ALLOW_VERTEX_ATTR_WRITE;
0164:
0165: /**
0166: * Specifies that this GeometryArray allows reading the count or
0167: * initial index information for this object.
0168: */
0169: public static final int ALLOW_COUNT_READ = CapabilityBits.GEOMETRY_ARRAY_ALLOW_COUNT_READ;
0170:
0171: /**
0172: * Specifies that this GeometryArray allows writing the count or
0173: * initial index information for this object.
0174: *
0175: * @since Java 3D 1.2
0176: */
0177: public static final int ALLOW_COUNT_WRITE = CapabilityBits.GEOMETRY_ARRAY_ALLOW_COUNT_WRITE;
0178:
0179: /**
0180: * Specifies that this GeometryArray allows reading the vertex format
0181: * information for this object.
0182: */
0183: public static final int ALLOW_FORMAT_READ = CapabilityBits.GEOMETRY_ARRAY_ALLOW_FORMAT_READ;
0184:
0185: /**
0186: * Specifies that this GeometryArray allows reading the geometry
0187: * data reference information for this object. This is only used in
0188: * by-reference geometry mode.
0189: *
0190: * @since Java 3D 1.2
0191: */
0192: public static final int ALLOW_REF_DATA_READ = CapabilityBits.GEOMETRY_ARRAY_ALLOW_REF_DATA_READ;
0193:
0194: private static final int J3D_1_2_ALLOW_REF_DATA_READ = CapabilityBits.J3D_1_2_GEOMETRY_ARRAY_ALLOW_REF_DATA_READ;
0195:
0196: /**
0197: * Specifies that this GeometryArray allows writing the geometry
0198: * data reference information for this object. It also enables
0199: * writing the referenced data itself, via the GeometryUpdater
0200: * interface. This is only used in by-reference geometry mode.
0201: *
0202: * @since Java 3D 1.2
0203: */
0204: public static final int ALLOW_REF_DATA_WRITE = CapabilityBits.GEOMETRY_ARRAY_ALLOW_REF_DATA_WRITE;
0205:
0206: /**
0207: * Specifies that this GeometryArray contains an array of coordinates.
0208: * This bit must be set.
0209: */
0210: public static final int COORDINATES = 0x01;
0211:
0212: /**
0213: * Specifies that this GeometryArray contains an array of normals.
0214: */
0215: public static final int NORMALS = 0x02;
0216:
0217: /**
0218: * Specifies that this GeometryArray contains an array of colors.
0219: */
0220: static final int COLOR = 0x04;
0221:
0222: /**
0223: * Specifies that this GeometryArray's colors contain alpha.
0224: */
0225: static final int WITH_ALPHA = 0x08;
0226:
0227: /**
0228: * Specifies that this GeometryArray contains an array of colors without alpha.
0229: */
0230: public static final int COLOR_3 = COLOR;
0231:
0232: /**
0233: * Specifies that this GeometryArray contains an array of colors with alpha.
0234: * This takes precedence over COLOR_3.
0235: */
0236: public static final int COLOR_4 = COLOR | WITH_ALPHA;
0237:
0238: /**
0239: * Specifies that this GeometryArray contains one or more arrays of
0240: * 2D texture coordinates.
0241: */
0242: public static final int TEXTURE_COORDINATE_2 = 0x20;
0243:
0244: /**
0245: * Specifies that this GeometryArray contains one or more arrays of
0246: * 3D texture coordinates.
0247: * This takes precedence over TEXTURE_COORDINATE_2.
0248: */
0249: public static final int TEXTURE_COORDINATE_3 = 0x40;
0250:
0251: /**
0252: * Specifies that this GeometryArray contains one or more arrays of
0253: * 4D texture coordinates.
0254: * This takes precedence over TEXTURE_COORDINATE_2 and TEXTURE_COORDINATE_3.
0255: *
0256: * @since Java 3D 1.3
0257: */
0258: public static final int TEXTURE_COORDINATE_4 = 0x400;
0259:
0260: static final int TEXTURE_COORDINATE = TEXTURE_COORDINATE_2
0261: | TEXTURE_COORDINATE_3 | TEXTURE_COORDINATE_4;
0262:
0263: /**
0264: * Specifies that the position, color, normal, and texture coordinate
0265: * data for this GeometryArray are accessed by reference.
0266: *
0267: * @since Java 3D 1.2
0268: */
0269: public static final int BY_REFERENCE = 0x80;
0270:
0271: /**
0272: * Specifies that the position, color, normal, and texture
0273: * coordinate data for this GeometryArray are accessed via a single
0274: * interleaved, floating-point array reference. All of the data
0275: * values for each vertex are stored in consecutive memory
0276: * locations. This flag is only valid in conjunction with the
0277: * <code>BY_REFERENCE</code> flag.
0278: *
0279: * @since Java 3D 1.2
0280: */
0281: public static final int INTERLEAVED = 0x100;
0282:
0283: /**
0284: * Specifies that geometry by-reference data for this
0285: * GeometryArray, whether interleaved or non-interleaved, is
0286: * accessed via J3DBuffer objects that wrap NIO Buffer objects,
0287: * rather than float, double, byte, or TupleXX arrays. This flag
0288: * is only valid in conjunction with the <code>BY_REFERENCE</code>
0289: * flag.
0290: *
0291: * @see J3DBuffer
0292: * @see #setCoordRefBuffer(J3DBuffer)
0293: * @see #setColorRefBuffer(J3DBuffer)
0294: * @see #setNormalRefBuffer(J3DBuffer)
0295: * @see #setTexCoordRefBuffer(int,J3DBuffer)
0296: * @see #setVertexAttrRefBuffer(int,J3DBuffer)
0297: * @see #setInterleavedVertexBuffer(J3DBuffer)
0298: *
0299: * @since Java 3D 1.3
0300: */
0301: public static final int USE_NIO_BUFFER = 0x800;
0302:
0303: /**
0304: * Specifies that only the coordinate indices are used for indexed
0305: * geometry arrays. In this mode, the values from the coordinate
0306: * index array are used as a single set of index values to access
0307: * the vertex data for all five vertex components (coord, color,
0308: * normal, texCoord, and vertexAttr). The color, normal, texCoord,
0309: * and vertexAttr index arrays are neither allocated nor used. Any
0310: * attempt to access the color, normal, texCoord,
0311: * or vertexAttr index arrays will result in a NullPointerException.
0312: * This flag is only valid for indexed geometry arrays
0313: * (subclasses of IndexedGeometryArray).
0314: *
0315: * @since Java 3D 1.3
0316: */
0317: public static final int USE_COORD_INDEX_ONLY = 0x200;
0318:
0319: /**
0320: * Specifies that this GeometryArray contains one or more arrays of
0321: * vertex attributes. These attributes are used in programmable
0322: * shading.
0323: *
0324: * @since Java 3D 1.4
0325: */
0326: public static final int VERTEX_ATTRIBUTES = 0x1000;
0327:
0328: //NVaidya
0329: /**
0330: * Specifies that the indices in this GeometryArray
0331: * are accessed by reference. This flag is only valid for
0332: * indexed geometry arrays (subclasses of IndexedGeometryArray) and only
0333: * when used in conjunction with the <code>BY_REFERENCE</code> and
0334: * <code>USE_COORD_INDEX_ONLY</code> flags.
0335: *
0336: * @since Java 3D 1.5
0337: */
0338: public static final int BY_REFERENCE_INDICES = 0x2000;
0339:
0340: // Used to keep track of the last bit (for adding new bits only)
0341: private static final int LAST_FORMAT_BIT = 0x2000;
0342:
0343: // Scratch arrays for converting Point[234]f to TexCoord[234]f
0344: private TexCoord2f[] texCoord2fArray = null;
0345: private TexCoord3f[] texCoord3fArray = null;
0346: private TexCoord4f[] texCoord4fArray = null;
0347: private TexCoord2f texCoord2fScratch = null;
0348: private TexCoord3f texCoord3fScratch = null;
0349:
0350: private static final int[] defTexCoordMap = { 0 };
0351:
0352: // Array for setting default read capabilities
0353: private static final int[] readCapabilities = { ALLOW_COLOR_READ,
0354: ALLOW_COORDINATE_READ, ALLOW_COUNT_READ, ALLOW_FORMAT_READ,
0355: ALLOW_NORMAL_READ, ALLOW_REF_DATA_READ,
0356: ALLOW_TEXCOORD_READ, ALLOW_VERTEX_ATTR_READ };
0357:
0358: // non-public, no parameter constructor
0359: GeometryArray() {
0360: // set default read capabilities
0361: setDefaultReadCapabilities(readCapabilities);
0362: }
0363:
0364: //NVaidya
0365: /**
0366: * Constructs an empty GeometryArray object with the specified
0367: * number of vertices and vertex format. Defaults are used
0368: * for all other parameters. The default values are as follows:
0369: * <ul>
0370: * texCoordSetCount : 1<br>
0371: * texCoordSetMap : { 0 }<br>
0372: * vertexAttrCount : 0<br>
0373: * vertexAttrSizes : null<br>
0374: * validVertexCount : vertexCount<br>
0375: * initialVertexIndex : 0<br>
0376: * initialCoordIndex : 0<br>
0377: * initialColorIndex : 0<br>
0378: * initialNormalIndex : 0<br>
0379: * initialTexCoordIndex : 0<br>
0380: * initialVertexAttrIndex : 0<br>
0381: * all data array values : 0.0<br>
0382: * all data array references : null<br>
0383: * </ul>
0384: *
0385: * @param vertexCount the number of vertex elements in this GeometryArray
0386: * @param vertexFormat a mask indicating which components are
0387: * present in each vertex. This is specified as one or more
0388: * individual flags that are bitwise "OR"ed together to describe
0389: * the per-vertex data.
0390: * The flags include: <code>COORDINATES</code>, to signal the inclusion of
0391: * vertex positions--always present; <code>NORMALS</code>, to signal
0392: * the inclusion of per vertex normals; one of <code>COLOR_3</code> or
0393: * <code>COLOR_4</code>, to signal the inclusion of per vertex
0394: * colors (without or with alpha information); one of
0395: * <code>TEXTURE_COORDINATE_2</code>, <code>TEXTURE_COORDINATE_3</code>
0396: * or <code>TEXTURE_COORDINATE_4</code>,
0397: * to signal the
0398: * inclusion of per-vertex texture coordinates (2D, 3D or 4D);
0399: * <code>BY_REFERENCE</code>, to indicate that the data is passed
0400: * by reference
0401: * rather than by copying; <code>INTERLEAVED</code>, to indicate
0402: * that the referenced
0403: * data is interleaved in a single array;
0404: * <code>USE_NIO_BUFFER</code>, to indicate that the referenced data
0405: * is accessed via a J3DBuffer object that wraps an NIO buffer;
0406: * <code>USE_COORD_INDEX_ONLY</code>,
0407: * to indicate that only the coordinate indices are used for indexed
0408: * geometry arrays;
0409: * <code>BY_REFERENCE_INDICES</code>, to indicate
0410: * that the indices are accessed by reference in indexed
0411: * geometry arrays.<p>
0412: *
0413: * @exception IllegalArgumentException if vertexCount < 0
0414: *
0415: * @exception IllegalArgumentException if vertexFormat does <b>not</b>
0416: * include <code>COORDINATES</code>
0417: *
0418: * @exception IllegalArgumentException if the <code>USE_COORD_INDEX_ONLY</code>
0419: * bit or the <code>BY_REFERENCE_INDICES</code> bit is set for
0420: * non-indexed geometry arrays (that is, GeometryArray objects
0421: * that are not a subclass of IndexedGeometryArray)
0422: *
0423: * @exception IllegalArgumentException if the <code>INTERLEAVED</code>
0424: * bit is set without the <code>BY_REFERENCE</code> bit being set
0425: *
0426: * @exception IllegalArgumentException if the <code>USE_NIO_BUFFER</code>
0427: * bit is set without the <code>BY_REFERENCE</code> bit being set
0428: *
0429: * @exception IllegalArgumentException if the <code>INTERLEAVED</code>
0430: * bit and the <code>VERTEX_ATTRIBUTES</code> bit are both set
0431: *
0432: * @exception IllegalArgumentException if the
0433: * <code>BY_REFERENCE_INDICES</code>
0434: * bit is set without the <code>BY_REFERENCE</code> and
0435: * <code>USE_COORD_INDEX_ONLY</code> bits being set
0436: */
0437: public GeometryArray(int vertexCount, int vertexFormat) {
0438: this (
0439: vertexCount,
0440: vertexFormat,
0441: ((vertexFormat & TEXTURE_COORDINATE) != 0 ? 1 : 0),
0442: ((vertexFormat & TEXTURE_COORDINATE) != 0 ? defTexCoordMap
0443: : null));
0444: }
0445:
0446: //NVaidya
0447: /**
0448: * Constructs an empty GeometryArray object with the specified
0449: * number of vertices, vertex format, number of texture coordinate
0450: * sets, and texture coordinate mapping array. Defaults are used
0451: * for all other parameters.
0452: *
0453: * @param vertexCount the number of vertex elements in this
0454: * GeometryArray<p>
0455: *
0456: * @param vertexFormat a mask indicating which components are
0457: * present in each vertex. This is specified as one or more
0458: * individual flags that are bitwise "OR"ed together to describe
0459: * the per-vertex data.
0460: * The flags include: <code>COORDINATES</code>, to signal the inclusion of
0461: * vertex positions--always present; <code>NORMALS</code>, to signal
0462: * the inclusion of per vertex normals; one of <code>COLOR_3</code> or
0463: * <code>COLOR_4</code>, to signal the inclusion of per vertex
0464: * colors (without or with alpha information); one of
0465: * <code>TEXTURE_COORDINATE_2</code> or <code>TEXTURE_COORDINATE_3</code>
0466: * or <code>TEXTURE_COORDINATE_4</code>,
0467: * to signal the
0468: * inclusion of per-vertex texture coordinates (2D , 3D or 4D);
0469: * <code>BY_REFERENCE</code>, to indicate that the data is passed
0470: * by reference
0471: * rather than by copying; <code>INTERLEAVED</code>, to indicate
0472: * that the referenced
0473: * data is interleaved in a single array;
0474: * <code>USE_NIO_BUFFER</code>, to indicate that the referenced data
0475: * is accessed via a J3DBuffer object that wraps an NIO buffer;
0476: * <code>USE_COORD_INDEX_ONLY</code>,
0477: * to indicate that only the coordinate indices are used for indexed
0478: * geometry arrays;
0479: * <code>BY_REFERENCE_INDICES</code>, to indicate
0480: * that the indices are accessed by reference in indexed
0481: * geometry arrays.<p>
0482: *
0483: * @param texCoordSetCount the number of texture coordinate sets
0484: * in this GeometryArray object. If <code>vertexFormat</code>
0485: * does not include one of <code>TEXTURE_COORDINATE_2</code> or
0486: * <code>TEXTURE_COORDINATE_3</code>, the
0487: * <code>texCoordSetCount</code> parameter is not used.<p>
0488: *
0489: * <a name="texCoordSetMap">
0490: * @param texCoordSetMap an array that maps texture coordinate
0491: * sets to texture units. The array is indexed by texture unit
0492: * number for each texture unit in the associated Appearance
0493: * object. The values in the array specify the texture coordinate
0494: * set within this GeometryArray object that maps to the
0495: * corresponding texture
0496: * unit. All elements within the array must be less than
0497: * <code>texCoordSetCount</code>. A negative value specifies that
0498: * no texture coordinate set maps to the texture unit
0499: * corresponding to the index. If there are more texture units in
0500: * any associated Appearance object than elements in the mapping
0501: * array, the extra elements are assumed to be -1. The same
0502: * texture coordinate set may be used for more than one texture
0503: * unit. Each texture unit in every associated Appearance must
0504: * have a valid source of texture coordinates: either a
0505: * non-negative texture coordinate set must be specified in the
0506: * mapping array or texture coordinate generation must be enabled.
0507: * Texture coordinate generation will take precedence for those
0508: * texture units for which a texture coordinate set is specified
0509: * and texture coordinate generation is enabled. If
0510: * <code>vertexFormat</code> does not include one of
0511: * <code>TEXTURE_COORDINATE_2</code> or
0512: * <code>TEXTURE_COORDINATE_3</code> or
0513: * <code>TEXTURE_COORDINATE_4</code>, the
0514: * <code>texCoordSetMap</code> array is not used. The following example
0515: * illustrates the use of the <code>texCoordSetMap</code> array.
0516: *
0517: * <p>
0518: * <ul>
0519: * <table BORDER=1 CELLSPACING=2 CELLPADDING=2>
0520: * <tr>
0521: * <td><center><b>Index</b></center></td>
0522: * <td><center><b>Element</b></center></td>
0523: * <td><b>Description</b></td>
0524: * </tr>
0525: * <tr>
0526: * <td><center>0</center></td>
0527: * <td><center>1</center></td>
0528: * <td>Use tex coord set 1 for tex unit 0</td>
0529: * </tr>
0530: * <tr>
0531: * <td><center>1</center></td>
0532: * <td><center>-1</center></td>
0533: * <td>Use no tex coord set for tex unit 1</td>
0534: * </tr>
0535: * <tr>
0536: * <td><center>2</center></td>
0537: * <td><center>0</center></td>
0538: * <td>Use tex coord set 0 for tex unit 2</td>
0539: * </tr>
0540: * <tr>
0541: * <td><center>3</center></td>
0542: * <td><center>1</center></td>
0543: * <td>Reuse tex coord set 1 for tex unit 3</td>
0544: * </tr>
0545: * </table>
0546: * </ul>
0547: * <p>
0548: *
0549: * @exception IllegalArgumentException if vertexCount < 0
0550: *
0551: * @exception IllegalArgumentException if vertexFormat does <b>not</b>
0552: * include <code>COORDINATES</code>
0553: *
0554: * @exception IllegalArgumentException if the <code>USE_COORD_INDEX_ONLY</code>
0555: * bit or the <code>BY_REFERENCE_INDICES</code> bit is set for
0556: * non-indexed geometry arrays (that is, GeometryArray objects
0557: * that are not a subclass of IndexedGeometryArray)
0558: *
0559: * @exception IllegalArgumentException if the <code>INTERLEAVED</code>
0560: * bit is set without the <code>BY_REFERENCE</code> bit being set
0561: *
0562: * @exception IllegalArgumentException if the <code>USE_NIO_BUFFER</code>
0563: * bit is set without the <code>BY_REFERENCE</code> bit being set
0564: *
0565: * @exception IllegalArgumentException if the <code>INTERLEAVED</code>
0566: * bit and the <code>VERTEX_ATTRIBUTES</code> bit are both set
0567: *
0568: * @exception IllegalArgumentException if the
0569: * <code>BY_REFERENCE_INDICES</code>
0570: * bit is set without the <code>BY_REFERENCE</code> and
0571: * <code>USE_COORD_INDEX_ONLY</code> bits being set
0572: *
0573: * @exception IllegalArgumentException if
0574: * <code>texCoordSetCount < 0</code>
0575: *
0576: * @exception IllegalArgumentException if any element in
0577: * <code>texCoordSetMap[] >= texCoordSetCount</code>.
0578: *
0579: * @since Java 3D 1.2
0580: */
0581: public GeometryArray(int vertexCount, int vertexFormat,
0582: int texCoordSetCount, int[] texCoordSetMap) {
0583: this (vertexCount, vertexFormat, texCoordSetCount,
0584: texCoordSetMap, 0, null);
0585: }
0586:
0587: //NVaidya
0588: /**
0589: * Constructs an empty GeometryArray object with the specified
0590: * number of vertices, vertex format, number of texture coordinate
0591: * sets, texture coordinate mapping array, vertex attribute count,
0592: * and vertex attribute sizes array.
0593: *
0594: * @param vertexCount the number of vertex elements in this
0595: * GeometryArray<p>
0596: *
0597: * @param vertexFormat a mask indicating which components are
0598: * present in each vertex. This is specified as one or more
0599: * individual flags that are bitwise "OR"ed together to describe
0600: * the per-vertex data.
0601: * The flags include: <code>COORDINATES</code>, to signal the inclusion of
0602: * vertex positions--always present; <code>NORMALS</code>, to signal
0603: * the inclusion of per vertex normals; one of <code>COLOR_3</code> or
0604: * <code>COLOR_4</code>, to signal the inclusion of per vertex
0605: * colors (without or with alpha information); one of
0606: * <code>TEXTURE_COORDINATE_2</code> or <code>TEXTURE_COORDINATE_3</code>
0607: * or <code>TEXTURE_COORDINATE_4</code>,
0608: * to signal the
0609: * inclusion of per-vertex texture coordinates (2D , 3D or 4D);
0610: * <code>VERTEX_ATTRIBUTES</code>, to signal
0611: * the inclusion of one or more arrays of vertex attributes;
0612: * <code>BY_REFERENCE</code>, to indicate that the data is passed
0613: * by reference
0614: * rather than by copying; <code>INTERLEAVED</code>, to indicate
0615: * that the referenced
0616: * data is interleaved in a single array;
0617: * <code>USE_NIO_BUFFER</code>, to indicate that the referenced data
0618: * is accessed via a J3DBuffer object that wraps an NIO buffer;
0619: * <code>USE_COORD_INDEX_ONLY</code>,
0620: * to indicate that only the coordinate indices are used for indexed
0621: * geometry arrays;
0622: * <code>BY_REFERENCE_INDICES</code>, to indicate
0623: * that the indices are accessed by reference in indexed
0624: * geometry arrays.<p>
0625: *
0626: * @param texCoordSetCount the number of texture coordinate sets
0627: * in this GeometryArray object. If <code>vertexFormat</code>
0628: * does not include one of <code>TEXTURE_COORDINATE_2</code> or
0629: * <code>TEXTURE_COORDINATE_3</code>, the
0630: * <code>texCoordSetCount</code> parameter is not used.<p>
0631: *
0632: * <a name="texCoordSetMap">
0633: * @param texCoordSetMap an array that maps texture coordinate
0634: * sets to texture units. The array is indexed by texture unit
0635: * number for each texture unit in the associated Appearance
0636: * object. The values in the array specify the texture coordinate
0637: * set within this GeometryArray object that maps to the
0638: * corresponding texture
0639: * unit. All elements within the array must be less than
0640: * <code>texCoordSetCount</code>. A negative value specifies that
0641: * no texture coordinate set maps to the texture unit
0642: * corresponding to the index. If there are more texture units in
0643: * any associated Appearance object than elements in the mapping
0644: * array, the extra elements are assumed to be -1. The same
0645: * texture coordinate set may be used for more than one texture
0646: * unit. Each texture unit in every associated Appearance must
0647: * have a valid source of texture coordinates: either a
0648: * non-negative texture coordinate set must be specified in the
0649: * mapping array or texture coordinate generation must be enabled.
0650: * Texture coordinate generation will take precedence for those
0651: * texture units for which a texture coordinate set is specified
0652: * and texture coordinate generation is enabled. If
0653: * <code>vertexFormat</code> does not include one of
0654: * <code>TEXTURE_COORDINATE_2</code> or
0655: * <code>TEXTURE_COORDINATE_3</code> or
0656: * <code>TEXTURE_COORDINATE_4</code>, the
0657: * <code>texCoordSetMap</code> array is not used. The following example
0658: * illustrates the use of the <code>texCoordSetMap</code> array.
0659: *
0660: * <p>
0661: * <ul>
0662: * <table BORDER=1 CELLSPACING=2 CELLPADDING=2>
0663: * <tr>
0664: * <td><center><b>Index</b></center></td>
0665: * <td><center><b>Element</b></center></td>
0666: * <td><b>Description</b></td>
0667: * </tr>
0668: * <tr>
0669: * <td><center>0</center></td>
0670: * <td><center>1</center></td>
0671: * <td>Use tex coord set 1 for tex unit 0</td>
0672: * </tr>
0673: * <tr>
0674: * <td><center>1</center></td>
0675: * <td><center>-1</center></td>
0676: * <td>Use no tex coord set for tex unit 1</td>
0677: * </tr>
0678: * <tr>
0679: * <td><center>2</center></td>
0680: * <td><center>0</center></td>
0681: * <td>Use tex coord set 0 for tex unit 2</td>
0682: * </tr>
0683: * <tr>
0684: * <td><center>3</center></td>
0685: * <td><center>1</center></td>
0686: * <td>Reuse tex coord set 1 for tex unit 3</td>
0687: * </tr>
0688: * </table>
0689: * </ul>
0690: * <p>
0691: *
0692: * @param vertexAttrCount the number of vertex attributes
0693: * in this GeometryArray object. If <code>vertexFormat</code>
0694: * does not include <code>VERTEX_ATTRIBUTES</code>, the
0695: * <code>vertexAttrCount</code> parameter must be 0.<p>
0696: *
0697: * @param vertexAttrSizes is an array that specifes the size of
0698: * each vertex attribute. Each element in the array specifies the
0699: * number of components in the attribute, from 1 to 4. The length
0700: * of the array must be equal to <code>vertexAttrCount</code>.<p>
0701: *
0702: * @exception IllegalArgumentException if vertexCount < 0
0703: *
0704: * @exception IllegalArgumentException if vertexFormat does <b>not</b>
0705: * include <code>COORDINATES</code>
0706: *
0707: * @exception IllegalArgumentException if the <code>USE_COORD_INDEX_ONLY</code>
0708: * bit or the <code>BY_REFERENCE_INDICES</code> bit is set for
0709: * non-indexed geometry arrays (that is, GeometryArray objects
0710: * that are not a subclass of IndexedGeometryArray)
0711: *
0712: * @exception IllegalArgumentException if the <code>INTERLEAVED</code>
0713: * bit is set without the <code>BY_REFERENCE</code> bit being set
0714: *
0715: * @exception IllegalArgumentException if the <code>USE_NIO_BUFFER</code>
0716: * bit is set without the <code>BY_REFERENCE</code> bit being set
0717: *
0718: * @exception IllegalArgumentException if the <code>INTERLEAVED</code>
0719: * bit and the <code>VERTEX_ATTRIBUTES</code> bit are both set
0720: *
0721: * @exception IllegalArgumentException if the
0722: * <code>BY_REFERENCE_INDICES</code>
0723: * bit is set without the <code>BY_REFERENCE</code> and
0724: * <code>USE_COORD_INDEX_ONLY</code> bits being set
0725: *
0726: * @exception IllegalArgumentException if
0727: * <code>texCoordSetCount < 0</code>
0728: *
0729: * @exception IllegalArgumentException if any element in
0730: * <code>texCoordSetMap[] >= texCoordSetCount</code>.
0731: *
0732: * @exception IllegalArgumentException if
0733: * <code>vertexAttrCount > 0</code> and the
0734: * <code>VERTEX_ATTRIBUTES</code> bit is not set
0735: *
0736: * @exception IllegalArgumentException if
0737: * <code>vertexAttrCount < 0</code>
0738: *
0739: * @exception IllegalArgumentException if
0740: * <code>vertexAttrSizes.length != vertexAttrCount</code>
0741: *
0742: * @exception IllegalArgumentException if any element in
0743: * <code>vertexAttrSizes[]</code> is <code>< 1</code> or
0744: * <code>> 4</code>.
0745: *
0746: * @since Java 3D 1.4
0747: */
0748: public GeometryArray(int vertexCount, int vertexFormat,
0749: int texCoordSetCount, int[] texCoordSetMap,
0750: int vertexAttrCount, int[] vertexAttrSizes) {
0751:
0752: if (vertexCount < 0)
0753: throw new IllegalArgumentException(J3dI18N
0754: .getString("GeometryArray96"));
0755:
0756: if (texCoordSetCount < 0)
0757: throw new IllegalArgumentException(J3dI18N
0758: .getString("GeometryArray124"));
0759:
0760: if (vertexAttrCount < 0)
0761: throw new IllegalArgumentException(J3dI18N
0762: .getString("GeometryArray125"));
0763:
0764: if ((vertexFormat & COORDINATES) == 0)
0765: throw new IllegalArgumentException(J3dI18N
0766: .getString("GeometryArray0"));
0767:
0768: if ((vertexFormat & INTERLEAVED) != 0
0769: && (vertexFormat & BY_REFERENCE) == 0)
0770: throw new IllegalArgumentException(J3dI18N
0771: .getString("GeometryArray80"));
0772:
0773: if ((vertexFormat & INTERLEAVED) != 0
0774: && (vertexFormat & VERTEX_ATTRIBUTES) != 0) {
0775: throw new IllegalArgumentException(J3dI18N
0776: .getString("GeometryArray128"));
0777: }
0778:
0779: if ((vertexFormat & USE_COORD_INDEX_ONLY) != 0
0780: && !(this instanceof IndexedGeometryArray)) {
0781: throw new IllegalArgumentException(J3dI18N
0782: .getString("GeometryArray135"));
0783: }
0784:
0785: //NVaidya
0786: if ((vertexFormat & BY_REFERENCE_INDICES) != 0) {
0787: if (!(this instanceof IndexedGeometryArray))
0788: throw new IllegalArgumentException(J3dI18N
0789: .getString("GeometryArray136"));
0790: if ((vertexFormat & BY_REFERENCE) == 0)
0791: throw new IllegalArgumentException(J3dI18N
0792: .getString("GeometryArray137"));
0793: if ((vertexFormat & USE_COORD_INDEX_ONLY) == 0)
0794: throw new IllegalArgumentException(J3dI18N
0795: .getString("GeometryArray138"));
0796: }
0797:
0798: if ((vertexFormat & USE_NIO_BUFFER) != 0
0799: && (vertexFormat & BY_REFERENCE) == 0)
0800: throw new IllegalArgumentException(J3dI18N
0801: .getString("GeometryArray117"));
0802:
0803: if ((vertexFormat & TEXTURE_COORDINATE) != 0) {
0804: if (texCoordSetMap == null)
0805: throw new IllegalArgumentException(J3dI18N
0806: .getString("GeometryArray106"));
0807:
0808: if (texCoordSetCount == 0)
0809: throw new IllegalArgumentException(J3dI18N
0810: .getString("GeometryArray107"));
0811:
0812: for (int i = 0; i < texCoordSetMap.length; i++) {
0813: if (texCoordSetMap[i] >= texCoordSetCount)
0814: throw new IllegalArgumentException(J3dI18N
0815: .getString("GeometryArray108"));
0816: }
0817:
0818: if ((vertexFormat & TEXTURE_COORDINATE_2) != 0) {
0819: texCoord2fArray = new TexCoord2f[1];
0820: texCoord2fScratch = new TexCoord2f();
0821: } else if ((vertexFormat & TEXTURE_COORDINATE_3) != 0) {
0822: texCoord3fArray = new TexCoord3f[1];
0823: texCoord3fScratch = new TexCoord3f();
0824: } else if ((vertexFormat & TEXTURE_COORDINATE_4) != 0) {
0825: texCoord4fArray = new TexCoord4f[1];
0826: }
0827: }
0828:
0829: if ((vertexFormat & VERTEX_ATTRIBUTES) != 0) {
0830: if (vertexAttrCount > 0) {
0831: if (vertexAttrCount != vertexAttrSizes.length) {
0832: throw new IllegalArgumentException(J3dI18N
0833: .getString("GeometryArray132"));
0834: }
0835:
0836: for (int i = 0; i < vertexAttrSizes.length; i++) {
0837: if (vertexAttrSizes[i] < 1
0838: || vertexAttrSizes[i] > 4) {
0839: throw new IllegalArgumentException(J3dI18N
0840: .getString("GeometryArray133"));
0841: }
0842: }
0843: } else {
0844: if (vertexAttrSizes != null
0845: && vertexAttrSizes.length != 0) {
0846: throw new IllegalArgumentException(J3dI18N
0847: .getString("GeometryArray132"));
0848: }
0849: }
0850: } else {
0851: if (vertexAttrCount > 0) {
0852: throw new IllegalArgumentException(J3dI18N
0853: .getString("GeometryArray131"));
0854: }
0855: }
0856:
0857: // set default read capabilities
0858: setDefaultReadCapabilities(readCapabilities);
0859:
0860: ((GeometryArrayRetained) this .retained)
0861: .createGeometryArrayData(vertexCount, vertexFormat,
0862: texCoordSetCount, texCoordSetMap,
0863: vertexAttrCount, vertexAttrSizes);
0864:
0865: }
0866:
0867: //------------------------------------------------------------------
0868: // Common methods
0869: //------------------------------------------------------------------
0870:
0871: /**
0872: * Retrieves the number of vertices in this GeometryArray
0873: * @return number of vertices in this GeometryArray
0874: * @exception CapabilityNotSetException if the appropriate capability is
0875: * not set and this object is part of a live or compiled scene graph
0876: */
0877: public int getVertexCount() {
0878: if (isLiveOrCompiled())
0879: if (!this .getCapability(ALLOW_COUNT_READ))
0880: throw new CapabilityNotSetException(J3dI18N
0881: .getString("GeometryArray1"));
0882:
0883: return ((GeometryArrayRetained) this .retained).getVertexCount();
0884: }
0885:
0886: /**
0887: * Retrieves the vertexFormat of this GeometryArray
0888: * @return format of vertices in this GeometryArray
0889: * @exception CapabilityNotSetException if the appropriate capability is
0890: * not set and this object is part of a live or compiled scene graph
0891: */
0892: public int getVertexFormat() {
0893: if (isLiveOrCompiled())
0894: if (!this .getCapability(ALLOW_FORMAT_READ))
0895: throw new CapabilityNotSetException(J3dI18N
0896: .getString("GeometryArray2"));
0897:
0898: return ((GeometryArrayRetained) this .retained)
0899: .getVertexFormat();
0900: }
0901:
0902: /**
0903: * Retrieves the number of texture coordinate sets in this
0904: * GeometryArray object.
0905: *
0906: * @return the number of texture coordinate sets
0907: * in this GeometryArray object
0908: *
0909: * @since Java 3D 1.2
0910: */
0911: public int getTexCoordSetCount() {
0912: return ((GeometryArrayRetained) this .retained)
0913: .getTexCoordSetCount();
0914: }
0915:
0916: /**
0917: * Retrieves the length of the texture coordinate set mapping
0918: * array of this GeometryArray object.
0919: *
0920: * @return the length of the texture coordinate set mapping
0921: * array of this GeometryArray object
0922: *
0923: * @since Java 3D 1.2
0924: */
0925: public int getTexCoordSetMapLength() {
0926: return ((GeometryArrayRetained) this .retained)
0927: .getTexCoordSetMapLength();
0928: }
0929:
0930: /**
0931: * Retrieves the texture coordinate set mapping
0932: * array from this GeometryArray object.
0933: *
0934: * @param texCoordSetMap an array that will receive a copy of the
0935: * texture coordinate set mapping array. The array must be large
0936: * enough to hold all entries of the texture coordinate set
0937: * mapping array.
0938: *
0939: * @since Java 3D 1.2
0940: */
0941: public void getTexCoordSetMap(int[] texCoordSetMap) {
0942: ((GeometryArrayRetained) this .retained)
0943: .getTexCoordSetMap(texCoordSetMap);
0944: }
0945:
0946: /**
0947: * Retrieves the number of vertex attributes in this GeometryArray
0948: * object.
0949: *
0950: * @return the number of vertex attributes in this GeometryArray
0951: * object
0952: *
0953: * @since Java 3D 1.4
0954: */
0955: public int getVertexAttrCount() {
0956: return ((GeometryArrayRetained) this .retained)
0957: .getVertexAttrCount();
0958: }
0959:
0960: /**
0961: * Retrieves the vertex attribute sizes array from this
0962: * GeometryArray object.
0963: *
0964: * @param vertexAttrSizes an array that will receive a copy of
0965: * the vertex attribute sizes array. The array must hold at least
0966: * <code>vertexAttrCount</code> elements.
0967: *
0968: * @since Java 3D 1.4
0969: */
0970: public void getVertexAttrSizes(int[] vertexAttrSizes) {
0971: ((GeometryArrayRetained) this .retained)
0972: .getVertexAttrSizes(vertexAttrSizes);
0973: }
0974:
0975: /**
0976: * Updates geometry array data that is accessed by reference.
0977: * This method calls the updateData method of the specified
0978: * GeometryUpdater object to synchronize updates to vertex
0979: * data that is referenced by this GeometryArray object.
0980: * Applications that wish to modify such data must perform all
0981: * updates via this method.
0982: * <p>
0983: * This method may also be used to atomically set multiple
0984: * references (for example, to coordinate and color arrays)
0985: * or to atomically
0986: * change multiple data values through the geometry data copying
0987: * methods.
0988: *
0989: * @param updater object whose updateData callback method will be
0990: * called to update the data referenced by this GeometryArray.
0991: * @exception CapabilityNotSetException if the appropriate capability
0992: * is not set, the vertex data mode is <code>BY_REFERENCE</code>, and this
0993: * object is part of a live or compiled scene graph
0994: *
0995: * @since Java 3D 1.2
0996: */
0997: public void updateData(GeometryUpdater updater) {
0998: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
0999: if ((format & BY_REFERENCE) != 0 && isLiveOrCompiled()
1000: && !this .getCapability(ALLOW_REF_DATA_WRITE)) {
1001:
1002: throw new CapabilityNotSetException(J3dI18N
1003: .getString("GeometryArray81"));
1004: }
1005:
1006: ((GeometryArrayRetained) this .retained).updateData(updater);
1007: }
1008:
1009: /**
1010: * Sets the valid vertex count for this GeometryArray object.
1011: * This count specifies the number of vertices actually used in
1012: * rendering or other operations such as picking and collision.
1013: * This attribute is initialized to <code>vertexCount</code>.
1014: *
1015: * @param validVertexCount the new valid vertex count.
1016: * @exception CapabilityNotSetException if the appropriate capability is
1017: * not set and this object is part of a live or compiled scene graph
1018: * <p>
1019: * @exception IllegalArgumentException if any of the following are
1020: * true:
1021: * <ul>
1022: * <code>validVertexCount < 0</code>,<br>
1023: * <code>initialVertexIndex + validVertexCount > vertexCount</code>,<br>
1024: * <code>initialCoordIndex + validVertexCount > vertexCount</code>,<br>
1025: * <code>initialColorIndex + validVertexCount > vertexCount</code>,<br>
1026: * <code>initialNormalIndex + validVertexCount > vertexCount</code>,<br>
1027: * <code>initialTexCoordIndex + validVertexCount > vertexCount</code>,<br>
1028: * <code>initialVertexAttrIndex + validVertexCount > vertexCount</code>
1029: * </ul>
1030: * <p>
1031: * @exception ArrayIndexOutOfBoundsException if the geometry data format
1032: * is <code>BY_REFERENCE</code> and any the following
1033: * are true for non-null array references:
1034: * <ul>
1035: * <code>CoordRef.length</code> < <i>num_words</i> *
1036: * (<code>initialCoordIndex + validVertexCount</code>),<br>
1037: * <code>ColorRef.length</code> < <i>num_words</i> *
1038: * (<code>initialColorIndex + validVertexCount</code>),<br>
1039: * <code>NormalRef.length</code> < <i>num_words</i> *
1040: * (<code>initialNormalIndex + validVertexCount</code>),<br>
1041: * <code>TexCoordRef.length</code> < <i>num_words</i> *
1042: * (<code>initialTexCoordIndex + validVertexCount</code>),<br>
1043: * <code>VertexAttrRef.length</code> < <i>num_words</i> *
1044: * (<code>initialVertexAttrIndex + validVertexCount</code>),<br>
1045: * <code>InterleavedVertices.length</code> < <i>words_per_vertex</i> *
1046: * (<code>initialVertexIndex + validVertexCount</code>)<br>
1047: * </ul>
1048: * where <i>num_words</i> depends on which variant of
1049: * <code>set</code><i>Array</i><code>Ref</code> is used, and
1050: * <i>words_per_vertex</i> depends on which vertex formats are enabled
1051: * for interleaved arrays.
1052: *
1053: * @since Java 3D 1.2
1054: */
1055: public void setValidVertexCount(int validVertexCount) {
1056: if (isLiveOrCompiled())
1057: if (!this .getCapability(ALLOW_COUNT_WRITE))
1058: throw new CapabilityNotSetException(J3dI18N
1059: .getString("GeometryArray88"));
1060:
1061: if (validVertexCount < 0)
1062: throw new IllegalArgumentException(J3dI18N
1063: .getString("GeometryArray96"));
1064:
1065: ((GeometryArrayRetained) this .retained)
1066: .setValidVertexCount(validVertexCount);
1067: // NOTE: the checks for initial*Index + validVertexCount >
1068: // vertexCount need to be done in the retained method
1069: }
1070:
1071: /**
1072: * Gets the valid vertex count for this GeometryArray object.
1073: * For geometry strip primitives (subclasses of GeometryStripArray),
1074: * the valid vertex count is defined to be the sum of the
1075: * stripVertexCounts array.
1076: * @return the current valid vertex count
1077: * @exception CapabilityNotSetException if the appropriate capability is
1078: * not set and this object is part of a live or compiled scene graph
1079: *
1080: * @since Java 3D 1.2
1081: */
1082: public int getValidVertexCount() {
1083: if (isLiveOrCompiled())
1084: if (!this .getCapability(ALLOW_COUNT_READ))
1085: throw new CapabilityNotSetException(J3dI18N
1086: .getString("GeometryArray89"));
1087:
1088: return ((GeometryArrayRetained) this .retained)
1089: .getValidVertexCount();
1090: }
1091:
1092: /**
1093: * Copies all node information from <code>originalNodeComponent</code>
1094: * into the current node. This method is called from the
1095: * <code>duplicateNode</code> method. This routine does
1096: * the actual duplication of all "local data" (any data defined in
1097: * this object).
1098: *
1099: * @param originalNodeComponent the original node to duplicate.
1100: * @param forceDuplicate when set to <code>true</code>, causes the
1101: * <code>duplicateOnCloneTree</code> flag to be ignored. When
1102: * <code>false</code>, the value of each node's
1103: * <code>duplicateOnCloneTree</code> variable determines whether
1104: * NodeComponent data is duplicated or copied.
1105: *
1106: * @see Node#cloneTree
1107: * @see NodeComponent#setDuplicateOnCloneTree
1108: */
1109: void duplicateAttributes(NodeComponent originalNodeComponent,
1110: boolean forceDuplicate) {
1111:
1112: super
1113: .duplicateAttributes(originalNodeComponent,
1114: forceDuplicate);
1115: // vertexFormat and vertexCount are copied in subclass when constructor
1116: // public GeometryArray(int vertexCount, int vertexFormat) is used
1117: // in cloneNodeComponent()
1118: GeometryArrayRetained src = (GeometryArrayRetained) originalNodeComponent.retained;
1119: GeometryArrayRetained dst = (GeometryArrayRetained) retained;
1120: int format = src.getVertexFormat();
1121: if ((format & BY_REFERENCE) == 0) {
1122: System.arraycopy(src.vertexData, 0, dst.vertexData, 0,
1123: src.vertexData.length);
1124: dst.setInitialVertexIndex(src.getInitialVertexIndex());
1125:
1126: } else {
1127: dst.setInitialCoordIndex(src.getInitialCoordIndex());
1128: dst.setInitialColorIndex(src.getInitialColorIndex());
1129: dst.setInitialNormalIndex(src.getInitialNormalIndex());
1130: int setCount = src.getTexCoordSetCount();
1131: int vAttrCount = src.getVertexAttrCount();
1132: for (int i = 0; i < setCount; i++) {
1133: dst.setInitialTexCoordIndex(i, src
1134: .getInitialTexCoordIndex(i));
1135: }
1136: if ((format & INTERLEAVED) == 0) {
1137: if ((format & USE_NIO_BUFFER) == 0) {
1138: // Java arrays
1139: dst.setCoordRefFloat(src.getCoordRefFloat());
1140: dst.setCoordRefDouble(src.getCoordRefDouble());
1141: dst.setCoordRef3f(src.getCoordRef3f());
1142: dst.setCoordRef3d(src.getCoordRef3d());
1143: dst.setColorRefFloat(src.getColorRefFloat());
1144: dst.setColorRefByte(src.getColorRefByte());
1145: if ((format & WITH_ALPHA) == 0) {
1146: dst.setColorRef3f(src.getColorRef3f());
1147: dst.setColorRef3b(src.getColorRef3b());
1148: } else {
1149: dst.setColorRef4f(src.getColorRef4f());
1150: dst.setColorRef4b(src.getColorRef4b());
1151: }
1152: dst.setNormalRefFloat(src.getNormalRefFloat());
1153: dst.setNormalRef3f(src.getNormalRef3f());
1154:
1155: switch (src.getVertexAttrType()) {
1156: case GeometryArrayRetained.AF:
1157: for (int i = 0; i < vAttrCount; i++) {
1158: dst.setVertexAttrRefFloat(i, src
1159: .getVertexAttrRefFloat(i));
1160: }
1161: break;
1162: }
1163:
1164: switch (src.getTexCoordType()) {
1165: case GeometryArrayRetained.TF:
1166: for (int i = 0; i < setCount; i++) {
1167: dst.setTexCoordRefFloat(i, src
1168: .getTexCoordRefFloat(i));
1169: }
1170: break;
1171: case GeometryArrayRetained.T2F:
1172: for (int i = 0; i < setCount; i++) {
1173: dst.setTexCoordRef2f(i, src
1174: .getTexCoordRef2f(i));
1175: }
1176: break;
1177: case GeometryArrayRetained.T3F:
1178: for (int i = 0; i < setCount; i++) {
1179: dst.setTexCoordRef3f(i, src
1180: .getTexCoordRef3f(i));
1181: }
1182: break;
1183: }
1184: } else {
1185: // NIO buffer
1186: dst.setCoordRefBuffer(src.getCoordRefBuffer());
1187: dst.setColorRefBuffer(src.getColorRefBuffer());
1188: dst.setNormalRefBuffer(src.getNormalRefBuffer());
1189:
1190: switch (src.getVertexAttrType()) {
1191: case GeometryArrayRetained.AF:
1192: for (int i = 0; i < vAttrCount; i++) {
1193: dst.setVertexAttrRefBuffer(i, src
1194: .getVertexAttrRefBuffer(i));
1195: }
1196: break;
1197: }
1198:
1199: switch (src.getTexCoordType()) {
1200: case GeometryArrayRetained.TF:
1201: for (int i = 0; i < setCount; i++) {
1202: dst.setTexCoordRefBuffer(i, src
1203: .getTexCoordRefBuffer(i));
1204: }
1205: break;
1206: }
1207: }
1208: } else {
1209: dst
1210: .setInterleavedVertices(src
1211: .getInterleavedVertices());
1212: }
1213: }
1214: }
1215:
1216: //------------------------------------------------------------------
1217: // By-copying methods
1218: //------------------------------------------------------------------
1219:
1220: /**
1221: * Sets the initial vertex index for this GeometryArray object.
1222: * This index specifies the first vertex within this geometry
1223: * array that is actually used in rendering or other operations
1224: * such as picking and collision. This attribute is initialized
1225: * to 0.
1226: * This attribute is only used when the data mode for this
1227: * geometry array object is not <code>BY_REFERENCE</code>
1228: * or when the data mode is <code>INTERLEAVED</code>.
1229: *
1230: * @param initialVertexIndex the new initial vertex index.
1231: * @exception CapabilityNotSetException if the appropriate capability is
1232: * not set and this object is part of a live or compiled scene graph
1233: * @exception IllegalArgumentException if either of the following are
1234: * true:
1235: * <ul>
1236: * <code>initialVertexIndex < 0</code> or<br>
1237: * <code>initialVertexIndex + validVertexCount > vertexCount</code><br>
1238: * </ul>
1239: *
1240: * @exception ArrayIndexOutOfBoundsException if the geometry data format
1241: * is <code>INTERLEAVED</code>, the InterleavedVertices array is
1242: * non-null, and:
1243: * <ul>
1244: * <code>InterleavedVertices.length</code> < <i>num_words</i> *
1245: * (<code>initialVertexIndex + validVertexCount</code>)<br>
1246: * </ul>
1247: * where <i>num_words</i> depends on which vertex formats are enabled.
1248: *
1249: * @exception IllegalStateException if the data mode for this geometry
1250: * array object is <code>BY_REFERENCE</code> and is <i>not</i>
1251: * <code>INTERLEAVED</code>.
1252: *
1253: * @since Java 3D 1.2
1254: */
1255: public void setInitialVertexIndex(int initialVertexIndex) {
1256: if (isLiveOrCompiled())
1257: if (!this .getCapability(ALLOW_COUNT_WRITE))
1258: throw new CapabilityNotSetException(J3dI18N
1259: .getString("GeometryArray90"));
1260:
1261: if (initialVertexIndex < 0)
1262: throw new IllegalArgumentException(J3dI18N
1263: .getString("GeometryArray97"));
1264: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1265: if ((format & BY_REFERENCE) != 0 && (format & INTERLEAVED) == 0)
1266: throw new IllegalStateException(J3dI18N
1267: .getString("GeometryArray105"));
1268:
1269: ((GeometryArrayRetained) this .retained)
1270: .setInitialVertexIndex(initialVertexIndex);
1271: // NOTE: the check for initialVertexIndex + validVertexCount >
1272: // vertexCount is done in the retained method
1273: }
1274:
1275: /**
1276: * Gets the initial vertex index for this GeometryArray object.
1277: * This attribute is only used when the data mode for this
1278: * geometry array object is <i>not</i> <code>BY_REFERENCE</code>
1279: * or when the data mode is <code>INTERLEAVED</code>.
1280: * @return the current initial vertex index for this GeometryArray object.
1281: * @exception CapabilityNotSetException if the appropriate capability is
1282: * not set and this object is part of a live or compiled scene graph
1283: *
1284: * @since Java 3D 1.2
1285: */
1286: public int getInitialVertexIndex() {
1287: if (isLiveOrCompiled())
1288: if (!this .getCapability(ALLOW_COUNT_READ))
1289: throw new CapabilityNotSetException(J3dI18N
1290: .getString("GeometryArray91"));
1291:
1292: return ((GeometryArrayRetained) this .retained)
1293: .getInitialVertexIndex();
1294: }
1295:
1296: /**
1297: * Sets the coordinate associated with the vertex at
1298: * the specified index for this object.
1299: * @param index destination vertex index in this geometry array
1300: * @param coordinate source array of 3 values containing the new coordinate
1301: * @exception CapabilityNotSetException if the appropriate capability is
1302: * not set and this object is part of a live or compiled scene graph
1303: * @exception IllegalStateException if the data mode for this geometry
1304: * array object is <code>BY_REFERENCE</code>.
1305: */
1306: public void setCoordinate(int index, float coordinate[]) {
1307: if (isLiveOrCompiled())
1308: if (!this .getCapability(ALLOW_COORDINATE_WRITE))
1309: throw new CapabilityNotSetException(J3dI18N
1310: .getString("GeometryArray3"));
1311:
1312: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1313: if ((format & BY_REFERENCE) != 0)
1314: throw new IllegalStateException(J3dI18N
1315: .getString("GeometryArray82"));
1316:
1317: ((GeometryArrayRetained) this .retained).setCoordinate(index,
1318: coordinate);
1319: }
1320:
1321: /**
1322: * Sets the coordinate associated with the vertex at
1323: * the specified index.
1324: * @param index destination vertex index in this geometry array
1325: * @param coordinate source array of 3 values containing the new coordinate
1326: * @exception CapabilityNotSetException if the appropriate capability is
1327: * not set and this object is part of a live or compiled scene graph
1328: * @exception IllegalStateException if the data mode for this geometry
1329: * array object is <code>BY_REFERENCE</code>.
1330: */
1331: public void setCoordinate(int index, double coordinate[]) {
1332: if (isLiveOrCompiled())
1333: if (!this .getCapability(ALLOW_COORDINATE_WRITE))
1334: throw new CapabilityNotSetException(J3dI18N
1335: .getString("GeometryArray3"));
1336:
1337: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1338: if ((format & BY_REFERENCE) != 0)
1339: throw new IllegalStateException(J3dI18N
1340: .getString("GeometryArray82"));
1341:
1342: ((GeometryArrayRetained) this .retained).setCoordinate(index,
1343: coordinate);
1344: }
1345:
1346: /**
1347: * Sets the coordinate associated with the vertex at
1348: * the specified index for this object.
1349: * @param index destination vertex index in this geometry array
1350: * @param coordinate a point containing the new coordinate
1351: * @exception CapabilityNotSetException if the appropriate capability is
1352: * not set and this object is part of a live or compiled scene graph
1353: * @exception IllegalStateException if the data mode for this geometry
1354: * array object is <code>BY_REFERENCE</code>.
1355: */
1356: public void setCoordinate(int index, Point3f coordinate) {
1357: if (isLiveOrCompiled())
1358: if (!this .getCapability(ALLOW_COORDINATE_WRITE))
1359: throw new CapabilityNotSetException(J3dI18N
1360: .getString("GeometryArray3"));
1361:
1362: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1363: if ((format & BY_REFERENCE) != 0)
1364: throw new IllegalStateException(J3dI18N
1365: .getString("GeometryArray82"));
1366:
1367: ((GeometryArrayRetained) this .retained).setCoordinate(index,
1368: coordinate);
1369: }
1370:
1371: /**
1372: * Sets the coordinate associated with the vertex at
1373: * the specified index for this object.
1374: * @param index destination vertex index in this geometry array
1375: * @param coordinate a point containing the new coordinate
1376: * @exception CapabilityNotSetException if the appropriate capability is
1377: * not set and this object is part of a live or compiled scene graph
1378: * @exception IllegalStateException if the data mode for this geometry
1379: * array object is <code>BY_REFERENCE</code>.
1380: */
1381: public void setCoordinate(int index, Point3d coordinate) {
1382: if (isLiveOrCompiled())
1383: if (!this .getCapability(ALLOW_COORDINATE_WRITE))
1384: throw new CapabilityNotSetException(J3dI18N
1385: .getString("GeometryArray3"));
1386:
1387: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1388: if ((format & BY_REFERENCE) != 0)
1389: throw new IllegalStateException(J3dI18N
1390: .getString("GeometryArray82"));
1391:
1392: ((GeometryArrayRetained) this .retained).setCoordinate(index,
1393: coordinate);
1394: }
1395:
1396: /**
1397: * Sets the coordinates associated with the vertices starting at
1398: * the specified index for this object. The entire source array is
1399: * copied to this geometry array.
1400: * @param index starting destination vertex index in this geometry array
1401: * @param coordinates source array of 3*n values containing n new coordinates
1402: * @exception CapabilityNotSetException if the appropriate capability is
1403: * not set and this object is part of a live or compiled scene graph
1404: * @exception IllegalStateException if the data mode for this geometry
1405: * array object is <code>BY_REFERENCE</code>.
1406: */
1407: public void setCoordinates(int index, float coordinates[]) {
1408: if (isLiveOrCompiled())
1409: if (!this .getCapability(ALLOW_COORDINATE_WRITE))
1410: throw new CapabilityNotSetException(J3dI18N
1411: .getString("GeometryArray7"));
1412:
1413: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1414: if ((format & BY_REFERENCE) != 0)
1415: throw new IllegalStateException(J3dI18N
1416: .getString("GeometryArray82"));
1417:
1418: ((GeometryArrayRetained) this .retained).setCoordinates(index,
1419: coordinates);
1420: }
1421:
1422: /**
1423: * Sets the coordinates associated with the vertices starting at
1424: * the specified index for this object. The entire source array is
1425: * copied to this geometry array.
1426: * @param index starting destination vertex index in this geometry array
1427: * @param coordinates source array of 3*n values containing n new coordinates
1428: * @exception CapabilityNotSetException if the appropriate capability is
1429: * not set and this object is part of a live or compiled scene graph
1430: * @exception IllegalStateException if the data mode for this geometry
1431: * array object is <code>BY_REFERENCE</code>.
1432: */
1433: public void setCoordinates(int index, double coordinates[]) {
1434: if (isLiveOrCompiled())
1435: if (!this .getCapability(ALLOW_COORDINATE_WRITE))
1436: throw new CapabilityNotSetException(J3dI18N
1437: .getString("GeometryArray7"));
1438:
1439: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1440: if ((format & BY_REFERENCE) != 0)
1441: throw new IllegalStateException(J3dI18N
1442: .getString("GeometryArray82"));
1443:
1444: ((GeometryArrayRetained) this .retained).setCoordinates(index,
1445: coordinates);
1446: }
1447:
1448: /**
1449: * Sets the coordinates associated with the vertices starting at
1450: * the specified index for this object. The entire source array is
1451: * copied to this geometry array.
1452: * @param index starting destination vertex index in this geometry array
1453: * @param coordinates source array of points containing new coordinates
1454: * @exception CapabilityNotSetException if the appropriate capability is
1455: * not set and this object is part of a live or compiled scene graph
1456: * @exception IllegalStateException if the data mode for this geometry
1457: * array object is <code>BY_REFERENCE</code>.
1458: */
1459: public void setCoordinates(int index, Point3f coordinates[]) {
1460: if (isLiveOrCompiled())
1461: if (!this .getCapability(ALLOW_COORDINATE_WRITE))
1462: throw new CapabilityNotSetException(J3dI18N
1463: .getString("GeometryArray7"));
1464:
1465: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1466: if ((format & BY_REFERENCE) != 0)
1467: throw new IllegalStateException(J3dI18N
1468: .getString("GeometryArray82"));
1469:
1470: ((GeometryArrayRetained) this .retained).setCoordinates(index,
1471: coordinates);
1472: }
1473:
1474: /**
1475: * Sets the coordinates associated with the vertices starting at
1476: * the specified index for this object. The entire source array is
1477: * copied to this geometry array.
1478: * @param index starting destination vertex index in this geometry array
1479: * @param coordinates source array of points containing new coordinates
1480: * @exception CapabilityNotSetException if the appropriate capability is
1481: * not set and this object is part of a live or compiled scene graph
1482: * @exception IllegalStateException if the data mode for this geometry
1483: * array object is <code>BY_REFERENCE</code>.
1484: */
1485: public void setCoordinates(int index, Point3d coordinates[]) {
1486: if (isLiveOrCompiled())
1487: if (!this .getCapability(ALLOW_COORDINATE_WRITE))
1488: throw new CapabilityNotSetException(J3dI18N
1489: .getString("GeometryArray7"));
1490:
1491: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1492: if ((format & BY_REFERENCE) != 0)
1493: throw new IllegalStateException(J3dI18N
1494: .getString("GeometryArray82"));
1495:
1496: ((GeometryArrayRetained) this .retained).setCoordinates(index,
1497: coordinates);
1498: }
1499:
1500: /**
1501: * Sets the coordinates associated with the vertices starting at
1502: * the specified index for this object using coordinate data starting
1503: * from vertex index <code>start</code> for <code>length</code> vertices.
1504: * @param index starting destination vertex index in this geometry array
1505: * @param coordinates source array of 3*n values containing n new coordinates
1506: * @param start starting source vertex index in <code>coordinates</code> array.
1507: * @param length number of vertices to be copied.
1508: * @exception CapabilityNotSetException if the appropriate capability is
1509: * not set and this object is part of a live or compiled scene graph
1510: * @exception IllegalStateException if the data mode for this geometry
1511: * array object is <code>BY_REFERENCE</code>.
1512: */
1513: public void setCoordinates(int index, float coordinates[],
1514: int start, int length) {
1515: if (isLiveOrCompiled())
1516: if (!this .getCapability(ALLOW_COORDINATE_WRITE))
1517: throw new CapabilityNotSetException(J3dI18N
1518: .getString("GeometryArray7"));
1519:
1520: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1521: if ((format & BY_REFERENCE) != 0)
1522: throw new IllegalStateException(J3dI18N
1523: .getString("GeometryArray82"));
1524:
1525: ((GeometryArrayRetained) this .retained).setCoordinates(index,
1526: coordinates, start, length);
1527: }
1528:
1529: /**
1530: * Sets the coordinates associated with the vertices starting at
1531: * the specified index for this object using coordinate data starting
1532: * from vertex index <code>start</code> for <code>length</code> vertices.
1533: * @param index starting destination vertex index in this geometry array
1534: * @param coordinates source array of 3*n values containing n new coordinates
1535: * @param start starting source vertex index in <code>coordinates</code> array.
1536: * @param length number of vertices to be copied.
1537: * @exception CapabilityNotSetException if the appropriate capability is
1538: * not set and this object is part of a live or compiled scene graph
1539: * @exception IllegalStateException if the data mode for this geometry
1540: * array object is <code>BY_REFERENCE</code>.
1541: */
1542: public void setCoordinates(int index, double coordinates[],
1543: int start, int length) {
1544: if (isLiveOrCompiled())
1545: if (!this .getCapability(ALLOW_COORDINATE_WRITE))
1546: throw new CapabilityNotSetException(J3dI18N
1547: .getString("GeometryArray7"));
1548:
1549: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1550: if ((format & BY_REFERENCE) != 0)
1551: throw new IllegalStateException(J3dI18N
1552: .getString("GeometryArray82"));
1553:
1554: ((GeometryArrayRetained) this .retained).setCoordinates(index,
1555: coordinates, start, length);
1556: }
1557:
1558: /**
1559: * Sets the coordinates associated with the vertices starting at
1560: * the specified index for this object using coordinate data starting
1561: * from vertex index <code>start</code> for <code>length</code> vertices.
1562: * @param index starting destination vertex index in this geometry array
1563: * @param coordinates source array of points containing new coordinates
1564: * @param start starting source vertex index in <code>coordinates</code> array.
1565: * @param length number of vertices to be copied.
1566: * @exception CapabilityNotSetException if the appropriate capability is
1567: * not set and this object is part of a live or compiled scene graph
1568: * @exception IllegalStateException if the data mode for this geometry
1569: * array object is <code>BY_REFERENCE</code>.
1570: */
1571: public void setCoordinates(int index, Point3f coordinates[],
1572: int start, int length) {
1573: if (isLiveOrCompiled())
1574: if (!this .getCapability(ALLOW_COORDINATE_WRITE))
1575: throw new CapabilityNotSetException(J3dI18N
1576: .getString("GeometryArray7"));
1577:
1578: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1579: if ((format & BY_REFERENCE) != 0)
1580: throw new IllegalStateException(J3dI18N
1581: .getString("GeometryArray82"));
1582:
1583: ((GeometryArrayRetained) this .retained).setCoordinates(index,
1584: coordinates, start, length);
1585: }
1586:
1587: /**
1588: * Sets the coordinates associated with the vertices starting at
1589: * the specified index for this object using coordinate data starting
1590: * from vertex index <code>start</code> for <code>length</code> vertices.
1591: * @param index starting destination vertex index in this geometry array
1592: * @param coordinates source array of points containing new coordinates
1593: * @param start starting source vertex index in <code>coordinates</code> array.
1594: * @param length number of vertices to be copied.
1595: * @exception CapabilityNotSetException if the appropriate capability is
1596: * not set and this object is part of a live or compiled scene graph
1597: * @exception IllegalStateException if the data mode for this geometry
1598: * array object is <code>BY_REFERENCE</code>.
1599: */
1600: public void setCoordinates(int index, Point3d coordinates[],
1601: int start, int length) {
1602: if (isLiveOrCompiled())
1603: if (!this .getCapability(ALLOW_COORDINATE_WRITE))
1604: throw new CapabilityNotSetException(J3dI18N
1605: .getString("GeometryArray7"));
1606:
1607: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1608: if ((format & BY_REFERENCE) != 0)
1609: throw new IllegalStateException(J3dI18N
1610: .getString("GeometryArray82"));
1611:
1612: ((GeometryArrayRetained) this .retained).setCoordinates(index,
1613: coordinates, start, length);
1614: }
1615:
1616: /**
1617: * Sets the color associated with the vertex at
1618: * the specified index for this object.
1619: * @param index destination vertex index in this geometry array
1620: * @param color source array of 3 or 4 values containing the new color
1621: * @exception CapabilityNotSetException if the appropriate capability is
1622: * not set and this object is part of a live or compiled scene graph
1623: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
1624: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
1625: * @exception IllegalStateException if the data mode for this geometry
1626: * array object is <code>BY_REFERENCE</code>.
1627: */
1628: public void setColor(int index, float color[]) {
1629: if (isLiveOrCompiled())
1630: if (!this .getCapability(ALLOW_COLOR_WRITE))
1631: throw new CapabilityNotSetException(J3dI18N
1632: .getString("GeometryArray15"));
1633:
1634: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1635: if ((format & BY_REFERENCE) != 0)
1636: throw new IllegalStateException(J3dI18N
1637: .getString("GeometryArray82"));
1638:
1639: if ((format & COLOR) == 0)
1640: throw new ArrayIndexOutOfBoundsException(J3dI18N
1641: .getString("GeometryArray76"));
1642:
1643: ((GeometryArrayRetained) this .retained).setColor(index, color);
1644: }
1645:
1646: /**
1647: * Sets the color associated with the vertex at
1648: * the specified index for this object.
1649: * @param index destination vertex index in this geometry array
1650: * @param color source array of 3 or 4 values containing the new color
1651: * @exception CapabilityNotSetException if the appropriate capability is
1652: * not set and this object is part of a live or compiled scene graph
1653: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
1654: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
1655: * @exception IllegalStateException if the data mode for this geometry
1656: * array object is <code>BY_REFERENCE</code>.
1657: */
1658: public void setColor(int index, byte color[]) {
1659: if (isLiveOrCompiled())
1660: if (!this .getCapability(ALLOW_COLOR_WRITE))
1661: throw new CapabilityNotSetException(J3dI18N
1662: .getString("GeometryArray15"));
1663:
1664: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1665: if ((format & BY_REFERENCE) != 0)
1666: throw new IllegalStateException(J3dI18N
1667: .getString("GeometryArray82"));
1668:
1669: if ((format & COLOR) == 0)
1670: throw new ArrayIndexOutOfBoundsException(J3dI18N
1671: .getString("GeometryArray76"));
1672:
1673: ((GeometryArrayRetained) this .retained).setColor(index, color);
1674: }
1675:
1676: /**
1677: * Sets the color associated with the vertex at
1678: * the specified index for this object.
1679: * @param index destination vertex index in this geometry array
1680: * @param color a Color3f containing the new color
1681: * @exception CapabilityNotSetException if the appropriate capability is
1682: * not set and this object is part of a live or compiled scene graph
1683: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
1684: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
1685: * @exception IllegalStateException if the data mode for this geometry
1686: * array object is <code>BY_REFERENCE</code>.
1687: * @exception IllegalStateException if COLOR_4 is specified in the vertex
1688: * format
1689: */
1690: public void setColor(int index, Color3f color) {
1691: if (isLiveOrCompiled())
1692: if (!this .getCapability(ALLOW_COLOR_WRITE))
1693: throw new CapabilityNotSetException(J3dI18N
1694: .getString("GeometryArray15"));
1695:
1696: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1697: if ((format & BY_REFERENCE) != 0)
1698: throw new IllegalStateException(J3dI18N
1699: .getString("GeometryArray82"));
1700:
1701: if ((format & COLOR) == 0)
1702: throw new ArrayIndexOutOfBoundsException(J3dI18N
1703: .getString("GeometryArray76"));
1704:
1705: if ((format & WITH_ALPHA) != 0)
1706: throw new IllegalStateException(J3dI18N
1707: .getString("GeometryArray92"));
1708:
1709: ((GeometryArrayRetained) this .retained).setColor(index, color);
1710: }
1711:
1712: /**
1713: * Sets the color associated with the vertex at
1714: * the specified index for this object.
1715: * @param index destination vertex index in this geometry array
1716: * @param color a Color4f containing the new color
1717: * @exception CapabilityNotSetException if the appropriate capability is
1718: * not set and this object is part of a live or compiled scene graph
1719: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
1720: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
1721: * @exception IllegalStateException if the data mode for this geometry
1722: * array object is <code>BY_REFERENCE</code>.
1723: * @exception IllegalStateException if COLOR_3 is specified in the vertex
1724: * format
1725: */
1726: public void setColor(int index, Color4f color) {
1727: if (isLiveOrCompiled())
1728: if (!this .getCapability(ALLOW_COLOR_WRITE))
1729: throw new CapabilityNotSetException(J3dI18N
1730: .getString("GeometryArray15"));
1731:
1732: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1733: if ((format & BY_REFERENCE) != 0)
1734: throw new IllegalStateException(J3dI18N
1735: .getString("GeometryArray82"));
1736:
1737: if ((format & COLOR) == 0)
1738: throw new ArrayIndexOutOfBoundsException(J3dI18N
1739: .getString("GeometryArray76"));
1740:
1741: if ((format & WITH_ALPHA) == 0)
1742: throw new IllegalStateException(J3dI18N
1743: .getString("GeometryArray93"));
1744:
1745: ((GeometryArrayRetained) this .retained).setColor(index, color);
1746: }
1747:
1748: /**
1749: * Sets the color associated with the vertex at
1750: * the specified index for this object.
1751: * @param index destination vertex index in this geometry array
1752: * @param color a Color3b containing the new color
1753: * @exception CapabilityNotSetException if the appropriate capability is
1754: * not set and this object is part of a live or compiled scene graph
1755: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
1756: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
1757: * @exception IllegalStateException if the data mode for this geometry
1758: * array object is <code>BY_REFERENCE</code>.
1759: * @exception IllegalStateException if COLOR_4 is specified in the vertex
1760: * format
1761: */
1762: public void setColor(int index, Color3b color) {
1763: if (isLiveOrCompiled())
1764: if (!this .getCapability(ALLOW_COLOR_WRITE))
1765: throw new CapabilityNotSetException(J3dI18N
1766: .getString("GeometryArray15"));
1767:
1768: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1769: if ((format & BY_REFERENCE) != 0)
1770: throw new IllegalStateException(J3dI18N
1771: .getString("GeometryArray82"));
1772:
1773: if ((format & COLOR) == 0)
1774: throw new ArrayIndexOutOfBoundsException(J3dI18N
1775: .getString("GeometryArray76"));
1776:
1777: if ((format & WITH_ALPHA) != 0)
1778: throw new IllegalStateException(J3dI18N
1779: .getString("GeometryArray92"));
1780:
1781: ((GeometryArrayRetained) this .retained).setColor(index, color);
1782: }
1783:
1784: /**
1785: * Sets the color associated with the vertex at
1786: * the specified index for this object.
1787: * @param index destination vertex index in this geometry array
1788: * @param color a Color4b containing the new color
1789: * @exception CapabilityNotSetException if the appropriate capability is
1790: * not set and this object is part of a live or compiled scene graph
1791: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
1792: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
1793: * @exception IllegalStateException if the data mode for this geometry
1794: * array object is <code>BY_REFERENCE</code>.
1795: * @exception IllegalStateException if COLOR_3 is specified in the vertex
1796: * format
1797: */
1798: public void setColor(int index, Color4b color) {
1799: if (isLiveOrCompiled())
1800: if (!this .getCapability(ALLOW_COLOR_WRITE))
1801: throw new CapabilityNotSetException(J3dI18N
1802: .getString("GeometryArray15"));
1803:
1804: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1805: if ((format & BY_REFERENCE) != 0)
1806: throw new IllegalStateException(J3dI18N
1807: .getString("GeometryArray82"));
1808:
1809: if ((format & COLOR) == 0)
1810: throw new ArrayIndexOutOfBoundsException(J3dI18N
1811: .getString("GeometryArray76"));
1812:
1813: if ((format & WITH_ALPHA) == 0)
1814: throw new IllegalStateException(J3dI18N
1815: .getString("GeometryArray93"));
1816:
1817: ((GeometryArrayRetained) this .retained).setColor(index, color);
1818: }
1819:
1820: /**
1821: * Sets the colors associated with the vertices starting at
1822: * the specified index for this object. The entire source array is
1823: * copied to this geometry array.
1824: * @param index starting destination vertex index in this geometry array
1825: * @param colors source array of 3*n or 4*n values containing n new colors
1826: * @exception CapabilityNotSetException if the appropriate capability is
1827: * not set and this object is part of a live or compiled scene graph
1828: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
1829: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
1830: * @exception IllegalStateException if the data mode for this geometry
1831: * array object is <code>BY_REFERENCE</code>.
1832: */
1833: public void setColors(int index, float colors[]) {
1834: if (isLiveOrCompiled())
1835: if (!this .getCapability(ALLOW_COLOR_WRITE))
1836: throw new CapabilityNotSetException(J3dI18N
1837: .getString("GeometryArray21"));
1838:
1839: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1840: if ((format & BY_REFERENCE) != 0)
1841: throw new IllegalStateException(J3dI18N
1842: .getString("GeometryArray82"));
1843:
1844: if ((format & COLOR) == 0)
1845: throw new ArrayIndexOutOfBoundsException(J3dI18N
1846: .getString("GeometryArray76"));
1847:
1848: ((GeometryArrayRetained) this .retained)
1849: .setColors(index, colors);
1850: }
1851:
1852: /**
1853: * Sets the colors associated with the vertices starting at
1854: * the specified index for this object. The entire source array is
1855: * copied to this geometry array.
1856: * @param index starting destination vertex index in this geometry array
1857: * @param colors source array of 3*n or 4*n values containing n new colors
1858: * @exception CapabilityNotSetException if the appropriate capability is
1859: * not set and this object is part of a live or compiled scene graph
1860: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
1861: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
1862: * @exception IllegalStateException if the data mode for this geometry
1863: * array object is <code>BY_REFERENCE</code>.
1864: */
1865: public void setColors(int index, byte colors[]) {
1866: if (isLiveOrCompiled())
1867: if (!this .getCapability(ALLOW_COLOR_WRITE))
1868: throw new CapabilityNotSetException(J3dI18N
1869: .getString("GeometryArray21"));
1870:
1871: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1872: if ((format & BY_REFERENCE) != 0)
1873: throw new IllegalStateException(J3dI18N
1874: .getString("GeometryArray82"));
1875:
1876: if ((format & COLOR) == 0)
1877: throw new ArrayIndexOutOfBoundsException(J3dI18N
1878: .getString("GeometryArray76"));
1879:
1880: ((GeometryArrayRetained) this .retained)
1881: .setColors(index, colors);
1882: }
1883:
1884: /**
1885: * Sets the colors associated with the vertices starting at
1886: * the specified index for this object. The entire source array is
1887: * copied to this geometry array.
1888: * @param index starting destination vertex index in this geometry array
1889: * @param colors source array of Color3f objects containing new colors
1890: * @exception CapabilityNotSetException if the appropriate capability is
1891: * not set and this object is part of a live or compiled scene graph
1892: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
1893: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
1894: * @exception IllegalStateException if the data mode for this geometry
1895: * array object is <code>BY_REFERENCE</code>.
1896: * @exception IllegalStateException if COLOR_4 is specified in vertex format
1897: */
1898: public void setColors(int index, Color3f colors[]) {
1899: if (isLiveOrCompiled())
1900: if (!this .getCapability(ALLOW_COLOR_WRITE))
1901: throw new CapabilityNotSetException(J3dI18N
1902: .getString("GeometryArray21"));
1903:
1904: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1905: if ((format & BY_REFERENCE) != 0)
1906: throw new IllegalStateException(J3dI18N
1907: .getString("GeometryArray82"));
1908:
1909: if ((format & COLOR) == 0)
1910: throw new ArrayIndexOutOfBoundsException(J3dI18N
1911: .getString("GeometryArray76"));
1912:
1913: if ((format & WITH_ALPHA) != 0)
1914: throw new IllegalStateException(J3dI18N
1915: .getString("GeometryArray92"));
1916:
1917: ((GeometryArrayRetained) this .retained)
1918: .setColors(index, colors);
1919: }
1920:
1921: /**
1922: * Sets the colors associated with the vertices starting at
1923: * the specified index for this object. The entire source array is
1924: * copied to this geometry array.
1925: * @param index starting destination vertex index in this geometry array
1926: * @param colors source array of Color4f objects containing new colors
1927: * @exception CapabilityNotSetException if the appropriate capability is
1928: * not set and this object is part of a live or compiled scene graph
1929: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
1930: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
1931: * @exception IllegalStateException if the data mode for this geometry
1932: * array object is <code>BY_REFERENCE</code>.
1933: * @exception IllegalStateException if COLOR_3 is specified in vertex format
1934: */
1935: public void setColors(int index, Color4f colors[]) {
1936: if (isLiveOrCompiled())
1937: if (!this .getCapability(ALLOW_COLOR_WRITE))
1938: throw new CapabilityNotSetException(J3dI18N
1939: .getString("GeometryArray21"));
1940:
1941: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1942: if ((format & BY_REFERENCE) != 0)
1943: throw new IllegalStateException(J3dI18N
1944: .getString("GeometryArray82"));
1945:
1946: if ((format & COLOR) == 0)
1947: throw new ArrayIndexOutOfBoundsException(J3dI18N
1948: .getString("GeometryArray76"));
1949:
1950: if ((format & WITH_ALPHA) == 0)
1951: throw new IllegalStateException(J3dI18N
1952: .getString("GeometryArray93"));
1953:
1954: ((GeometryArrayRetained) this .retained)
1955: .setColors(index, colors);
1956: }
1957:
1958: /**
1959: * Sets the colors associated with the vertices starting at
1960: * the specified index for this object. The entire source array is
1961: * copied to this geometry array.
1962: * @param index starting destination vertex index in this geometry array
1963: * @param colors source array of Color3b objects containing new colors
1964: * @exception CapabilityNotSetException if the appropriate capability is
1965: * not set and this object is part of a live or compiled scene graph
1966: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
1967: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
1968: * @exception IllegalStateException if the data mode for this geometry
1969: * array object is <code>BY_REFERENCE</code>.
1970: * @exception IllegalStateException if COLOR_4 is specified in vertex format
1971: */
1972: public void setColors(int index, Color3b colors[]) {
1973: if (isLiveOrCompiled())
1974: if (!this .getCapability(ALLOW_COLOR_WRITE))
1975: throw new CapabilityNotSetException(J3dI18N
1976: .getString("GeometryArray21"));
1977:
1978: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
1979: if ((format & BY_REFERENCE) != 0)
1980: throw new IllegalStateException(J3dI18N
1981: .getString("GeometryArray82"));
1982:
1983: if ((format & COLOR) == 0)
1984: throw new ArrayIndexOutOfBoundsException(J3dI18N
1985: .getString("GeometryArray76"));
1986:
1987: if ((format & WITH_ALPHA) != 0)
1988: throw new IllegalStateException(J3dI18N
1989: .getString("GeometryArray92"));
1990:
1991: ((GeometryArrayRetained) this .retained)
1992: .setColors(index, colors);
1993: }
1994:
1995: /**
1996: * Sets the colors associated with the vertices starting at
1997: * the specified index for this object. The entire source array is
1998: * copied to this geometry array.
1999: * @param index starting destination vertex index in this geometry array
2000: * @param colors source array of Color4b objects containing new colors
2001: * @exception CapabilityNotSetException if the appropriate capability is
2002: * not set and this object is part of a live or compiled scene graph
2003: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
2004: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
2005: * @exception IllegalStateException if the data mode for this geometry
2006: * array object is <code>BY_REFERENCE</code>.
2007: * @exception IllegalStateException if COLOR_3 is specified in vertex format
2008: */
2009: public void setColors(int index, Color4b colors[]) {
2010: if (isLiveOrCompiled())
2011: if (!this .getCapability(ALLOW_COLOR_WRITE))
2012: throw new CapabilityNotSetException(J3dI18N
2013: .getString("GeometryArray21"));
2014:
2015: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
2016: if ((format & BY_REFERENCE) != 0)
2017: throw new IllegalStateException(J3dI18N
2018: .getString("GeometryArray82"));
2019:
2020: if ((format & COLOR) == 0)
2021: throw new ArrayIndexOutOfBoundsException(J3dI18N
2022: .getString("GeometryArray76"));
2023:
2024: if ((format & WITH_ALPHA) == 0)
2025: throw new IllegalStateException(J3dI18N
2026: .getString("GeometryArray93"));
2027:
2028: ((GeometryArrayRetained) this .retained)
2029: .setColors(index, colors);
2030: }
2031:
2032: /**
2033: * Sets the colors associated with the vertices starting at
2034: * the specified index for this object using data in <code>colors</code>
2035: * starting at index <code>start</code> for <code>length</code> colors.
2036: * @param index starting destination vertex index in this geometry array
2037: * @param colors source array of 3*n or 4*n values containing n new colors
2038: * @param start starting source vertex index in <code>colors</code> array.
2039: * @param length number of colors to be copied.
2040: * @exception CapabilityNotSetException if the appropriate capability is
2041: * not set and this object is part of a live or compiled scene graph
2042: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
2043: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
2044: * @exception IllegalStateException if the data mode for this geometry
2045: * array object is <code>BY_REFERENCE</code>.
2046: */
2047: public void setColors(int index, float colors[], int start,
2048: int length) {
2049: if (isLiveOrCompiled())
2050: if (!this .getCapability(ALLOW_COLOR_WRITE))
2051: throw new CapabilityNotSetException(J3dI18N
2052: .getString("GeometryArray21"));
2053:
2054: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
2055: if ((format & BY_REFERENCE) != 0)
2056: throw new IllegalStateException(J3dI18N
2057: .getString("GeometryArray82"));
2058:
2059: if ((format & COLOR) == 0)
2060: throw new ArrayIndexOutOfBoundsException(J3dI18N
2061: .getString("GeometryArray76"));
2062:
2063: ((GeometryArrayRetained) this .retained).setColors(index,
2064: colors, start, length);
2065: }
2066:
2067: /**
2068: * Sets the colors associated with the vertices starting at
2069: * the specified index for this object using data in <code>colors</code>
2070: * starting at index <code>start</code> for <code>length</code> colors.
2071: * @param index starting destination vertex index in this geometry array
2072: * @param colors source array of 3*n or 4*n values containing n new colors
2073: * @param start starting source vertex index in <code>colors</code> array.
2074: * @param length number of colors to be copied.
2075: * @exception CapabilityNotSetException if the appropriate capability is
2076: * not set and this object is part of a live or compiled scene graph
2077: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
2078: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
2079: * @exception IllegalStateException if the data mode for this geometry
2080: * array object is <code>BY_REFERENCE</code>.
2081: */
2082: public void setColors(int index, byte colors[], int start,
2083: int length) {
2084: if (isLiveOrCompiled())
2085: if (!this .getCapability(ALLOW_COLOR_WRITE))
2086: throw new CapabilityNotSetException(J3dI18N
2087: .getString("GeometryArray21"));
2088:
2089: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
2090: if ((format & BY_REFERENCE) != 0)
2091: throw new IllegalStateException(J3dI18N
2092: .getString("GeometryArray82"));
2093:
2094: if ((format & COLOR) == 0)
2095: throw new ArrayIndexOutOfBoundsException(J3dI18N
2096: .getString("GeometryArray76"));
2097:
2098: ((GeometryArrayRetained) this .retained).setColors(index,
2099: colors, start, length);
2100: }
2101:
2102: /**
2103: * Sets the colors associated with the vertices starting at
2104: * the specified index for this object using data in <code>colors</code>
2105: * starting at index <code>start</code> for <code>length</code> colors.
2106: * @param index starting destination vertex index in this geometry array
2107: * @param colors source array of Color3f objects containing new colors
2108: * @param start starting source vertex index in <code>colors</code> array.
2109: * @param length number of colors to be copied.
2110: * @exception CapabilityNotSetException if the appropriate capability is
2111: * not set and this object is part of a live or compiled scene graph
2112: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
2113: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
2114: * @exception IllegalStateException if the data mode for this geometry
2115: * array object is <code>BY_REFERENCE</code>.
2116: * @exception IllegalStateException if COLOR_4 is specified in vertex format
2117: */
2118: public void setColors(int index, Color3f colors[], int start,
2119: int length) {
2120: if (isLiveOrCompiled())
2121: if (!this .getCapability(ALLOW_COLOR_WRITE))
2122: throw new CapabilityNotSetException(J3dI18N
2123: .getString("GeometryArray21"));
2124:
2125: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
2126: if ((format & BY_REFERENCE) != 0)
2127: throw new IllegalStateException(J3dI18N
2128: .getString("GeometryArray82"));
2129:
2130: if ((format & COLOR) == 0)
2131: throw new ArrayIndexOutOfBoundsException(J3dI18N
2132: .getString("GeometryArray76"));
2133:
2134: if ((format & WITH_ALPHA) != 0)
2135: throw new IllegalStateException(J3dI18N
2136: .getString("GeometryArray92"));
2137:
2138: ((GeometryArrayRetained) this .retained).setColors(index,
2139: colors, start, length);
2140: }
2141:
2142: /**
2143: * Sets the colors associated with the vertices starting at
2144: * the specified index for this object using data in <code>colors</code>
2145: * starting at index <code>start</code> for <code>length</code> colors.
2146: * @param index starting destination vertex index in this geometry array
2147: * @param colors source array of Color4f objects containing new colors
2148: * @param start starting source vertex index in <code>colors</code> array.
2149: * @param length number of colors to be copied.
2150: * @exception CapabilityNotSetException if the appropriate capability is
2151: * not set and this object is part of a live or compiled scene graph
2152: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
2153: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
2154: * @exception IllegalStateException if the data mode for this geometry
2155: * array object is <code>BY_REFERENCE</code>.
2156: * @exception IllegalStateException if COLOR_3 is specified in vertex format
2157: */
2158: public void setColors(int index, Color4f colors[], int start,
2159: int length) {
2160: if (isLiveOrCompiled())
2161: if (!this .getCapability(ALLOW_COLOR_WRITE))
2162: throw new CapabilityNotSetException(J3dI18N
2163: .getString("GeometryArray21"));
2164:
2165: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
2166: if ((format & BY_REFERENCE) != 0)
2167: throw new IllegalStateException(J3dI18N
2168: .getString("GeometryArray82"));
2169:
2170: if ((format & COLOR) == 0)
2171: throw new ArrayIndexOutOfBoundsException(J3dI18N
2172: .getString("GeometryArray76"));
2173:
2174: if ((format & WITH_ALPHA) == 0)
2175: throw new IllegalStateException(J3dI18N
2176: .getString("GeometryArray93"));
2177:
2178: ((GeometryArrayRetained) this .retained).setColors(index,
2179: colors, start, length);
2180: }
2181:
2182: /**
2183: * Sets the colors associated with the vertices starting at
2184: * the specified index for this object using data in <code>colors</code>
2185: * starting at index <code>start</code> for <code>length</code> colors.
2186: * @param index starting destination vertex index in this geometry array
2187: * @param colors source array of Color3b objects containing new colors
2188: * @param start starting source vertex index in <code>colors</code> array.
2189: * @param length number of colors to be copied.
2190: * @exception CapabilityNotSetException if the appropriate capability is
2191: * not set and this object is part of a live or compiled scene graph
2192: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
2193: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
2194: * @exception IllegalStateException if the data mode for this geometry
2195: * array object is <code>BY_REFERENCE</code>.
2196: * @exception IllegalStateException if COLOR_4 is specified in vertex format
2197: */
2198: public void setColors(int index, Color3b colors[], int start,
2199: int length) {
2200: if (isLiveOrCompiled())
2201: if (!this .getCapability(ALLOW_COLOR_WRITE))
2202: throw new CapabilityNotSetException(J3dI18N
2203: .getString("GeometryArray21"));
2204:
2205: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
2206: if ((format & BY_REFERENCE) != 0)
2207: throw new IllegalStateException(J3dI18N
2208: .getString("GeometryArray82"));
2209:
2210: if ((format & COLOR) == 0)
2211: throw new ArrayIndexOutOfBoundsException(J3dI18N
2212: .getString("GeometryArray76"));
2213:
2214: if ((format & WITH_ALPHA) != 0)
2215: throw new IllegalStateException(J3dI18N
2216: .getString("GeometryArray92"));
2217:
2218: ((GeometryArrayRetained) this .retained).setColors(index,
2219: colors, start, length);
2220: }
2221:
2222: /**
2223: * Sets the colors associated with the vertices starting at
2224: * the specified index for this object using data in <code>colors</code>
2225: * starting at index <code>start</code> for <code>length</code> colors.
2226: * @param index starting destination vertex index in this geometry array
2227: * @param colors source array of Color4b objects containing new colors
2228: * @param start starting source vertex index in <code>colors</code> array.
2229: * @param length number of colors to be copied.
2230: * @exception CapabilityNotSetException if the appropriate capability is
2231: * not set and this object is part of a live or compiled scene graph
2232: * @exception ArrayIndexOutOfBoundsException if COLOR bit NOT set in
2233: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
2234: * @exception IllegalStateException if the data mode for this geometry
2235: * array object is <code>BY_REFERENCE</code>.
2236: * @exception IllegalStateException if COLOR_3 is specified in vertex format
2237: */
2238: public void setColors(int index, Color4b colors[], int start,
2239: int length) {
2240: if (isLiveOrCompiled())
2241: if (!this .getCapability(ALLOW_COLOR_WRITE))
2242: throw new CapabilityNotSetException(J3dI18N
2243: .getString("GeometryArray21"));
2244:
2245: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
2246: if ((format & BY_REFERENCE) != 0)
2247: throw new IllegalStateException(J3dI18N
2248: .getString("GeometryArray82"));
2249:
2250: if ((format & COLOR) == 0)
2251: throw new ArrayIndexOutOfBoundsException(J3dI18N
2252: .getString("GeometryArray76"));
2253:
2254: if ((format & WITH_ALPHA) == 0)
2255: throw new IllegalStateException(J3dI18N
2256: .getString("GeometryArray93"));
2257:
2258: ((GeometryArrayRetained) this .retained).setColors(index,
2259: colors, start, length);
2260: }
2261:
2262: /**
2263: * Sets the normal associated with the vertex at
2264: * the specified index for this object.
2265: * @param index destination vertex index in this geometry array
2266: * @param normal source array of 3 values containing the new normal
2267: * @exception CapabilityNotSetException if the appropriate capability is
2268: * not set and this object is part of a live or compiled scene graph
2269: * @exception ArrayIndexOutOfBoundsException if NORMALS bit NOT set in
2270: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
2271: * @exception IllegalStateException if the data mode for this geometry
2272: * array object is <code>BY_REFERENCE</code>.
2273: */
2274: public void setNormal(int index, float normal[]) {
2275: if (isLiveOrCompiled())
2276: if (!this .getCapability(ALLOW_NORMAL_WRITE))
2277: throw new CapabilityNotSetException(J3dI18N
2278: .getString("GeometryArray33"));
2279:
2280: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
2281: if ((format & BY_REFERENCE) != 0)
2282: throw new IllegalStateException(J3dI18N
2283: .getString("GeometryArray82"));
2284:
2285: if ((format & NORMALS) == 0)
2286: throw new ArrayIndexOutOfBoundsException(J3dI18N
2287: .getString("GeometryArray77"));
2288:
2289: ((GeometryArrayRetained) this .retained)
2290: .setNormal(index, normal);
2291: }
2292:
2293: /**
2294: * Sets the normal associated with the vertex at
2295: * the specified index for this object.
2296: * @param index destination vertex index in this geometry array
2297: * @param normal the vector containing the new normal
2298: * @exception CapabilityNotSetException if the appropriate capability is
2299: * not set and this object is part of a live or compiled scene graph
2300: * @exception ArrayIndexOutOfBoundsException if NORMALS bit NOT set in
2301: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
2302: * @exception IllegalStateException if the data mode for this geometry
2303: * array object is <code>BY_REFERENCE</code>.
2304: */
2305: public void setNormal(int index, Vector3f normal) {
2306: if (isLiveOrCompiled())
2307: if (!this .getCapability(ALLOW_NORMAL_WRITE))
2308: throw new CapabilityNotSetException(J3dI18N
2309: .getString("GeometryArray33"));
2310:
2311: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
2312: if ((format & BY_REFERENCE) != 0)
2313: throw new IllegalStateException(J3dI18N
2314: .getString("GeometryArray82"));
2315:
2316: if ((format & NORMALS) == 0)
2317: throw new ArrayIndexOutOfBoundsException(J3dI18N
2318: .getString("GeometryArray77"));
2319:
2320: ((GeometryArrayRetained) this .retained)
2321: .setNormal(index, normal);
2322: }
2323:
2324: /**
2325: * Sets the normals associated with the vertices starting at
2326: * the specified index for this object. The entire source array is
2327: * copied to this geometry array.
2328: * @param index starting destination vertex index in this geometry array
2329: * @param normals source array of 3*n values containing n new normals
2330: * @exception CapabilityNotSetException if the appropriate capability is
2331: * not set and this object is part of a live or compiled scene graph
2332: * @exception ArrayIndexOutOfBoundsException if NORMALS bit NOT set in
2333: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
2334: * @exception IllegalStateException if the data mode for this geometry
2335: * array object is <code>BY_REFERENCE</code>.
2336: */
2337: public void setNormals(int index, float normals[]) {
2338: if (isLiveOrCompiled())
2339: if (!this .getCapability(ALLOW_NORMAL_WRITE))
2340: throw new CapabilityNotSetException(J3dI18N
2341: .getString("GeometryArray35"));
2342:
2343: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
2344: if ((format & BY_REFERENCE) != 0)
2345: throw new IllegalStateException(J3dI18N
2346: .getString("GeometryArray82"));
2347:
2348: if ((format & NORMALS) == 0)
2349: throw new ArrayIndexOutOfBoundsException(J3dI18N
2350: .getString("GeometryArray77"));
2351:
2352: ((GeometryArrayRetained) this .retained).setNormals(index,
2353: normals);
2354: }
2355:
2356: /**
2357: * Sets the normals associated with the vertices starting at
2358: * the specified index for this object. The entire source array is
2359: * copied to this geometry array.
2360: * @param index starting destination vertex index in this geometry array
2361: * @param normals source array of vectors containing new normals
2362: * @exception CapabilityNotSetException if the appropriate capability is
2363: * not set and this object is part of a live or compiled scene graph
2364: * @exception ArrayIndexOutOfBoundsException if NORMALS bit NOT set in
2365: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
2366: * @exception IllegalStateException if the data mode for this geometry
2367: * array object is <code>BY_REFERENCE</code>.
2368: */
2369: public void setNormals(int index, Vector3f normals[]) {
2370: if (isLiveOrCompiled())
2371: if (!this .getCapability(ALLOW_NORMAL_WRITE))
2372: throw new CapabilityNotSetException(J3dI18N
2373: .getString("GeometryArray35"));
2374:
2375: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
2376: if ((format & BY_REFERENCE) != 0)
2377: throw new IllegalStateException(J3dI18N
2378: .getString("GeometryArray82"));
2379:
2380: if ((format & NORMALS) == 0)
2381: throw new ArrayIndexOutOfBoundsException(J3dI18N
2382: .getString("GeometryArray77"));
2383:
2384: ((GeometryArrayRetained) this .retained).setNormals(index,
2385: normals);
2386: }
2387:
2388: /**
2389: * Sets the normals associated with the vertices starting at
2390: * the specified index for this object using data in <code>normals</code>
2391: * starting at index <code>start</code> and ending at index <code>start+length</code>.
2392: * @param index starting destination vertex index in this geometry array
2393: * @param normals source array of 3*n values containing n new normals
2394: * @param start starting source vertex index in <code>normals</code> array.
2395: * @param length number of normals to be copied.
2396: * @exception CapabilityNotSetException if the appropriate capability is
2397: * not set and this object is part of a live or compiled scene graph
2398: * @exception ArrayIndexOutOfBoundsException if NORMALS bit NOT set in
2399: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
2400: * @exception IllegalStateException if the data mode for this geometry
2401: * array object is <code>BY_REFERENCE</code>.
2402: */
2403: public void setNormals(int index, float normals[], int start,
2404: int length) {
2405: if (isLiveOrCompiled())
2406: if (!this .getCapability(ALLOW_NORMAL_WRITE))
2407: throw new CapabilityNotSetException(J3dI18N
2408: .getString("GeometryArray35"));
2409:
2410: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
2411: if ((format & BY_REFERENCE) != 0)
2412: throw new IllegalStateException(J3dI18N
2413: .getString("GeometryArray82"));
2414:
2415: if ((format & NORMALS) == 0)
2416: throw new ArrayIndexOutOfBoundsException(J3dI18N
2417: .getString("GeometryArray77"));
2418:
2419: ((GeometryArrayRetained) this .retained).setNormals(index,
2420: normals, start, length);
2421: }
2422:
2423: /**
2424: * Sets the normals associated with the vertices starting at
2425: * the specified index for this object using data in <code>normals</code>
2426: * starting at index <code>start</code> and ending at index <code>start+length</code>.
2427: * @param index starting destination vertex index in this geometry array
2428: * @param normals source array of vectors containing new normals
2429: * @param start starting source vertex index in <code>normals</code> array.
2430: * @param length number of normals to be copied.
2431: * @exception CapabilityNotSetException if the appropriate capability is
2432: * not set and this object is part of a live or compiled scene graph
2433: * @exception ArrayIndexOutOfBoundsException if NORMALS bit NOT set in
2434: * constructor <code>vertexFormat</code> or array index for element is out of bounds.
2435: * @exception IllegalStateException if the data mode for this geometry
2436: * array object is <code>BY_REFERENCE</code>.
2437: */
2438: public void setNormals(int index, Vector3f normals[], int start,
2439: int length) {
2440: if (isLiveOrCompiled())
2441: if (!this .getCapability(ALLOW_NORMAL_WRITE))
2442: throw new CapabilityNotSetException(J3dI18N
2443: .getString("GeometryArray35"));
2444:
2445: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
2446: if ((format & BY_REFERENCE) != 0)
2447: throw new IllegalStateException(J3dI18N
2448: .getString("GeometryArray82"));
2449:
2450: if ((format & NORMALS) == 0)
2451: throw new ArrayIndexOutOfBoundsException(J3dI18N
2452: .getString("GeometryArray77"));
2453:
2454: ((GeometryArrayRetained) this .retained).setNormals(index,
2455: normals, start, length);
2456: }
2457:
2458: /**
2459: * @deprecated As of Java 3D version 1.2, replaced by
2460: * <code>setTextureCoordinate(int texCoordSet, ...)</code>
2461: */
2462: public void setTextureCoordinate(int index, float texCoord[]) {
2463: setTextureCoordinate(0, index, texCoord);
2464: }
2465:
2466: /**
2467: * Sets the texture coordinate associated with the vertex at the
2468: * specified index in the specified texture coordinate set for
2469: * this object.
2470: *
2471: * @param texCoordSet texture coordinate set in this geometry array
2472: * @param index destination vertex index in this geometry array
2473: * @param texCoord source array of 2, 3 or 4 values containing the new
2474: * texture coordinate
2475: *
2476: * @exception CapabilityNotSetException if the appropriate capability is
2477: * not set and this object is part of a live or compiled scene graph
2478: *
2479: * @exception ArrayIndexOutOfBoundsException if none of the
2480: * <code>TEXTURE_COORDINATE</code> bits are set in the
2481: * <code>vertexFormat</code> or if the index or
2482: * texCoordSet is out of range.
2483: *
2484: * @exception IllegalStateException if the data mode for this geometry
2485: * array object is <code>BY_REFERENCE</code>.
2486: *
2487: * @since Java 3D 1.2
2488: */
2489: public void setTextureCoordinate(int texCoordSet, int index,
2490: float texCoord[]) {
2491: if (isLiveOrCompiled())
2492: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
2493: throw new CapabilityNotSetException(J3dI18N
2494: .getString("GeometryArray39"));
2495:
2496: ((GeometryArrayRetained) this .retained).setTextureCoordinates(
2497: texCoordSet, index, texCoord, 0, 1);
2498: }
2499:
2500: /**
2501: * @deprecated As of Java 3D version 1.2, replaced by
2502: * <code>setTextureCoordinate(int texCoordSet, TexCoord2f texCoord)</code>
2503: */
2504: public void setTextureCoordinate(int index, Point2f texCoord) {
2505: texCoord2fScratch.set(texCoord);
2506: setTextureCoordinate(0, index, texCoord2fScratch);
2507: }
2508:
2509: /**
2510: * Sets the texture coordinate associated with the vertex at
2511: * the specified index in the specified texture coordinate set
2512: * for this object.
2513: *
2514: * @param texCoordSet texture coordinate set in this geometry array
2515: * @param index destination vertex index in this geometry array
2516: * @param texCoord the TexCoord2f containing the new texture coordinate
2517: *
2518: * @exception CapabilityNotSetException if the appropriate capability is
2519: * not set and this object is part of a live or compiled scene graph
2520: *
2521: * @exception ArrayIndexOutOfBoundsException if none of the
2522: * <code>TEXTURE_COORDINATE</code> bits are set in the
2523: * <code>vertexFormat</code> or if the index or
2524: * texCoordSet is out of range.
2525: *
2526: * @exception IllegalStateException if the data mode for this geometry
2527: * array object is <code>BY_REFERENCE</code>.
2528: *
2529: * @exception IllegalStateException if TEXTURE_COORDINATE_3 or
2530: * TEXTURE_COORDINATE_4 is specified in vertex format
2531: *
2532: * @since Java 3D 1.2
2533: */
2534: public void setTextureCoordinate(int texCoordSet, int index,
2535: TexCoord2f texCoord) {
2536: if (isLiveOrCompiled())
2537: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
2538: throw new CapabilityNotSetException(J3dI18N
2539: .getString("GeometryArray39"));
2540:
2541: if (((((GeometryArrayRetained) this .retained).vertexFormat) & (TEXTURE_COORDINATE_3 | TEXTURE_COORDINATE_4)) != 0)
2542: throw new IllegalStateException(J3dI18N
2543: .getString("GeometryArray94"));
2544:
2545: texCoord2fArray[0] = texCoord;
2546: ((GeometryArrayRetained) this .retained).setTextureCoordinates(
2547: texCoordSet, index, texCoord2fArray, 0, 1);
2548: }
2549:
2550: /**
2551: * @deprecated As of Java 3D version 1.2, replaced by
2552: * <code>setTextureCoordinate(int texCoordSet, TexCoord3f texCoord)</code>
2553: */
2554: public void setTextureCoordinate(int index, Point3f texCoord) {
2555: texCoord3fScratch.set(texCoord);
2556: setTextureCoordinate(0, index, texCoord3fScratch);
2557: }
2558:
2559: /**
2560: * Sets the texture coordinate associated with the vertex at
2561: * the specified index in the specified texture coordinate set
2562: * for this object.
2563: *
2564: * @param texCoordSet texture coordinate set in this geometry array
2565: * @param index destination vertex index in this geometry array
2566: * @param texCoord the TexCoord3f containing the new texture coordinate
2567: *
2568: * @exception CapabilityNotSetException if the appropriate capability is
2569: * not set and this object is part of a live or compiled scene graph
2570: *
2571: * @exception ArrayIndexOutOfBoundsException if none of the
2572: * <code>TEXTURE_COORDINATE</code> bits are set in the
2573: * <code>vertexFormat</code> or if the index or
2574: * texCoordSet is out of range.
2575: *
2576: * @exception IllegalStateException if the data mode for this geometry
2577: * array object is <code>BY_REFERENCE</code>.
2578: *
2579: * @exception IllegalStateException if TEXTURE_COORDINATE_2 or
2580: * TEXTURE_COORDINATE_4 is specified in vertex format
2581: *
2582: * @since Java 3D 1.2
2583: */
2584: public void setTextureCoordinate(int texCoordSet, int index,
2585: TexCoord3f texCoord) {
2586: if (isLiveOrCompiled())
2587: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
2588: throw new CapabilityNotSetException(J3dI18N
2589: .getString("GeometryArray39"));
2590:
2591: if (((((GeometryArrayRetained) this .retained).vertexFormat) & (TEXTURE_COORDINATE_2 | TEXTURE_COORDINATE_4)) != 0)
2592: throw new IllegalStateException(J3dI18N
2593: .getString("GeometryArray95"));
2594:
2595: texCoord3fArray[0] = texCoord;
2596: ((GeometryArrayRetained) this .retained).setTextureCoordinates(
2597: texCoordSet, index, texCoord3fArray, 0, 1);
2598: }
2599:
2600: /**
2601: * Sets the texture coordinate associated with the vertex at
2602: * the specified index in the specified texture coordinate set
2603: * for this object.
2604: *
2605: * @param texCoordSet texture coordinate set in this geometry array
2606: * @param index destination vertex index in this geometry array
2607: * @param texCoord the TexCoord4f containing the new texture coordinate
2608: *
2609: * @exception CapabilityNotSetException if the appropriate capability is
2610: * not set and this object is part of a live or compiled scene graph
2611: *
2612: * @exception ArrayIndexOutOfBoundsException if none of the
2613: * <code>TEXTURE_COORDINATE</code> bits are set in the
2614: * <code>vertexFormat</code> or if the index or
2615: * texCoordSet is out of range.
2616: *
2617: * @exception IllegalStateException if the data mode for this geometry
2618: * array object is <code>BY_REFERENCE</code>.
2619: *
2620: * @exception IllegalStateException if TEXTURE_COORDINATE_2 or
2621: * TEXTURE_COORDINATE_3 is specified in vertex format
2622: *
2623: * @since Java 3D 1.3
2624: */
2625: public void setTextureCoordinate(int texCoordSet, int index,
2626: TexCoord4f texCoord) {
2627: if (isLiveOrCompiled())
2628: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
2629: throw new CapabilityNotSetException(J3dI18N
2630: .getString("GeometryArray39"));
2631:
2632: if (((((GeometryArrayRetained) this .retained).vertexFormat) & (TEXTURE_COORDINATE_2 | TEXTURE_COORDINATE_3)) != 0)
2633: throw new IllegalStateException(J3dI18N
2634: .getString("GeometryArray109"));
2635:
2636: texCoord4fArray[0] = texCoord;
2637: ((GeometryArrayRetained) this .retained).setTextureCoordinates(
2638: texCoordSet, index, texCoord4fArray, 0, 1);
2639: }
2640:
2641: /**
2642: * @deprecated As of Java 3D version 1.2, replaced by
2643: * <code>setTextureCoordinates(int texCoordSet, ...)</code>
2644: */
2645: public void setTextureCoordinates(int index, float texCoords[]) {
2646: setTextureCoordinates(0, index, texCoords);
2647: }
2648:
2649: /**
2650: * Sets the texture coordinates associated with the vertices starting at
2651: * the specified index in the specified texture coordinate set
2652: * for this object. The entire source array is
2653: * copied to this geometry array.
2654: *
2655: * @param texCoordSet texture coordinate set in this geometry array
2656: * @param index starting destination vertex index in this geometry array
2657: * @param texCoords source array of 2*n, 3*n or 4*n values containing n new
2658: * texture coordinates
2659: *
2660: * @exception CapabilityNotSetException if the appropriate capability is
2661: * not set and this object is part of a live or compiled scene graph
2662: *
2663: * @exception ArrayIndexOutOfBoundsException if none of the
2664: * <code>TEXTURE_COORDINATE</code> bits are set in the
2665: * <code>vertexFormat</code> or if the index or
2666: * texCoordSet is out of range.
2667: *
2668: * @exception IllegalStateException if the data mode for this geometry
2669: * array object is <code>BY_REFERENCE</code>.
2670: *
2671: * @since Java 3D 1.2
2672: */
2673: public void setTextureCoordinates(int texCoordSet, int index,
2674: float texCoords[]) {
2675: if (isLiveOrCompiled())
2676: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
2677: throw new CapabilityNotSetException(J3dI18N
2678: .getString("GeometryArray42"));
2679:
2680: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
2681: if ((format & GeometryArray.TEXTURE_COORDINATE_2) != 0)
2682: ((GeometryArrayRetained) this .retained)
2683: .setTextureCoordinates(texCoordSet, index,
2684: texCoords, 0, texCoords.length / 2);
2685: else if ((format & GeometryArray.TEXTURE_COORDINATE_3) != 0)
2686: ((GeometryArrayRetained) this .retained)
2687: .setTextureCoordinates(texCoordSet, index,
2688: texCoords, 0, texCoords.length / 3);
2689: else
2690: ((GeometryArrayRetained) this .retained)
2691: .setTextureCoordinates(texCoordSet, index,
2692: texCoords, 0, texCoords.length / 4);
2693: }
2694:
2695: /**
2696: * @deprecated As of Java 3D version 1.2, replaced by
2697: * <code>setTextureCoordinates(int texCoordSet, TexCoord2f texCoords[])</code>
2698: */
2699: public void setTextureCoordinates(int index, Point2f texCoords[]) {
2700:
2701: if (isLiveOrCompiled())
2702: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
2703: throw new CapabilityNotSetException(J3dI18N
2704: .getString("GeometryArray42"));
2705:
2706: ((GeometryArrayRetained) this .retained).setTextureCoordinates(
2707: 0, index, texCoords, 0, texCoords.length);
2708: }
2709:
2710: /**
2711: * Sets the texture coordinates associated with the vertices starting at
2712: * the specified index in the specified texture coordinate set
2713: * for this object. The entire source array is
2714: * copied to this geometry array.
2715: *
2716: * @param texCoordSet texture coordinate set in this geometry array
2717: * @param index starting destination vertex index in this geometry array
2718: * @param texCoords source array of TexCoord2f objects containing new
2719: * texture coordinates
2720: *
2721: * @exception CapabilityNotSetException if the appropriate capability is
2722: * not set and this object is part of a live or compiled scene graph
2723: *
2724: * @exception ArrayIndexOutOfBoundsException if none of the
2725: * <code>TEXTURE_COORDINATE</code> bits are set in the
2726: * <code>vertexFormat</code> or if the index or
2727: * texCoordSet is out of range.
2728: *
2729: * @exception IllegalStateException if the data mode for this geometry
2730: * array object is <code>BY_REFERENCE</code>.
2731: *
2732: * @exception IllegalStateException if TEXTURE_COORDINATE_3 or
2733: * TEXTURE_COORDINATE_4 is specified in vertex format
2734: *
2735: * @since Java 3D 1.2
2736: */
2737: public void setTextureCoordinates(int texCoordSet, int index,
2738: TexCoord2f texCoords[]) {
2739: if (isLiveOrCompiled())
2740: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
2741: throw new CapabilityNotSetException(J3dI18N
2742: .getString("GeometryArray42"));
2743:
2744: if (((((GeometryArrayRetained) this .retained).vertexFormat) & (TEXTURE_COORDINATE_3 | TEXTURE_COORDINATE_4)) != 0)
2745: throw new IllegalStateException(J3dI18N
2746: .getString("GeometryArray94"));
2747:
2748: ((GeometryArrayRetained) this .retained).setTextureCoordinates(
2749: texCoordSet, index, texCoords, 0, texCoords.length);
2750: }
2751:
2752: /**
2753: * @deprecated As of Java 3D version 1.2, replaced by
2754: * <code>setTextureCoordinates(int texCoordSet, TexCoord3f texCoords[])</code>
2755: */
2756: public void setTextureCoordinates(int index, Point3f texCoords[]) {
2757: if (isLiveOrCompiled())
2758: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
2759: throw new CapabilityNotSetException(J3dI18N
2760: .getString("GeometryArray42"));
2761:
2762: ((GeometryArrayRetained) this .retained).setTextureCoordinates(
2763: 0, index, texCoords, 0, texCoords.length);
2764: }
2765:
2766: /**
2767: * Sets the texture coordinates associated with the vertices starting at
2768: * the specified index in the specified texture coordinate set
2769: * for this object. The entire source array is
2770: * copied to this geometry array.
2771: *
2772: * @param texCoordSet texture coordinate set in this geometry array
2773: * @param index starting destination vertex index in this geometry array
2774: * @param texCoords source array of TexCoord3f objects containing new
2775: * texture coordinates
2776: *
2777: * @exception CapabilityNotSetException if the appropriate capability is
2778: * not set and this object is part of a live or compiled scene graph
2779: *
2780: * @exception ArrayIndexOutOfBoundsException if none of the
2781: * <code>TEXTURE_COORDINATE</code> bits are set in the
2782: * <code>vertexFormat</code> or if the index or
2783: * texCoordSet is out of range.
2784: *
2785: * @exception IllegalStateException if the data mode for this geometry
2786: * array object is <code>BY_REFERENCE</code>.
2787: *
2788: * @exception IllegalStateException if TEXTURE_COORDINATE_2 or
2789: * TEXTURE_COORDINATE_4 is specified in vertex format
2790: *
2791: * @since Java 3D 1.2
2792: */
2793: public void setTextureCoordinates(int texCoordSet, int index,
2794: TexCoord3f texCoords[]) {
2795: if (isLiveOrCompiled())
2796: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
2797: throw new CapabilityNotSetException(J3dI18N
2798: .getString("GeometryArray42"));
2799:
2800: if (((((GeometryArrayRetained) this .retained).vertexFormat) & (TEXTURE_COORDINATE_2 | TEXTURE_COORDINATE_4)) != 0)
2801: throw new IllegalStateException(J3dI18N
2802: .getString("GeometryArray95"));
2803:
2804: ((GeometryArrayRetained) this .retained).setTextureCoordinates(
2805: texCoordSet, index, texCoords, 0, texCoords.length);
2806: }
2807:
2808: /**
2809: * Sets the texture coordinates associated with the vertices starting at
2810: * the specified index in the specified texture coordinate set
2811: * for this object. The entire source array is
2812: * copied to this geometry array.
2813: *
2814: * @param texCoordSet texture coordinate set in this geometry array
2815: * @param index starting destination vertex index in this geometry array
2816: * @param texCoords source array of TexCoord4f objects containing new
2817: * texture coordinates
2818: *
2819: * @exception CapabilityNotSetException if the appropriate capability is
2820: * not set and this object is part of a live or compiled scene graph
2821: *
2822: * @exception ArrayIndexOutOfBoundsException if none of the
2823: * <code>TEXTURE_COORDINATE</code> bits are set in the
2824: * <code>vertexFormat</code> or if the index or
2825: * texCoordSet is out of range.
2826: *
2827: * @exception IllegalStateException if the data mode for this geometry
2828: * array object is <code>BY_REFERENCE</code>.
2829: *
2830: * @exception IllegalStateException if TEXTURE_COORDINATE_2 or
2831: * TEXTURE_COORDINATE_3 is specified in vertex format
2832: *
2833: * @since Java 3D 1.3
2834: */
2835: public void setTextureCoordinates(int texCoordSet, int index,
2836: TexCoord4f texCoords[]) {
2837: if (isLiveOrCompiled())
2838: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
2839: throw new CapabilityNotSetException(J3dI18N
2840: .getString("GeometryArray42"));
2841:
2842: if (((((GeometryArrayRetained) this .retained).vertexFormat) & (TEXTURE_COORDINATE_2 | TEXTURE_COORDINATE_3)) != 0)
2843: throw new IllegalStateException(J3dI18N
2844: .getString("GeometryArray109"));
2845:
2846: ((GeometryArrayRetained) this .retained).setTextureCoordinates(
2847: texCoordSet, index, texCoords, 0, texCoords.length);
2848: }
2849:
2850: /**
2851: * @deprecated As of Java 3D version 1.2, replaced by
2852: * <code>setTextureCoordinates(int texCoordSet, ...)</code>
2853: */
2854: public void setTextureCoordinates(int index, float texCoords[],
2855: int start, int length) {
2856: setTextureCoordinates(0, index, texCoords, start, length);
2857: }
2858:
2859: /**
2860: * Sets the texture coordinates associated with the vertices
2861: * starting at the specified index in the specified texture
2862: * coordinate set for this object using data in
2863: * <code>texCoords</code> starting at index <code>start</code> and
2864: * ending at index <code>start+length</code>.
2865: *
2866: * @param index starting destination vertex index in this geometry array
2867: * @param texCoords source array of 2*n , 3*n or 4*n values containing
2868: * n new texture coordinates
2869: * @param start starting source vertex index in <code>texCoords</code>
2870: * array.
2871: * @param length number of texture Coordinates to be copied.
2872: *
2873: * @exception CapabilityNotSetException if the appropriate capability is
2874: * not set and this object is part of a live or compiled scene graph
2875: *
2876: * @exception ArrayIndexOutOfBoundsException if none of the
2877: * <code>TEXTURE_COORDINATE</code> bits are set in the
2878: * <code>vertexFormat</code> or if the index or
2879: * texCoordSet is out of range.
2880: *
2881: * @exception IllegalStateException if the data mode for this geometry
2882: * array object is <code>BY_REFERENCE</code>.
2883: *
2884: * @since Java 3D 1.2
2885: */
2886: public void setTextureCoordinates(int texCoordSet, int index,
2887: float texCoords[], int start, int length) {
2888: if (isLiveOrCompiled())
2889: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
2890: throw new CapabilityNotSetException(J3dI18N
2891: .getString("GeometryArray42"));
2892:
2893: ((GeometryArrayRetained) this .retained).setTextureCoordinates(
2894: texCoordSet, index, texCoords, start, length);
2895: }
2896:
2897: /**
2898: * @deprecated As of Java 3D version 1.2, replaced by
2899: * <code>setTextureCoordinates(int texCoordSet, TexCoord2f texCoords[], ...)</code>
2900: */
2901: public void setTextureCoordinates(int index, Point2f texCoords[],
2902: int start, int length) {
2903: if (isLiveOrCompiled())
2904: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
2905: throw new CapabilityNotSetException(J3dI18N
2906: .getString("GeometryArray42"));
2907:
2908: ((GeometryArrayRetained) this .retained).setTextureCoordinates(
2909: 0, index, texCoords, start, length);
2910: }
2911:
2912: /**
2913: * Sets the texture coordinates associated with the vertices
2914: * starting at the specified index in the specified texture
2915: * coordinate set for this object using data in
2916: * <code>texCoords</code> starting at index <code>start</code> and
2917: * ending at index <code>start+length</code>.
2918: *
2919: * @param texCoordSet texture coordinate set in this geometry array
2920: * @param index starting destination vertex index in this geometry array
2921: * @param texCoords source array of TexCoord2f objects containing new
2922: * texture coordinates
2923: * @param start starting source vertex index in <code>texCoords</code>
2924: * array.
2925: * @param length number of texture Coordinates to be copied.
2926: *
2927: * @exception CapabilityNotSetException if the appropriate capability is
2928: * not set and this object is part of a live or compiled scene graph
2929: *
2930: * @exception ArrayIndexOutOfBoundsException if none of the
2931: * <code>TEXTURE_COORDINATE</code> bits are set in the
2932: * <code>vertexFormat</code> or if the index or
2933: * texCoordSet is out of range.
2934: *
2935: * @exception IllegalStateException if the data mode for this geometry
2936: * array object is <code>BY_REFERENCE</code>.
2937: *
2938: * @exception IllegalStateException if TEXTURE_COORDINATE_3 or
2939: * TEXTURE_COORDINATE_4 is specified in vertex format
2940: *
2941: * @since Java 3D 1.2
2942: */
2943: public void setTextureCoordinates(int texCoordSet, int index,
2944: TexCoord2f texCoords[], int start, int length) {
2945: if (isLiveOrCompiled())
2946: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
2947: throw new CapabilityNotSetException(J3dI18N
2948: .getString("GeometryArray42"));
2949:
2950: if (((((GeometryArrayRetained) this .retained).vertexFormat) & (TEXTURE_COORDINATE_3 | TEXTURE_COORDINATE_4)) != 0)
2951: throw new IllegalStateException(J3dI18N
2952: .getString("GeometryArray94"));
2953:
2954: ((GeometryArrayRetained) this .retained).setTextureCoordinates(
2955: texCoordSet, index, texCoords, start, length);
2956: }
2957:
2958: /**
2959: * @deprecated As of Java 3D version 1.2, replaced by
2960: * <code>setTextureCoordinates(int texCoordSet, TexCoord3f texCoords[], ...)</code>
2961: */
2962: public void setTextureCoordinates(int index, Point3f texCoords[],
2963: int start, int length) {
2964: if (isLiveOrCompiled())
2965: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
2966: throw new CapabilityNotSetException(J3dI18N
2967: .getString("GeometryArray42"));
2968:
2969: ((GeometryArrayRetained) this .retained).setTextureCoordinates(
2970: 0, index, texCoords, start, length);
2971: }
2972:
2973: /**
2974: * Sets the texture coordinates associated with the vertices
2975: * starting at the specified index in the specified texture
2976: * coordinate set for this object. starting at index
2977: * <code>start</code> and ending at index <code>start+length</code>.
2978: *
2979: * @param texCoordSet texture coordinate set in this geometry array
2980: * @param index starting destination vertex index in this geometry array
2981: * @param texCoords source array of TexCoord3f objects containing new
2982: * texture coordinates
2983: * @param start starting source vertex index in <code>texCoords</code>
2984: * array.
2985: * @param length number of texture Coordinates to be copied.
2986: *
2987: * @exception CapabilityNotSetException if the appropriate capability is
2988: * not set and this object is part of a live or compiled scene graph
2989: *
2990: * @exception ArrayIndexOutOfBoundsException if none of the
2991: * <code>TEXTURE_COORDINATE</code> bits are set in the
2992: * <code>vertexFormat</code> or if the index or
2993: * texCoordSet is out of range.
2994: *
2995: * @exception IllegalStateException if the data mode for this geometry
2996: * array object is <code>BY_REFERENCE</code>.
2997: *
2998: * @exception IllegalStateException if TEXTURE_COORDINATE_2 or
2999: * TEXTURE_COORDINATE_4 is specified in vertex format
3000: *
3001: * @since Java 3D 1.2
3002: */
3003: public void setTextureCoordinates(int texCoordSet, int index,
3004: TexCoord3f texCoords[], int start, int length) {
3005: if (isLiveOrCompiled())
3006: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
3007: throw new CapabilityNotSetException(J3dI18N
3008: .getString("GeometryArray42"));
3009:
3010: if (((((GeometryArrayRetained) this .retained).vertexFormat) & (TEXTURE_COORDINATE_2 | TEXTURE_COORDINATE_4)) != 0)
3011: throw new IllegalStateException(J3dI18N
3012: .getString("GeometryArray95"));
3013:
3014: ((GeometryArrayRetained) this .retained).setTextureCoordinates(
3015: texCoordSet, index, texCoords, start, length);
3016: }
3017:
3018: /**
3019: * Sets the texture coordinates associated with the vertices
3020: * starting at the specified index in the specified texture
3021: * coordinate set for this object. starting at index
3022: * <code>start</code> and ending at index <code>start+length</code>.
3023: *
3024: * @param texCoordSet texture coordinate set in this geometry array
3025: * @param index starting destination vertex index in this geometry array
3026: * @param texCoords source array of TexCoord4f objects containing new
3027: * texture coordinates
3028: * @param start starting source vertex index in <code>texCoords</code>
3029: * array.
3030: * @param length number of texture Coordinates to be copied.
3031: *
3032: * @exception CapabilityNotSetException if the appropriate capability is
3033: * not set and this object is part of a live or compiled scene graph
3034: *
3035: * @exception ArrayIndexOutOfBoundsException if none of the
3036: * <code>TEXTURE_COORDINATE</code> bits are set in the
3037: * <code>vertexFormat</code> or if the index or
3038: * texCoordSet is out of range.
3039: *
3040: * @exception IllegalStateException if the data mode for this geometry
3041: * array object is <code>BY_REFERENCE</code>.
3042: *
3043: * @exception IllegalStateException if TEXTURE_COORDINATE_2 or
3044: * TEXTURE_COORDINATE_3 is specified in vertex format
3045: *
3046: * @since Java 3D 1.3
3047: */
3048: public void setTextureCoordinates(int texCoordSet, int index,
3049: TexCoord4f texCoords[], int start, int length) {
3050: if (isLiveOrCompiled())
3051: if (!this .getCapability(ALLOW_TEXCOORD_WRITE))
3052: throw new CapabilityNotSetException(J3dI18N
3053: .getString("GeometryArray42"));
3054:
3055: if (((((GeometryArrayRetained) this .retained).vertexFormat) & (TEXTURE_COORDINATE_2 | TEXTURE_COORDINATE_3)) != 0)
3056: throw new IllegalStateException(J3dI18N
3057: .getString("GeometryArray109"));
3058:
3059: ((GeometryArrayRetained) this .retained).setTextureCoordinates(
3060: texCoordSet, index, texCoords, start, length);
3061: }
3062:
3063: /**
3064: * Sets the vertex attribute associated with the vertex at the
3065: * specified index in the specified vertex attribute number for
3066: * this object.
3067: *
3068: * @param vertexAttrNum vertex attribute number in this geometry array
3069: * @param index destination vertex index in this geometry array
3070: * @param vertexAttr source array of 1, 2, 3 or 4 values containing
3071: * the new vertex attribute
3072: *
3073: * @exception CapabilityNotSetException if the appropriate capability is
3074: * not set and this object is part of a live or compiled scene graph
3075: *
3076: * @exception ArrayIndexOutOfBoundsException if the index or
3077: * vertexAttrNum is out of range, or if the vertexAttr array is
3078: * too small.
3079: *
3080: * @exception IllegalStateException if the data mode for this geometry
3081: * array object is <code>BY_REFERENCE</code>.
3082: *
3083: * @since Java 3D 1.4
3084: */
3085: public void setVertexAttr(int vertexAttrNum, int index,
3086: float[] vertexAttr) {
3087:
3088: if (isLiveOrCompiled()) {
3089: if (!this .getCapability(ALLOW_VERTEX_ATTR_WRITE)) {
3090: throw new CapabilityNotSetException(J3dI18N
3091: .getString("GeometryArray126"));
3092: }
3093: }
3094:
3095: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3096: if ((format & BY_REFERENCE) != 0) {
3097: throw new IllegalStateException(J3dI18N
3098: .getString("GeometryArray82"));
3099: }
3100:
3101: ((GeometryArrayRetained) this .retained).setVertexAttrs(
3102: vertexAttrNum, index, vertexAttr, 0, 1);
3103: }
3104:
3105: /**
3106: * Sets the vertex attribute associated with the vertex at the
3107: * specified index in the specified vertex attribute number for
3108: * this object.
3109: *
3110: * @param vertexAttrNum vertex attribute number in this geometry array
3111: * @param index destination vertex index in this geometry array
3112: * @param vertexAttr the Point2f containing the new vertex attribute
3113: *
3114: * @exception CapabilityNotSetException if the appropriate capability is
3115: * not set and this object is part of a live or compiled scene graph
3116: *
3117: * @exception ArrayIndexOutOfBoundsException if the index or
3118: * vertexAttrNum is out of range.
3119: *
3120: * @exception IllegalStateException if the data mode for this geometry
3121: * array object is <code>BY_REFERENCE</code>.
3122: *
3123: * @exception IllegalStateException if the size of the specified
3124: * vertex attribute number is not 2.
3125: *
3126: * @since Java 3D 1.4
3127: */
3128: public void setVertexAttr(int vertexAttrNum, int index,
3129: Point2f vertexAttr) {
3130:
3131: if (isLiveOrCompiled()) {
3132: if (!this .getCapability(ALLOW_VERTEX_ATTR_WRITE)) {
3133: throw new CapabilityNotSetException(J3dI18N
3134: .getString("GeometryArray126"));
3135: }
3136: }
3137:
3138: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3139: if ((format & BY_REFERENCE) != 0) {
3140: throw new IllegalStateException(J3dI18N
3141: .getString("GeometryArray82"));
3142: }
3143:
3144: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
3145: if (size != 2) {
3146: throw new IllegalStateException(J3dI18N
3147: .getString("GeometryArray134"));
3148: }
3149:
3150: ((GeometryArrayRetained) this .retained).setVertexAttr(
3151: vertexAttrNum, index, vertexAttr);
3152: }
3153:
3154: /**
3155: * Sets the vertex attribute associated with the vertex at the
3156: * specified index in the specified vertex attribute number for
3157: * this object.
3158: *
3159: * @param vertexAttrNum vertex attribute number in this geometry array
3160: * @param index destination vertex index in this geometry array
3161: * @param vertexAttr the Point3f containing the new vertex attribute
3162: *
3163: * @exception CapabilityNotSetException if the appropriate capability is
3164: * not set and this object is part of a live or compiled scene graph
3165: *
3166: * @exception ArrayIndexOutOfBoundsException if the index or
3167: * vertexAttrNum is out of range.
3168: *
3169: * @exception IllegalStateException if the data mode for this geometry
3170: * array object is <code>BY_REFERENCE</code>.
3171: *
3172: * @exception IllegalStateException if the size of the specified
3173: * vertex attribute number is not 3.
3174: *
3175: * @since Java 3D 1.4
3176: */
3177: public void setVertexAttr(int vertexAttrNum, int index,
3178: Point3f vertexAttr) {
3179:
3180: if (isLiveOrCompiled()) {
3181: if (!this .getCapability(ALLOW_VERTEX_ATTR_WRITE)) {
3182: throw new CapabilityNotSetException(J3dI18N
3183: .getString("GeometryArray126"));
3184: }
3185: }
3186:
3187: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3188: if ((format & BY_REFERENCE) != 0) {
3189: throw new IllegalStateException(J3dI18N
3190: .getString("GeometryArray82"));
3191: }
3192:
3193: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
3194: if (size != 3) {
3195: throw new IllegalStateException(J3dI18N
3196: .getString("GeometryArray134"));
3197: }
3198:
3199: ((GeometryArrayRetained) this .retained).setVertexAttr(
3200: vertexAttrNum, index, vertexAttr);
3201: }
3202:
3203: /**
3204: * Sets the vertex attribute associated with the vertex at the
3205: * specified index in the specified vertex attribute number for
3206: * this object.
3207: *
3208: * @param vertexAttrNum vertex attribute number in this geometry array
3209: * @param index destination vertex index in this geometry array
3210: * @param vertexAttr the Point4f containing the new vertex attribute
3211: *
3212: * @exception CapabilityNotSetException if the appropriate capability is
3213: * not set and this object is part of a live or compiled scene graph
3214: *
3215: * @exception ArrayIndexOutOfBoundsException if the index or
3216: * vertexAttrNum is out of range.
3217: *
3218: * @exception IllegalStateException if the data mode for this geometry
3219: * array object is <code>BY_REFERENCE</code>.
3220: *
3221: * @exception IllegalStateException if the size of the specified
3222: * vertex attribute number is not 4.
3223: *
3224: * @since Java 3D 1.4
3225: */
3226: public void setVertexAttr(int vertexAttrNum, int index,
3227: Point4f vertexAttr) {
3228:
3229: if (isLiveOrCompiled()) {
3230: if (!this .getCapability(ALLOW_VERTEX_ATTR_WRITE)) {
3231: throw new CapabilityNotSetException(J3dI18N
3232: .getString("GeometryArray126"));
3233: }
3234: }
3235:
3236: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3237: if ((format & BY_REFERENCE) != 0) {
3238: throw new IllegalStateException(J3dI18N
3239: .getString("GeometryArray82"));
3240: }
3241:
3242: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
3243: if (size != 4) {
3244: throw new IllegalStateException(J3dI18N
3245: .getString("GeometryArray134"));
3246: }
3247:
3248: ((GeometryArrayRetained) this .retained).setVertexAttr(
3249: vertexAttrNum, index, vertexAttr);
3250: }
3251:
3252: /**
3253: * Sets the vertex attributes associated with the vertices starting at
3254: * the specified index in the specified vertex attribute number
3255: * for this object. The entire source array is copied to this
3256: * geometry array.
3257: *
3258: * @param vertexAttrNum vertex attribute number in this geometry array
3259: * @param index starting destination vertex index in this geometry array
3260: * @param vertexAttrs source array of 1*n, 2*n, 3*n, or 4*n values
3261: * containing n new vertex attributes
3262: *
3263: * @exception CapabilityNotSetException if the appropriate capability is
3264: * not set and this object is part of a live or compiled scene graph
3265: *
3266: * @exception ArrayIndexOutOfBoundsException if the index or
3267: * vertexAttrNum is out of range, or if the vertexAttr array is
3268: * too large.
3269: *
3270: * @exception IllegalStateException if the data mode for this geometry
3271: * array object is <code>BY_REFERENCE</code>.
3272: *
3273: * @since Java 3D 1.4
3274: */
3275: public void setVertexAttrs(int vertexAttrNum, int index,
3276: float[] vertexAttrs) {
3277: if (isLiveOrCompiled()) {
3278: if (!this .getCapability(ALLOW_VERTEX_ATTR_WRITE)) {
3279: throw new CapabilityNotSetException(J3dI18N
3280: .getString("GeometryArray126"));
3281: }
3282: }
3283:
3284: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3285: if ((format & BY_REFERENCE) != 0) {
3286: throw new IllegalStateException(J3dI18N
3287: .getString("GeometryArray82"));
3288: }
3289:
3290: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
3291: ((GeometryArrayRetained) this .retained).setVertexAttrs(
3292: vertexAttrNum, index, vertexAttrs, 0,
3293: vertexAttrs.length / size);
3294: }
3295:
3296: /**
3297: * Sets the vertex attributes associated with the vertices starting at
3298: * the specified index in the specified vertex attribute number
3299: * for this object. The entire source array is copied to this
3300: * geometry array.
3301: *
3302: * @param vertexAttrNum vertex attribute number in this geometry array
3303: * @param index starting destination vertex index in this geometry array
3304: * @param vertexAttrs source array of Point2f objects containing new
3305: * vertex attributes
3306: *
3307: * @exception CapabilityNotSetException if the appropriate capability is
3308: * not set and this object is part of a live or compiled scene graph
3309: *
3310: * @exception ArrayIndexOutOfBoundsException if the index or
3311: * vertexAttrNum is out of range, or if the vertexAttr array is
3312: * too large.
3313: *
3314: * @exception IllegalStateException if the data mode for this geometry
3315: * array object is <code>BY_REFERENCE</code>.
3316: *
3317: * @exception IllegalStateException if the size of the specified
3318: * vertex attribute number is not 2.
3319: *
3320: * @since Java 3D 1.4
3321: */
3322: public void setVertexAttrs(int vertexAttrNum, int index,
3323: Point2f[] vertexAttrs) {
3324:
3325: if (isLiveOrCompiled()) {
3326: if (!this .getCapability(ALLOW_VERTEX_ATTR_WRITE)) {
3327: throw new CapabilityNotSetException(J3dI18N
3328: .getString("GeometryArray126"));
3329: }
3330: }
3331:
3332: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3333: if ((format & BY_REFERENCE) != 0) {
3334: throw new IllegalStateException(J3dI18N
3335: .getString("GeometryArray82"));
3336: }
3337:
3338: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
3339: if (size != 2) {
3340: throw new IllegalStateException(J3dI18N
3341: .getString("GeometryArray134"));
3342: }
3343:
3344: ((GeometryArrayRetained) this .retained).setVertexAttrs(
3345: vertexAttrNum, index, vertexAttrs, 0,
3346: vertexAttrs.length);
3347: }
3348:
3349: /**
3350: * Sets the vertex attributes associated with the vertices starting at
3351: * the specified index in the specified vertex attribute number
3352: * for this object. The entire source array is copied to this
3353: * geometry array.
3354: *
3355: * @param vertexAttrNum vertex attribute number in this geometry array
3356: * @param index starting destination vertex index in this geometry array
3357: * @param vertexAttrs source array of Point3f objects containing new
3358: * vertex attributes
3359: *
3360: * @exception CapabilityNotSetException if the appropriate capability is
3361: * not set and this object is part of a live or compiled scene graph
3362: *
3363: * @exception ArrayIndexOutOfBoundsException if the index or
3364: * vertexAttrNum is out of range, or if the vertexAttr array is
3365: * too large.
3366: *
3367: * @exception IllegalStateException if the data mode for this geometry
3368: * array object is <code>BY_REFERENCE</code>.
3369: *
3370: * @exception IllegalStateException if the size of the specified
3371: * vertex attribute number is not 3.
3372: *
3373: * @since Java 3D 1.4
3374: */
3375: public void setVertexAttrs(int vertexAttrNum, int index,
3376: Point3f[] vertexAttrs) {
3377:
3378: if (isLiveOrCompiled()) {
3379: if (!this .getCapability(ALLOW_VERTEX_ATTR_WRITE)) {
3380: throw new CapabilityNotSetException(J3dI18N
3381: .getString("GeometryArray126"));
3382: }
3383: }
3384:
3385: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3386: if ((format & BY_REFERENCE) != 0) {
3387: throw new IllegalStateException(J3dI18N
3388: .getString("GeometryArray82"));
3389: }
3390:
3391: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
3392: if (size != 3) {
3393: throw new IllegalStateException(J3dI18N
3394: .getString("GeometryArray134"));
3395: }
3396:
3397: ((GeometryArrayRetained) this .retained).setVertexAttrs(
3398: vertexAttrNum, index, vertexAttrs, 0,
3399: vertexAttrs.length);
3400: }
3401:
3402: /**
3403: * Sets the vertex attributes associated with the vertices starting at
3404: * the specified index in the specified vertex attribute number
3405: * for this object. The entire source array is copied to this
3406: * geometry array.
3407: *
3408: * @param vertexAttrNum vertex attribute number in this geometry array
3409: * @param index starting destination vertex index in this geometry array
3410: * @param vertexAttrs source array of Point4f objects containing new
3411: * vertex attributes
3412: *
3413: * @exception CapabilityNotSetException if the appropriate capability is
3414: * not set and this object is part of a live or compiled scene graph
3415: *
3416: * @exception ArrayIndexOutOfBoundsException if the index or
3417: * vertexAttrNum is out of range, or if the vertexAttr array is
3418: * too large.
3419: *
3420: * @exception IllegalStateException if the data mode for this geometry
3421: * array object is <code>BY_REFERENCE</code>.
3422: *
3423: * @exception IllegalStateException if the size of the specified
3424: * vertex attribute number is not 4.
3425: *
3426: * @since Java 3D 1.4
3427: */
3428: public void setVertexAttrs(int vertexAttrNum, int index,
3429: Point4f[] vertexAttrs) {
3430:
3431: if (isLiveOrCompiled()) {
3432: if (!this .getCapability(ALLOW_VERTEX_ATTR_WRITE)) {
3433: throw new CapabilityNotSetException(J3dI18N
3434: .getString("GeometryArray126"));
3435: }
3436: }
3437:
3438: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3439: if ((format & BY_REFERENCE) != 0) {
3440: throw new IllegalStateException(J3dI18N
3441: .getString("GeometryArray82"));
3442: }
3443:
3444: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
3445: if (size != 4) {
3446: throw new IllegalStateException(J3dI18N
3447: .getString("GeometryArray134"));
3448: }
3449:
3450: ((GeometryArrayRetained) this .retained).setVertexAttrs(
3451: vertexAttrNum, index, vertexAttrs, 0,
3452: vertexAttrs.length);
3453: }
3454:
3455: /**
3456: * Sets the vertex attributes associated with the vertices
3457: * starting at the specified index in the specified vertex
3458: * attribute number for this object using data in
3459: * <code>vertexAttrs</code> starting at index <code>start</code> and
3460: * ending at index <code>start+length</code>.
3461: *
3462: * @param index starting destination vertex index in this geometry array
3463: * @param vertexAttrs source array of 1*n, 2*n, 3*n, or 4*n values
3464: * containing n new vertex attributes
3465: * @param start starting source vertex index in <code>vertexAttrs</code>
3466: * array.
3467: * @param length number of vertex attributes to be copied.
3468: *
3469: * @exception CapabilityNotSetException if the appropriate capability is
3470: * not set and this object is part of a live or compiled scene graph
3471: *
3472: * @exception ArrayIndexOutOfBoundsException if any of index,
3473: * (index+length), or vertexAttrNum are out of range, or if
3474: * vertexAttrs is too small.
3475: *
3476: * @exception IllegalStateException if the data mode for this geometry
3477: * array object is <code>BY_REFERENCE</code>.
3478: *
3479: * @since Java 3D 1.4
3480: */
3481: public void setVertexAttrs(int vertexAttrNum, int index,
3482: float[] vertexAttrs, int start, int length) {
3483:
3484: if (isLiveOrCompiled()) {
3485: if (!this .getCapability(ALLOW_VERTEX_ATTR_WRITE)) {
3486: throw new CapabilityNotSetException(J3dI18N
3487: .getString("GeometryArray126"));
3488: }
3489: }
3490:
3491: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3492: if ((format & BY_REFERENCE) != 0) {
3493: throw new IllegalStateException(J3dI18N
3494: .getString("GeometryArray82"));
3495: }
3496:
3497: ((GeometryArrayRetained) this .retained).setVertexAttrs(
3498: vertexAttrNum, index, vertexAttrs, start, length);
3499: }
3500:
3501: /**
3502: * Sets the vertex attributes associated with the vertices
3503: * starting at the specified index in the specified vertex
3504: * attribute number for this object using data in
3505: * <code>vertexAttrs</code> starting at index <code>start</code> and
3506: * ending at index <code>start+length</code>.
3507: *
3508: * @param vertexAttrNum vertex attribute number in this geometry array
3509: * @param index starting destination vertex index in this geometry array
3510: * @param vertexAttrs source array of Point2f objects containing new
3511: * vertex attributes
3512: * @param start starting source vertex index in <code>vertexAttrs</code>
3513: * array.
3514: * @param length number of vertex attributes to be copied.
3515: *
3516: * @exception CapabilityNotSetException if the appropriate capability is
3517: * not set and this object is part of a live or compiled scene graph
3518: *
3519: * @exception ArrayIndexOutOfBoundsException if any of index,
3520: * (index+length), or vertexAttrNum are out of range, or if
3521: * vertexAttrs is too small.
3522: *
3523: * @exception IllegalStateException if the data mode for this geometry
3524: * array object is <code>BY_REFERENCE</code>.
3525: *
3526: * @exception IllegalStateException if the size of the specified
3527: * vertex attribute number is not 2.
3528: *
3529: * @since Java 3D 1.4
3530: */
3531: public void setVertexAttrs(int vertexAttrNum, int index,
3532: Point2f[] vertexAttrs, int start, int length) {
3533:
3534: if (isLiveOrCompiled()) {
3535: if (!this .getCapability(ALLOW_VERTEX_ATTR_WRITE)) {
3536: throw new CapabilityNotSetException(J3dI18N
3537: .getString("GeometryArray126"));
3538: }
3539: }
3540:
3541: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3542: if ((format & BY_REFERENCE) != 0) {
3543: throw new IllegalStateException(J3dI18N
3544: .getString("GeometryArray82"));
3545: }
3546:
3547: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
3548: if (size != 2) {
3549: throw new IllegalStateException(J3dI18N
3550: .getString("GeometryArray134"));
3551: }
3552:
3553: ((GeometryArrayRetained) this .retained).setVertexAttrs(
3554: vertexAttrNum, index, vertexAttrs, start, length);
3555: }
3556:
3557: /**
3558: * Sets the vertex attributes associated with the vertices
3559: * starting at the specified index in the specified vertex
3560: * attribute number for this object using data in
3561: * <code>vertexAttrs</code> starting at index <code>start</code> and
3562: * ending at index <code>start+length</code>.
3563: *
3564: * @param vertexAttrNum vertex attribute number in this geometry array
3565: * @param index starting destination vertex index in this geometry array
3566: * @param vertexAttrs source array of Point3f objects containing new
3567: * vertex attributes
3568: * @param start starting source vertex index in <code>vertexAttrs</code>
3569: * array.
3570: * @param length number of vertex attributes to be copied.
3571: *
3572: * @exception CapabilityNotSetException if the appropriate capability is
3573: * not set and this object is part of a live or compiled scene graph
3574: *
3575: * @exception ArrayIndexOutOfBoundsException if any of index,
3576: * (index+length), or vertexAttrNum are out of range, or if
3577: * vertexAttrs is too small.
3578: *
3579: * @exception IllegalStateException if the data mode for this geometry
3580: * array object is <code>BY_REFERENCE</code>.
3581: *
3582: * @exception IllegalStateException if the size of the specified
3583: * vertex attribute number is not 3.
3584: *
3585: * @since Java 3D 1.4
3586: */
3587: public void setVertexAttrs(int vertexAttrNum, int index,
3588: Point3f[] vertexAttrs, int start, int length) {
3589:
3590: if (isLiveOrCompiled()) {
3591: if (!this .getCapability(ALLOW_VERTEX_ATTR_WRITE)) {
3592: throw new CapabilityNotSetException(J3dI18N
3593: .getString("GeometryArray126"));
3594: }
3595: }
3596:
3597: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3598: if ((format & BY_REFERENCE) != 0) {
3599: throw new IllegalStateException(J3dI18N
3600: .getString("GeometryArray82"));
3601: }
3602:
3603: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
3604: if (size != 3) {
3605: throw new IllegalStateException(J3dI18N
3606: .getString("GeometryArray134"));
3607: }
3608:
3609: ((GeometryArrayRetained) this .retained).setVertexAttrs(
3610: vertexAttrNum, index, vertexAttrs, start, length);
3611: }
3612:
3613: /**
3614: * Sets the vertex attributes associated with the vertices
3615: * starting at the specified index in the specified vertex
3616: * attribute number for this object using data in
3617: * <code>vertexAttrs</code> starting at index <code>start</code> and
3618: * ending at index <code>start+length</code>.
3619: *
3620: * @param vertexAttrNum vertex attribute number in this geometry array
3621: * @param index starting destination vertex index in this geometry array
3622: * @param vertexAttrs source array of Point4f objects containing new
3623: * vertex attributes
3624: * @param start starting source vertex index in <code>vertexAttrs</code>
3625: * array.
3626: * @param length number of vertex attributes to be copied.
3627: *
3628: * @exception CapabilityNotSetException if the appropriate capability is
3629: * not set and this object is part of a live or compiled scene graph
3630: *
3631: * @exception ArrayIndexOutOfBoundsException if any of index,
3632: * (index+length), or vertexAttrNum are out of range, or if
3633: * vertexAttrs is too small.
3634: *
3635: * @exception IllegalStateException if the data mode for this geometry
3636: * array object is <code>BY_REFERENCE</code>.
3637: *
3638: * @exception IllegalStateException if the size of the specified
3639: * vertex attribute number is not 4.
3640: *
3641: * @since Java 3D 1.4
3642: */
3643: public void setVertexAttrs(int vertexAttrNum, int index,
3644: Point4f[] vertexAttrs, int start, int length) {
3645:
3646: if (isLiveOrCompiled()) {
3647: if (!this .getCapability(ALLOW_VERTEX_ATTR_WRITE)) {
3648: throw new CapabilityNotSetException(J3dI18N
3649: .getString("GeometryArray126"));
3650: }
3651: }
3652:
3653: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3654: if ((format & BY_REFERENCE) != 0) {
3655: throw new IllegalStateException(J3dI18N
3656: .getString("GeometryArray82"));
3657: }
3658:
3659: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
3660: if (size != 4) {
3661: throw new IllegalStateException(J3dI18N
3662: .getString("GeometryArray134"));
3663: }
3664:
3665: ((GeometryArrayRetained) this .retained).setVertexAttrs(
3666: vertexAttrNum, index, vertexAttrs, start, length);
3667: }
3668:
3669: /**
3670: * Gets the coordinate associated with the vertex at
3671: * the specified index for this object using data in <code>texCoords</code>
3672: * @param index source vertex index in this geometry array
3673: * @param coordinate destination array of 3 values that will receive the coordinate
3674: * @exception CapabilityNotSetException if the appropriate capability is
3675: * not set and this object is part of a live or compiled scene graph
3676: * @exception IllegalStateException if the data mode for this geometry
3677: * array object is <code>BY_REFERENCE</code>.
3678: */
3679: public void getCoordinate(int index, float coordinate[]) {
3680: if (isLiveOrCompiled())
3681: if (!this .getCapability(ALLOW_COORDINATE_READ))
3682: throw new CapabilityNotSetException(J3dI18N
3683: .getString("GeometryArray48"));
3684:
3685: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3686: if ((format & BY_REFERENCE) != 0)
3687: throw new IllegalStateException(J3dI18N
3688: .getString("GeometryArray82"));
3689:
3690: ((GeometryArrayRetained) this .retained).getCoordinate(index,
3691: coordinate);
3692: }
3693:
3694: /**
3695: * Gets the coordinate associated with the vertex at
3696: * the specified index for this object.
3697: * @param index source vertex index in this geometry array
3698: * @param coordinate destination array of 3 values that will receive the coordinate
3699: * @exception CapabilityNotSetException if the appropriate capability is
3700: * not set and this object is part of a live or compiled scene graph
3701: * @exception IllegalStateException if the data mode for this geometry
3702: * array object is <code>BY_REFERENCE</code>.
3703: */
3704: public void getCoordinate(int index, double coordinate[]) {
3705: if (isLiveOrCompiled())
3706: if (!this .getCapability(ALLOW_COORDINATE_READ))
3707: throw new CapabilityNotSetException(J3dI18N
3708: .getString("GeometryArray48"));
3709:
3710: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3711: if ((format & BY_REFERENCE) != 0)
3712: throw new IllegalStateException(J3dI18N
3713: .getString("GeometryArray82"));
3714:
3715: ((GeometryArrayRetained) this .retained).getCoordinate(index,
3716: coordinate);
3717: }
3718:
3719: /**
3720: * Gets the coordinate associated with the vertex at
3721: * the specified index for this object.
3722: * @param index source vertex index in this geometry array
3723: * @param coordinate a vector that will receive the coordinate
3724: * @exception CapabilityNotSetException if the appropriate capability is
3725: * not set and this object is part of a live or compiled scene graph
3726: * @exception IllegalStateException if the data mode for this geometry
3727: * array object is <code>BY_REFERENCE</code>.
3728: */
3729: public void getCoordinate(int index, Point3f coordinate) {
3730: if (isLiveOrCompiled())
3731: if (!this .getCapability(ALLOW_COORDINATE_READ))
3732: throw new CapabilityNotSetException(J3dI18N
3733: .getString("GeometryArray48"));
3734:
3735: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3736: if ((format & BY_REFERENCE) != 0)
3737: throw new IllegalStateException(J3dI18N
3738: .getString("GeometryArray82"));
3739:
3740: ((GeometryArrayRetained) this .retained).getCoordinate(index,
3741: coordinate);
3742: }
3743:
3744: /**
3745: * Gets the coordinate associated with the vertex at
3746: * the specified index for this object.
3747: * @param index source vertex index in this geometry array
3748: * @param coordinate a vector that will receive the coordinate
3749: * @exception CapabilityNotSetException if the appropriate capability is
3750: * not set and this object is part of a live or compiled scene graph
3751: * @exception IllegalStateException if the data mode for this geometry
3752: * array object is <code>BY_REFERENCE</code>.
3753: */
3754: public void getCoordinate(int index, Point3d coordinate) {
3755: if (isLiveOrCompiled())
3756: if (!this .getCapability(ALLOW_COORDINATE_READ))
3757: throw new CapabilityNotSetException(J3dI18N
3758: .getString("GeometryArray48"));
3759:
3760: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3761: if ((format & BY_REFERENCE) != 0)
3762: throw new IllegalStateException(J3dI18N
3763: .getString("GeometryArray82"));
3764:
3765: ((GeometryArrayRetained) this .retained).getCoordinate(index,
3766: coordinate);
3767: }
3768:
3769: /**
3770: * Gets the coordinates associated with the vertices starting at
3771: * the specified index for this object. The length of the destination
3772: * array determines the number of vertices copied.
3773: * A maximum of <code>vertexCount-index</code> coordinates
3774: * are copied. If the destination array is larger than is needed
3775: * to hold the coordinates, the excess locations in the
3776: * array are not modified. If the destination array is smaller
3777: * than is needed to hold the coordinates, only as
3778: * many coordinates as the array will hold are copied.
3779: *
3780: * @param index starting source vertex index in this geometry array
3781: * @param coordinates destination array of 3*n values that will receive new coordinates
3782: * @exception CapabilityNotSetException if the appropriate capability is
3783: * not set and this object is part of a live or compiled scene graph
3784: * @exception IllegalStateException if the data mode for this geometry
3785: * array object is <code>BY_REFERENCE</code>.
3786: */
3787: public void getCoordinates(int index, float coordinates[]) {
3788: if (isLiveOrCompiled())
3789: if (!this .getCapability(ALLOW_COORDINATE_READ))
3790: throw new CapabilityNotSetException(J3dI18N
3791: .getString("GeometryArray52"));
3792:
3793: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3794: if ((format & BY_REFERENCE) != 0)
3795: throw new IllegalStateException(J3dI18N
3796: .getString("GeometryArray82"));
3797:
3798: ((GeometryArrayRetained) this .retained).getCoordinates(index,
3799: coordinates);
3800: }
3801:
3802: /**
3803: * Gets the coordinates associated with the vertices starting at
3804: * the specified index for this object. The length of the destination
3805: * array determines the number of vertices copied.
3806: * A maximum of <code>vertexCount-index</code> coordinates
3807: * are copied. If the destination array is larger than is needed
3808: * to hold the coordinates, the excess locations in the
3809: * array are not modified. If the destination array is smaller
3810: * than is needed to hold the coordinates, only as
3811: * many coordinates as the array will hold are copied.
3812: *
3813: * @param index starting source vertex index in this geometry array
3814: * @param coordinates destination array of 3*n values that will receive new coordinates
3815: * @exception CapabilityNotSetException if the appropriate capability is
3816: * not set and this object is part of a live or compiled scene graph
3817: * @exception IllegalStateException if the data mode for this geometry
3818: * array object is <code>BY_REFERENCE</code>.
3819: */
3820: public void getCoordinates(int index, double coordinates[]) {
3821: if (isLiveOrCompiled())
3822: if (!this .getCapability(ALLOW_COORDINATE_READ))
3823: throw new CapabilityNotSetException(J3dI18N
3824: .getString("GeometryArray52"));
3825:
3826: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3827: if ((format & BY_REFERENCE) != 0)
3828: throw new IllegalStateException(J3dI18N
3829: .getString("GeometryArray82"));
3830:
3831: ((GeometryArrayRetained) this .retained).getCoordinates(index,
3832: coordinates);
3833: }
3834:
3835: /**
3836: * Gets the coordinates associated with the vertices starting at
3837: * the specified index for this object. The length of the destination
3838: * array determines the number of vertices copied.
3839: * A maximum of <code>vertexCount-index</code> coordinates
3840: * are copied. If the destination array is larger than is needed
3841: * to hold the coordinates, the excess locations in the
3842: * array are not modified. If the destination array is smaller
3843: * than is needed to hold the coordinates, only as
3844: * many coordinates as the array will hold are copied.
3845: *
3846: * @param index starting source vertex index in this geometry array
3847: * @param coordinates destination array of points that will receive new coordinates
3848: * @exception CapabilityNotSetException if the appropriate capability is
3849: * not set and this object is part of a live or compiled scene graph
3850: * @exception IllegalStateException if the data mode for this geometry
3851: * array object is <code>BY_REFERENCE</code>.
3852: */
3853: public void getCoordinates(int index, Point3f coordinates[]) {
3854: if (isLiveOrCompiled())
3855: if (!this .getCapability(ALLOW_COORDINATE_READ))
3856: throw new CapabilityNotSetException(J3dI18N
3857: .getString("GeometryArray52"));
3858:
3859: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3860: if ((format & BY_REFERENCE) != 0)
3861: throw new IllegalStateException(J3dI18N
3862: .getString("GeometryArray82"));
3863:
3864: ((GeometryArrayRetained) this .retained).getCoordinates(index,
3865: coordinates);
3866: }
3867:
3868: /**
3869: * Gets the coordinates associated with the vertices starting at
3870: * the specified index for this object. The length of the destination
3871: * array determines the number of vertices copied.
3872: * A maximum of <code>vertexCount-index</code> coordinates
3873: * are copied. If the destination array is larger than is needed
3874: * to hold the coordinates, the excess locations in the
3875: * array are not modified. If the destination array is smaller
3876: * than is needed to hold the coordinates, only as
3877: * many coordinates as the array will hold are copied.
3878: *
3879: * @param index starting source vertex index in this geometry array
3880: * @param coordinates destination array of points that will receive new coordinates
3881: * @exception CapabilityNotSetException if the appropriate capability is
3882: * not set and this object is part of a live or compiled scene graph
3883: * @exception IllegalStateException if the data mode for this geometry
3884: * array object is <code>BY_REFERENCE</code>.
3885: */
3886: public void getCoordinates(int index, Point3d coordinates[]) {
3887: if (isLiveOrCompiled())
3888: if (!this .getCapability(ALLOW_COORDINATE_READ))
3889: throw new CapabilityNotSetException(J3dI18N
3890: .getString("GeometryArray52"));
3891:
3892: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3893: if ((format & BY_REFERENCE) != 0)
3894: throw new IllegalStateException(J3dI18N
3895: .getString("GeometryArray82"));
3896:
3897: ((GeometryArrayRetained) this .retained).getCoordinates(index,
3898: coordinates);
3899: }
3900:
3901: /**
3902: * Gets the color associated with the vertex at
3903: * the specified index for this object. The color is copied into the
3904: * specified array. The array must be large enough to hold all
3905: * of the colors.
3906: * @param index source vertex index in this geometry array
3907: * @param color destination array of 3 or 4 values that will receive the color
3908: * @exception CapabilityNotSetException if the appropriate capability is
3909: * not set and this object is part of a live or compiled scene graph
3910: * @exception IllegalStateException if the data mode for this geometry
3911: * array object is <code>BY_REFERENCE</code>.
3912: */
3913: public void getColor(int index, float color[]) {
3914: if (isLiveOrCompiled())
3915: if (!this .getCapability(ALLOW_COLOR_READ))
3916: throw new CapabilityNotSetException(J3dI18N
3917: .getString("GeometryArray56"));
3918:
3919: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3920: if ((format & BY_REFERENCE) != 0)
3921: throw new IllegalStateException(J3dI18N
3922: .getString("GeometryArray82"));
3923:
3924: if ((format & COLOR) == 0)
3925: throw new ArrayIndexOutOfBoundsException(J3dI18N
3926: .getString("GeometryArray76"));
3927:
3928: ((GeometryArrayRetained) this .retained).getColor(index, color);
3929: }
3930:
3931: /**
3932: * Gets the color associated with the vertex at
3933: * the specified index for this object. The color is copied into the
3934: * specified array. The array must be large enough to hold all of
3935: * the colors.
3936: * @param index source vertex index in this geometry array
3937: * @param color destination array of 3 or 4 values that will receive the color
3938: * @exception CapabilityNotSetException if the appropriate capability is
3939: * not set and this object is part of a live or compiled scene graph
3940: * @exception IllegalStateException if the data mode for this geometry
3941: * array object is <code>BY_REFERENCE</code>.
3942: */
3943: public void getColor(int index, byte color[]) {
3944: if (isLiveOrCompiled())
3945: if (!this .getCapability(ALLOW_COLOR_READ))
3946: throw new CapabilityNotSetException(J3dI18N
3947: .getString("GeometryArray56"));
3948:
3949: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3950: if ((format & BY_REFERENCE) != 0)
3951: throw new IllegalStateException(J3dI18N
3952: .getString("GeometryArray82"));
3953:
3954: if ((format & COLOR) == 0)
3955: throw new ArrayIndexOutOfBoundsException(J3dI18N
3956: .getString("GeometryArray76"));
3957:
3958: ((GeometryArrayRetained) this .retained).getColor(index, color);
3959: }
3960:
3961: /**
3962: * Gets the color associated with the vertex at
3963: * the specified index for this object.
3964: * @param index source vertex index in this geometry array
3965: * @param color a vector that will receive the color
3966: * @exception CapabilityNotSetException if the appropriate capability is
3967: * not set and this object is part of a live or compiled scene graph
3968: * @exception IllegalStateException if the data mode for this geometry
3969: * array object is <code>BY_REFERENCE</code>.
3970: * @exception IllegalStateException if COLOR_4 is specified in the vertex
3971: * format
3972: */
3973: public void getColor(int index, Color3f color) {
3974: if (isLiveOrCompiled())
3975: if (!this .getCapability(ALLOW_COLOR_READ))
3976: throw new CapabilityNotSetException(J3dI18N
3977: .getString("GeometryArray56"));
3978:
3979: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
3980: if ((format & BY_REFERENCE) != 0)
3981: throw new IllegalStateException(J3dI18N
3982: .getString("GeometryArray82"));
3983:
3984: if ((format & COLOR) == 0)
3985: throw new ArrayIndexOutOfBoundsException(J3dI18N
3986: .getString("GeometryArray76"));
3987:
3988: if ((format & WITH_ALPHA) != 0)
3989: throw new IllegalStateException(J3dI18N
3990: .getString("GeometryArray92"));
3991:
3992: ((GeometryArrayRetained) this .retained).getColor(index, color);
3993: }
3994:
3995: /**
3996: * Gets the color associated with the vertex at
3997: * the specified index for this object.
3998: * @param index source vertex index in this geometry array
3999: * @param color a vector that will receive the color
4000: * @exception CapabilityNotSetException if the appropriate capability is
4001: * not set and this object is part of a live or compiled scene graph
4002: * @exception IllegalStateException if the data mode for this geometry
4003: * array object is <code>BY_REFERENCE</code>.
4004: * @exception IllegalStateException if COLOR_3 is specified in the vertex
4005: * format
4006: */
4007: public void getColor(int index, Color4f color) {
4008: if (isLiveOrCompiled())
4009: if (!this .getCapability(ALLOW_COLOR_READ))
4010: throw new CapabilityNotSetException(J3dI18N
4011: .getString("GeometryArray56"));
4012:
4013: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4014: if ((format & BY_REFERENCE) != 0)
4015: throw new IllegalStateException(J3dI18N
4016: .getString("GeometryArray82"));
4017:
4018: if ((format & COLOR) == 0)
4019: throw new ArrayIndexOutOfBoundsException(J3dI18N
4020: .getString("GeometryArray76"));
4021:
4022: if ((format & WITH_ALPHA) == 0)
4023: throw new IllegalStateException(J3dI18N
4024: .getString("GeometryArray93"));
4025:
4026: ((GeometryArrayRetained) this .retained).getColor(index, color);
4027: }
4028:
4029: /**
4030: * Gets the color associated with the vertex at
4031: * the specified index for this object.
4032: * @param index source vertex index in this geometry array
4033: * @param color a vector that will receive the color
4034: * @exception CapabilityNotSetException if the appropriate capability is
4035: * not set and this object is part of a live or compiled scene graph
4036: * @exception IllegalStateException if the data mode for this geometry
4037: * array object is <code>BY_REFERENCE</code>.
4038: * @exception IllegalStateException if COLOR_4 is specified in the vertex
4039: * format
4040: */
4041: public void getColor(int index, Color3b color) {
4042: if (isLiveOrCompiled())
4043: if (!this .getCapability(ALLOW_COLOR_READ))
4044: throw new CapabilityNotSetException(J3dI18N
4045: .getString("GeometryArray56"));
4046:
4047: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4048: if ((format & BY_REFERENCE) != 0)
4049: throw new IllegalStateException(J3dI18N
4050: .getString("GeometryArray82"));
4051:
4052: if ((format & COLOR) == 0)
4053: throw new ArrayIndexOutOfBoundsException(J3dI18N
4054: .getString("GeometryArray76"));
4055:
4056: if ((format & WITH_ALPHA) != 0)
4057: throw new IllegalStateException(J3dI18N
4058: .getString("GeometryArray92"));
4059:
4060: ((GeometryArrayRetained) this .retained).getColor(index, color);
4061: }
4062:
4063: /**
4064: * Gets the color associated with the vertex at
4065: * the specified index for this object.
4066: * @param index source vertex index in this geometry array
4067: * @param color a vector that will receive the color
4068: * @exception CapabilityNotSetException if the appropriate capability is
4069: * not set and this object is part of a live or compiled scene graph
4070: * @exception IllegalStateException if the data mode for this geometry
4071: * array object is <code>BY_REFERENCE</code>.
4072: * @exception IllegalStateException if COLOR_3 is specified in the vertex
4073: * format
4074: */
4075: public void getColor(int index, Color4b color) {
4076: if (isLiveOrCompiled())
4077: if (!this .getCapability(ALLOW_COLOR_READ))
4078: throw new CapabilityNotSetException(J3dI18N
4079: .getString("GeometryArray56"));
4080:
4081: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4082: if ((format & BY_REFERENCE) != 0)
4083: throw new IllegalStateException(J3dI18N
4084: .getString("GeometryArray82"));
4085:
4086: if ((format & COLOR) == 0)
4087: throw new ArrayIndexOutOfBoundsException(J3dI18N
4088: .getString("GeometryArray76"));
4089:
4090: if ((format & WITH_ALPHA) == 0)
4091: throw new IllegalStateException(J3dI18N
4092: .getString("GeometryArray93"));
4093:
4094: ((GeometryArrayRetained) this .retained).getColor(index, color);
4095: }
4096:
4097: /**
4098: * Gets the colors associated with the vertices starting at
4099: * the specified index for this object. The color is copied into the
4100: * specified array. The length of the destination
4101: * array determines the number of colors copied.
4102: * A maximum of <code>vertexCount-index</code> colors
4103: * are copied. If the destination array is larger than is needed
4104: * to hold the colors, the excess locations in the
4105: * array are not modified. If the destination array is smaller
4106: * than is needed to hold the colors, only as
4107: * many colors as the array will hold are copied.
4108: *
4109: * @param index starting source vertex index in this geometry array
4110: * @param colors destination array of 3*n or 4*n values that will
4111: * receive n new colors
4112: * @exception CapabilityNotSetException if the appropriate capability is
4113: * not set and this object is part of a live or compiled scene graph
4114: * @exception IllegalStateException if the data mode for this geometry
4115: * array object is <code>BY_REFERENCE</code>.
4116: */
4117: public void getColors(int index, float colors[]) {
4118: if (isLiveOrCompiled())
4119: if (!this .getCapability(ALLOW_COLOR_READ))
4120: throw new CapabilityNotSetException(J3dI18N
4121: .getString("GeometryArray62"));
4122:
4123: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4124: if ((format & BY_REFERENCE) != 0)
4125: throw new IllegalStateException(J3dI18N
4126: .getString("GeometryArray82"));
4127:
4128: if ((format & COLOR) == 0)
4129: throw new ArrayIndexOutOfBoundsException(J3dI18N
4130: .getString("GeometryArray76"));
4131:
4132: ((GeometryArrayRetained) this .retained)
4133: .getColors(index, colors);
4134: }
4135:
4136: /**
4137: * Gets the colors associated with the vertices starting at
4138: * the specified index for this object. The color is copied into the
4139: * specified array. The length of the destination
4140: * array determines the number of colors copied.
4141: * A maximum of <code>vertexCount-index</code> colors
4142: * are copied. If the destination array is larger than is needed
4143: * to hold the colors, the excess locations in the
4144: * array are not modified. If the destination array is smaller
4145: * than is needed to hold the colors, only as
4146: * many colors as the array will hold are copied.
4147: *
4148: * @param index starting source vertex index in this geometry array
4149: * @param colors destination array of 3*n or 4*n values that will
4150: * receive new colors
4151: * @exception CapabilityNotSetException if the appropriate capability is
4152: * not set and this object is part of a live or compiled scene graph
4153: * @exception IllegalStateException if the data mode for this geometry
4154: * array object is <code>BY_REFERENCE</code>.
4155: */
4156: public void getColors(int index, byte colors[]) {
4157: if (isLiveOrCompiled())
4158: if (!this .getCapability(ALLOW_COLOR_READ))
4159: throw new CapabilityNotSetException(J3dI18N
4160: .getString("GeometryArray62"));
4161:
4162: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4163: if ((format & BY_REFERENCE) != 0)
4164: throw new IllegalStateException(J3dI18N
4165: .getString("GeometryArray82"));
4166:
4167: if ((format & COLOR) == 0)
4168: throw new ArrayIndexOutOfBoundsException(J3dI18N
4169: .getString("GeometryArray76"));
4170:
4171: ((GeometryArrayRetained) this .retained)
4172: .getColors(index, colors);
4173: }
4174:
4175: /**
4176: * Gets the colors associated with the vertices starting at
4177: * the specified index for this object. The color is copied into the
4178: * specified array. The length of the destination
4179: * array determines the number of colors copied.
4180: * A maximum of <code>vertexCount-index</code> colors
4181: * are copied. If the destination array is larger than is needed
4182: * to hold the colors, the excess locations in the
4183: * array are not modified. If the destination array is smaller
4184: * than is needed to hold the colors, only as
4185: * many colors as the array will hold are copied.
4186: *
4187: * @param index starting source vertex index in this geometry array
4188: * @param colors destination array of Color3f objects that will receive new colors
4189: * @exception CapabilityNotSetException if the appropriate capability is
4190: * not set and this object is part of a live or compiled scene graph
4191: * @exception IllegalStateException if the data mode for this geometry
4192: * array object is <code>BY_REFERENCE</code>.
4193: * @exception IllegalStateException if COLOR_4 is specified in the vertex
4194: * format
4195: */
4196: public void getColors(int index, Color3f colors[]) {
4197: if (isLiveOrCompiled())
4198: if (!this .getCapability(ALLOW_COLOR_READ))
4199: throw new CapabilityNotSetException(J3dI18N
4200: .getString("GeometryArray62"));
4201:
4202: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4203: if ((format & BY_REFERENCE) != 0)
4204: throw new IllegalStateException(J3dI18N
4205: .getString("GeometryArray82"));
4206:
4207: if ((format & COLOR) == 0)
4208: throw new ArrayIndexOutOfBoundsException(J3dI18N
4209: .getString("GeometryArray76"));
4210:
4211: if ((format & WITH_ALPHA) != 0)
4212: throw new IllegalStateException(J3dI18N
4213: .getString("GeometryArray92"));
4214:
4215: ((GeometryArrayRetained) this .retained)
4216: .getColors(index, colors);
4217: }
4218:
4219: /**
4220: * Gets the colors associated with the vertices starting at
4221: * the specified index for this object. The color is copied into the
4222: * specified array. The length of the destination
4223: * array determines the number of colors copied.
4224: * A maximum of <code>vertexCount-index</code> colors
4225: * are copied. If the destination array is larger than is needed
4226: * to hold the colors, the excess locations in the
4227: * array are not modified. If the destination array is smaller
4228: * than is needed to hold the colors, only as
4229: * many colors as the array will hold are copied.
4230: *
4231: * @param index starting source vertex index in this geometry array
4232: * @param colors destination array of Color4f objects that will receive new colors
4233: * @exception CapabilityNotSetException if the appropriate capability is
4234: * not set and this object is part of a live or compiled scene graph
4235: * @exception IllegalStateException if the data mode for this geometry
4236: * array object is <code>BY_REFERENCE</code>.
4237: * @exception IllegalStateException if COLOR_3 is specified in the vertex
4238: * format
4239: */
4240: public void getColors(int index, Color4f colors[]) {
4241: if (isLiveOrCompiled())
4242: if (!this .getCapability(ALLOW_COLOR_READ))
4243: throw new CapabilityNotSetException(J3dI18N
4244: .getString("GeometryArray62"));
4245:
4246: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4247: if ((format & BY_REFERENCE) != 0)
4248: throw new IllegalStateException(J3dI18N
4249: .getString("GeometryArray82"));
4250:
4251: if ((format & COLOR) == 0)
4252: throw new ArrayIndexOutOfBoundsException(J3dI18N
4253: .getString("GeometryArray76"));
4254:
4255: if ((format & WITH_ALPHA) == 0)
4256: throw new IllegalStateException(J3dI18N
4257: .getString("GeometryArray93"));
4258:
4259: ((GeometryArrayRetained) this .retained)
4260: .getColors(index, colors);
4261: }
4262:
4263: /**
4264: * Gets the colors associated with the vertices starting at
4265: * the specified index for this object. The color is copied into the
4266: * specified array. The length of the destination
4267: * array determines the number of colors copied.
4268: * A maximum of <code>vertexCount-index</code> colors
4269: * are copied. If the destination array is larger than is needed
4270: * to hold the colors, the excess locations in the
4271: * array are not modified. If the destination array is smaller
4272: * than is needed to hold the colors, only as
4273: * many colors as the array will hold are copied.
4274: *
4275: * @param index starting source vertex index in this geometry array
4276: * @param colors destination array of Color3b objects that will receive new colors
4277: * @exception CapabilityNotSetException if the appropriate capability is
4278: * not set and this object is part of a live or compiled scene graph
4279: * @exception IllegalStateException if the data mode for this geometry
4280: * array object is <code>BY_REFERENCE</code>.
4281: * @exception IllegalStateException if COLOR_4 is specified in the vertex
4282: * format
4283: */
4284: public void getColors(int index, Color3b colors[]) {
4285: if (isLiveOrCompiled())
4286: if (!this .getCapability(ALLOW_COLOR_READ))
4287: throw new CapabilityNotSetException(J3dI18N
4288: .getString("GeometryArray62"));
4289:
4290: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4291: if ((format & BY_REFERENCE) != 0)
4292: throw new IllegalStateException(J3dI18N
4293: .getString("GeometryArray82"));
4294:
4295: if ((format & COLOR) == 0)
4296: throw new ArrayIndexOutOfBoundsException(J3dI18N
4297: .getString("GeometryArray76"));
4298:
4299: if ((format & WITH_ALPHA) != 0)
4300: throw new IllegalStateException(J3dI18N
4301: .getString("GeometryArray92"));
4302:
4303: ((GeometryArrayRetained) this .retained)
4304: .getColors(index, colors);
4305: }
4306:
4307: /**
4308: * Gets the colors associated with the vertices starting at
4309: * the specified index for this object. The color is copied into the
4310: * specified array. The length of the destination
4311: * array determines the number of colors copied.
4312: * A maximum of <code>vertexCount-index</code> colors
4313: * are copied. If the destination array is larger than is needed
4314: * to hold the colors, the excess locations in the
4315: * array are not modified. If the destination array is smaller
4316: * than is needed to hold the colors, only as
4317: * many colors as the array will hold are copied.
4318: *
4319: * @param index starting source vertex index in this geometry array
4320: * @param colors destination array of Color4b objects that will receive new colors
4321: * @exception CapabilityNotSetException if the appropriate capability is
4322: * not set and this object is part of a live or compiled scene graph
4323: * @exception IllegalStateException if the data mode for this geometry
4324: * array object is <code>BY_REFERENCE</code>.
4325: * @exception IllegalStateException if COLOR_3 is specified in the vertex
4326: * format
4327: */
4328: public void getColors(int index, Color4b colors[]) {
4329: if (isLiveOrCompiled())
4330: if (!this .getCapability(ALLOW_COLOR_READ))
4331: throw new CapabilityNotSetException(J3dI18N
4332: .getString("GeometryArray62"));
4333:
4334: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4335: if ((format & BY_REFERENCE) != 0)
4336: throw new IllegalStateException(J3dI18N
4337: .getString("GeometryArray82"));
4338:
4339: if ((format & COLOR) == 0)
4340: throw new ArrayIndexOutOfBoundsException(J3dI18N
4341: .getString("GeometryArray76"));
4342:
4343: if ((format & WITH_ALPHA) == 0)
4344: throw new IllegalStateException(J3dI18N
4345: .getString("GeometryArray93"));
4346:
4347: ((GeometryArrayRetained) this .retained)
4348: .getColors(index, colors);
4349: }
4350:
4351: /**
4352: * Gets the normal associated with the vertex at
4353: * the specified index for this object. The normal is copied into
4354: * the specified array.
4355: * @param index source vertex index in this geometry array
4356: * @param normal destination array of 3 values that will receive the normal
4357: * @exception CapabilityNotSetException if the appropriate capability is
4358: * not set and this object is part of a live or compiled scene graph
4359: * @exception IllegalStateException if the data mode for this geometry
4360: * array object is <code>BY_REFERENCE</code>.
4361: */
4362: public void getNormal(int index, float normal[]) {
4363: if (isLiveOrCompiled())
4364: if (!this .getCapability(ALLOW_NORMAL_READ))
4365: throw new CapabilityNotSetException(J3dI18N
4366: .getString("GeometryArray68"));
4367:
4368: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4369: if ((format & BY_REFERENCE) != 0)
4370: throw new IllegalStateException(J3dI18N
4371: .getString("GeometryArray82"));
4372:
4373: if ((format & NORMALS) == 0)
4374: throw new ArrayIndexOutOfBoundsException(J3dI18N
4375: .getString("GeometryArray77"));
4376:
4377: ((GeometryArrayRetained) this .retained)
4378: .getNormal(index, normal);
4379: }
4380:
4381: /**
4382: * Gets the normal associated with the vertex at
4383: * the specified index for this object.
4384: * @param index source vertex index in this geometry array
4385: * @param normal the vector that will receive the normal
4386: * @exception CapabilityNotSetException if the appropriate capability is
4387: * not set and this object is part of a live or compiled scene graph
4388: * @exception IllegalStateException if the data mode for this geometry
4389: * array object is <code>BY_REFERENCE</code>.
4390: */
4391: public void getNormal(int index, Vector3f normal) {
4392: if (isLiveOrCompiled())
4393: if (!this .getCapability(ALLOW_NORMAL_READ))
4394: throw new CapabilityNotSetException(J3dI18N
4395: .getString("GeometryArray68"));
4396:
4397: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4398: if ((format & BY_REFERENCE) != 0)
4399: throw new IllegalStateException(J3dI18N
4400: .getString("GeometryArray82"));
4401:
4402: if ((format & NORMALS) == 0)
4403: throw new ArrayIndexOutOfBoundsException(J3dI18N
4404: .getString("GeometryArray77"));
4405:
4406: ((GeometryArrayRetained) this .retained)
4407: .getNormal(index, normal);
4408: }
4409:
4410: /**
4411: * Gets the normals associated with the vertices starting at
4412: * the specified index for this object. The length of the destination
4413: * array determines the number of normals copied.
4414: * A maximum of <code>vertexCount-index</code> normals
4415: * are copied. If the destination array is larger than is needed
4416: * to hold the normals, the excess locations in the
4417: * array are not modified. If the destination array is smaller
4418: * than is needed to hold the normals, only as
4419: * many normals as the array will hold are copied.
4420: *
4421: * @param index starting source vertex index in this geometry array
4422: * @param normals destination array of 3*n values that will receive the normal
4423: * @exception CapabilityNotSetException if the appropriate capability is
4424: * not set and this object is part of a live or compiled scene graph
4425: * @exception IllegalStateException if the data mode for this geometry
4426: * array object is <code>BY_REFERENCE</code>.
4427: */
4428: public void getNormals(int index, float normals[]) {
4429: if (isLiveOrCompiled())
4430: if (!this .getCapability(ALLOW_NORMAL_READ))
4431: throw new CapabilityNotSetException(J3dI18N
4432: .getString("GeometryArray70"));
4433:
4434: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4435: if ((format & BY_REFERENCE) != 0)
4436: throw new IllegalStateException(J3dI18N
4437: .getString("GeometryArray82"));
4438:
4439: if ((format & NORMALS) == 0)
4440: throw new ArrayIndexOutOfBoundsException(J3dI18N
4441: .getString("GeometryArray77"));
4442:
4443: ((GeometryArrayRetained) this .retained).getNormals(index,
4444: normals);
4445: }
4446:
4447: /**
4448: * Gets the normals associated with the vertices starting at
4449: * the specified index for this object. The length of the destination
4450: * array determines the number of normals copied.
4451: * A maximum of <code>vertexCount-index</code> normals
4452: * are copied. If the destination array is larger than is needed
4453: * to hold the normals, the excess locations in the
4454: * array are not modified. If the destination array is smaller
4455: * than is needed to hold the normals, only as
4456: * many normals as the array will hold are copied.
4457: *
4458: * @param index starting source vertex index in this geometry array
4459: * @param normals destination array of vectors that will receive the normals
4460: * @exception CapabilityNotSetException if the appropriate capability is
4461: * not set and this object is part of a live or compiled scene graph
4462: * @exception IllegalStateException if the data mode for this geometry
4463: * array object is <code>BY_REFERENCE</code>.
4464: */
4465: public void getNormals(int index, Vector3f normals[]) {
4466: if (isLiveOrCompiled())
4467: if (!this .getCapability(ALLOW_NORMAL_READ))
4468: throw new CapabilityNotSetException(J3dI18N
4469: .getString("GeometryArray70"));
4470:
4471: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4472: if ((format & BY_REFERENCE) != 0)
4473: throw new IllegalStateException(J3dI18N
4474: .getString("GeometryArray82"));
4475:
4476: if ((format & NORMALS) == 0)
4477: throw new ArrayIndexOutOfBoundsException(J3dI18N
4478: .getString("GeometryArray77"));
4479:
4480: ((GeometryArrayRetained) this .retained).getNormals(index,
4481: normals);
4482: }
4483:
4484: /**
4485: * @deprecated As of Java 3D version 1.2, replaced by
4486: * <code>getTextureCoordinate(int texCoordSet, ...)</code>
4487: */
4488: public void getTextureCoordinate(int index, float texCoord[]) {
4489: getTextureCoordinate(0, index, texCoord);
4490: }
4491:
4492: /**
4493: * Gets the texture coordinate associated with the vertex at
4494: * the specified index in the specified texture coordinate set
4495: * for this object.
4496: *
4497: * @param texCoordSet texture coordinate set in this geometry array
4498: * @param index source vertex index in this geometry array
4499: * @param texCoord array of 2, 3 or 4 values that will receive the
4500: * texture coordinate
4501: * @exception CapabilityNotSetException if the appropriate capability is
4502: * not set and this object is part of a live or compiled scene graph
4503: *
4504: * @exception ArrayIndexOutOfBoundsException if none of the
4505: * <code>TEXTURE_COORDINATE</code> bits are set in the
4506: * <code>vertexFormat</code> or if the index or
4507: * texCoordSet is out of range.
4508: *
4509: * @exception IllegalStateException if the data mode for this geometry
4510: * array object is <code>BY_REFERENCE</code>.
4511: *
4512: * @since Java 3D 1.2
4513: */
4514: public void getTextureCoordinate(int texCoordSet, int index,
4515: float texCoord[]) {
4516: if (isLiveOrCompiled())
4517: if (!this .getCapability(ALLOW_TEXCOORD_READ))
4518: throw new CapabilityNotSetException(J3dI18N
4519: .getString("GeometryArray72"));
4520:
4521: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4522: if ((format & BY_REFERENCE) != 0)
4523: throw new IllegalStateException(J3dI18N
4524: .getString("GeometryArray82"));
4525:
4526: if ((format & TEXTURE_COORDINATE) == 0)
4527: throw new ArrayIndexOutOfBoundsException(J3dI18N
4528: .getString("GeometryArray79"));
4529:
4530: ((GeometryArrayRetained) this .retained).getTextureCoordinate(
4531: texCoordSet, index, texCoord);
4532: }
4533:
4534: /**
4535: * @deprecated As of Java 3D version 1.2, replaced by
4536: * <code>getTextureCoordinate(int texCoordSet, TexCoord2f texCoord)</code>
4537: */
4538: public void getTextureCoordinate(int index, Point2f texCoord) {
4539: getTextureCoordinate(0, index, texCoord2fArray[0]);
4540: texCoord.set(texCoord2fArray[0]);
4541: }
4542:
4543: /**
4544: * Gets the texture coordinate associated with the vertex at
4545: * the specified index in the specified texture coordinate set
4546: * for this object.
4547: *
4548: * @param texCoordSet texture coordinate set in this geometry array
4549: * @param index source vertex index in this geometry array
4550: * @param texCoord the vector that will receive the texture coordinates
4551: *
4552: * @exception CapabilityNotSetException if the appropriate capability is
4553: * not set and this object is part of a live or compiled scene graph
4554: *
4555: * @exception ArrayIndexOutOfBoundsException if none of the
4556: * <code>TEXTURE_COORDINATE</code> bits are set in the
4557: * <code>vertexFormat</code> or if the index or
4558: * texCoordSet is out of range.
4559: *
4560: * @exception IllegalStateException if the data mode for this geometry
4561: * array object is <code>BY_REFERENCE</code>.
4562: *
4563: * @exception IllegalStateException if TEXTURE_COORDINATE_3 or
4564: * TEXTURE_COORDINATE_4 is specified in vertex format
4565: *
4566: * @since Java 3D 1.2
4567: */
4568: public void getTextureCoordinate(int texCoordSet, int index,
4569: TexCoord2f texCoord) {
4570: if (isLiveOrCompiled())
4571: if (!this .getCapability(ALLOW_TEXCOORD_READ))
4572: throw new CapabilityNotSetException(J3dI18N
4573: .getString("GeometryArray72"));
4574:
4575: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4576: if ((format & BY_REFERENCE) != 0)
4577: throw new IllegalStateException(J3dI18N
4578: .getString("GeometryArray82"));
4579:
4580: if ((format & TEXTURE_COORDINATE) == 0)
4581: throw new ArrayIndexOutOfBoundsException(J3dI18N
4582: .getString("GeometryArray79"));
4583:
4584: if (((((GeometryArrayRetained) this .retained).vertexFormat) & (TEXTURE_COORDINATE_3 | TEXTURE_COORDINATE_4)) != 0)
4585: throw new IllegalStateException(J3dI18N
4586: .getString("GeometryArray94"));
4587:
4588: ((GeometryArrayRetained) this .retained).getTextureCoordinate(
4589: texCoordSet, index, texCoord);
4590: }
4591:
4592: /**
4593: * @deprecated As of Java 3D version 1.2, replaced by
4594: * <code>getTextureCoordinate(int texCoordSet, TexCoord3f texCoord)</code>
4595: */
4596: public void getTextureCoordinate(int index, Point3f texCoord) {
4597: getTextureCoordinate(0, index, texCoord3fArray[0]);
4598: texCoord.set(texCoord3fArray[0]);
4599: }
4600:
4601: /**
4602: * Gets the texture coordinate associated with the vertex at
4603: * the specified index in the specified texture coordinate set
4604: * for this object.
4605: *
4606: * @param texCoordSet texture coordinate set in this geometry array
4607: * @param index source vertex index in this geometry array
4608: * @param texCoord the vector that will receive the texture coordinates
4609: *
4610: * @exception CapabilityNotSetException if the appropriate capability is
4611: * not set and this object is part of a live or compiled scene graph
4612: *
4613: * @exception ArrayIndexOutOfBoundsException if none of the
4614: * <code>TEXTURE_COORDINATE</code> bits are set in the
4615: * <code>vertexFormat</code> or if the index or
4616: * texCoordSet is out of range.
4617: *
4618: * @exception IllegalStateException if the data mode for this geometry
4619: * array object is <code>BY_REFERENCE</code>.
4620: *
4621: * @exception IllegalStateException if TEXTURE_COORDINATE_2 or
4622: * TEXTURE_COORDINATE_4 is specified in vertex format
4623: *
4624: * @since Java 3D 1.2
4625: */
4626: public void getTextureCoordinate(int texCoordSet, int index,
4627: TexCoord3f texCoord) {
4628: if (isLiveOrCompiled())
4629: if (!this .getCapability(ALLOW_TEXCOORD_READ))
4630: throw new CapabilityNotSetException(J3dI18N
4631: .getString("GeometryArray72"));
4632:
4633: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4634: if ((format & BY_REFERENCE) != 0)
4635: throw new IllegalStateException(J3dI18N
4636: .getString("GeometryArray82"));
4637:
4638: if ((format & TEXTURE_COORDINATE) == 0)
4639: throw new ArrayIndexOutOfBoundsException(J3dI18N
4640: .getString("GeometryArray79"));
4641:
4642: if (((((GeometryArrayRetained) this .retained).vertexFormat) & (TEXTURE_COORDINATE_2 | TEXTURE_COORDINATE_4)) != 0)
4643: throw new IllegalStateException(J3dI18N
4644: .getString("GeometryArray95"));
4645: ((GeometryArrayRetained) this .retained).getTextureCoordinate(
4646: texCoordSet, index, texCoord);
4647: }
4648:
4649: /**
4650: * Gets the texture coordinate associated with the vertex at
4651: * the specified index in the specified texture coordinate set
4652: * for this object.
4653: *
4654: * @param texCoordSet texture coordinate set in this geometry array
4655: * @param index source vertex index in this geometry array
4656: * @param texCoord the vector that will receive the texture coordinates
4657: *
4658: * @exception CapabilityNotSetException if the appropriate capability is
4659: * not set and this object is part of a live or compiled scene graph
4660: *
4661: * @exception ArrayIndexOutOfBoundsException if none of the
4662: * <code>TEXTURE_COORDINATE</code> bits are set in the
4663: * <code>vertexFormat</code> or if the index or
4664: * texCoordSet is out of range.
4665: *
4666: * @exception IllegalStateException if the data mode for this geometry
4667: * array object is <code>BY_REFERENCE</code>.
4668: *
4669: * @exception IllegalStateException if TEXTURE_COORDINATE_2 or
4670: * TEXTURE_COORDINATE_3 is specified in vertex format
4671: *
4672: * @since Java 3D 1.3
4673: */
4674: public void getTextureCoordinate(int texCoordSet, int index,
4675: TexCoord4f texCoord) {
4676: if (isLiveOrCompiled())
4677: if (!this .getCapability(ALLOW_TEXCOORD_READ))
4678: throw new CapabilityNotSetException(J3dI18N
4679: .getString("GeometryArray72"));
4680:
4681: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4682: if ((format & BY_REFERENCE) != 0)
4683: throw new IllegalStateException(J3dI18N
4684: .getString("GeometryArray82"));
4685:
4686: if ((format & TEXTURE_COORDINATE) == 0)
4687: throw new ArrayIndexOutOfBoundsException(J3dI18N
4688: .getString("GeometryArray79"));
4689:
4690: if (((((GeometryArrayRetained) this .retained).vertexFormat) & (TEXTURE_COORDINATE_2 | TEXTURE_COORDINATE_3)) != 0)
4691: throw new IllegalStateException(J3dI18N
4692: .getString("GeometryArray109"));
4693: ((GeometryArrayRetained) this .retained).getTextureCoordinate(
4694: texCoordSet, index, texCoord);
4695: }
4696:
4697: /**
4698: * @deprecated As of Java 3D version 1.2, replaced by
4699: * <code>getTextureCoordinates(int texCoordSet, ...)</code>
4700: */
4701: public void getTextureCoordinates(int index, float texCoords[]) {
4702: getTextureCoordinates(0, index, texCoords);
4703: }
4704:
4705: /**
4706: * Gets the texture coordinates associated with the vertices starting at
4707: * the specified index in the specified texture coordinate set
4708: * for this object. The length of the destination
4709: * array determines the number of texture coordinates copied.
4710: * A maximum of <code>vertexCount-index</code> texture coordinates
4711: * are copied. If the destination array is larger than is needed
4712: * to hold the texture coordinates, the excess locations in the
4713: * array are not modified. If the destination array is smaller
4714: * than is needed to hold the texture coordinates, only as
4715: * many texture coordinates as the array will hold are copied.
4716: *
4717: * @param texCoordSet texture coordinate set in this geometry array
4718: * @param index starting source vertex index in this geometry array
4719: * @param texCoords destination array of 2*n , 3*n or 4*n values that
4720: * will receive n new texture coordinates
4721: *
4722: * @exception CapabilityNotSetException if the appropriate capability is
4723: * not set and this object is part of a live or compiled scene graph
4724: *
4725: * @exception ArrayIndexOutOfBoundsException if none of the
4726: * <code>TEXTURE_COORDINATE</code> bits are set in the
4727: * <code>vertexFormat</code> or if the index or
4728: * texCoordSet is out of range.
4729: *
4730: * @exception IllegalStateException if the data mode for this geometry
4731: * array object is <code>BY_REFERENCE</code>.
4732: *
4733: * @since Java 3D 1.2
4734: */
4735: public void getTextureCoordinates(int texCoordSet, int index,
4736: float texCoords[]) {
4737: if (isLiveOrCompiled())
4738: if (!this .getCapability(ALLOW_TEXCOORD_READ))
4739: throw new CapabilityNotSetException(J3dI18N
4740: .getString("GeometryArray75"));
4741:
4742: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4743: if ((format & BY_REFERENCE) != 0)
4744: throw new IllegalStateException(J3dI18N
4745: .getString("GeometryArray82"));
4746:
4747: if ((format & TEXTURE_COORDINATE) == 0)
4748: throw new ArrayIndexOutOfBoundsException(J3dI18N
4749: .getString("GeometryArray79"));
4750:
4751: ((GeometryArrayRetained) this .retained).getTextureCoordinates(
4752: texCoordSet, index, texCoords);
4753: }
4754:
4755: /**
4756: * @deprecated As of Java 3D version 1.2, replaced by
4757: * <code>getTextureCoordinates(int texCoordSet, TexCoord2f texCoords[])</code>
4758: */
4759: public void getTextureCoordinates(int index, Point2f texCoords[]) {
4760: if (isLiveOrCompiled())
4761: if (!this .getCapability(ALLOW_TEXCOORD_READ))
4762: throw new CapabilityNotSetException(J3dI18N
4763: .getString("GeometryArray75"));
4764:
4765: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4766: if ((format & BY_REFERENCE) != 0)
4767: throw new IllegalStateException(J3dI18N
4768: .getString("GeometryArray82"));
4769:
4770: if ((format & TEXTURE_COORDINATE) == 0)
4771: throw new ArrayIndexOutOfBoundsException(J3dI18N
4772: .getString("GeometryArray79"));
4773:
4774: ((GeometryArrayRetained) this .retained).getTextureCoordinates(
4775: 0, index, texCoords);
4776: }
4777:
4778: /**
4779: * Gets the texture coordinates associated with the vertices starting at
4780: * the specified index in the specified texture coordinate set
4781: * for this object. The length of the destination
4782: * array determines the number of texture coordinates copied.
4783: * A maximum of <code>vertexCount-index</code> texture coordinates
4784: * are copied. If the destination array is larger than is needed
4785: * to hold the texture coordinates, the excess locations in the
4786: * array are not modified. If the destination array is smaller
4787: * than is needed to hold the texture coordinates, only as
4788: * many texture coordinates as the array will hold are copied.
4789: *
4790: * @param texCoordSet texture coordinate set in this geometry array
4791: * @param index starting source vertex index in this geometry array
4792: * @param texCoords destination array of TexCoord2f objects that will
4793: * receive the texture coordinates
4794: *
4795: * @exception CapabilityNotSetException if the appropriate capability is
4796: * not set and this object is part of a live or compiled scene graph
4797: *
4798: * @exception ArrayIndexOutOfBoundsException if none of the
4799: * <code>TEXTURE_COORDINATE</code> bits are set in the
4800: * <code>vertexFormat</code> or if the index or
4801: * texCoordSet is out of range.
4802: *
4803: * @exception IllegalStateException if the data mode for this geometry
4804: * array object is <code>BY_REFERENCE</code>.
4805: *
4806: * @exception IllegalStateException if TEXTURE_COORDINATE_3 or
4807: * TEXTURE_COORDINATE_4 is specified in vertex format
4808: *
4809: * @since Java 3D 1.2
4810: */
4811: public void getTextureCoordinates(int texCoordSet, int index,
4812: TexCoord2f texCoords[]) {
4813: if (isLiveOrCompiled())
4814: if (!this .getCapability(ALLOW_TEXCOORD_READ))
4815: throw new CapabilityNotSetException(J3dI18N
4816: .getString("GeometryArray75"));
4817:
4818: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4819: if ((format & BY_REFERENCE) != 0)
4820: throw new IllegalStateException(J3dI18N
4821: .getString("GeometryArray82"));
4822:
4823: if ((format & TEXTURE_COORDINATE) == 0)
4824: throw new ArrayIndexOutOfBoundsException(J3dI18N
4825: .getString("GeometryArray79"));
4826:
4827: if (((((GeometryArrayRetained) this .retained).vertexFormat) & (TEXTURE_COORDINATE_3 | TEXTURE_COORDINATE_4)) != 0)
4828: throw new IllegalStateException(J3dI18N
4829: .getString("GeometryArray94"));
4830: ((GeometryArrayRetained) this .retained).getTextureCoordinates(
4831: texCoordSet, index, texCoords);
4832: }
4833:
4834: /**
4835: * @deprecated As of Java 3D version 1.2, replaced by
4836: * <code>getTextureCoordinates(int texCoordSet, TexCoord3f texCoords[])</code>
4837: */
4838: public void getTextureCoordinates(int index, Point3f texCoords[]) {
4839: if (isLiveOrCompiled())
4840: if (!this .getCapability(ALLOW_TEXCOORD_READ))
4841: throw new CapabilityNotSetException(J3dI18N
4842: .getString("GeometryArray75"));
4843:
4844: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4845: if ((format & BY_REFERENCE) != 0)
4846: throw new IllegalStateException(J3dI18N
4847: .getString("GeometryArray82"));
4848:
4849: if ((format & TEXTURE_COORDINATE) == 0)
4850: throw new ArrayIndexOutOfBoundsException(J3dI18N
4851: .getString("GeometryArray79"));
4852:
4853: ((GeometryArrayRetained) this .retained).getTextureCoordinates(
4854: 0, index, texCoords);
4855: }
4856:
4857: /**
4858: * Gets the texture coordinates associated with the vertices starting at
4859: * the specified index in the specified texture coordinate set
4860: * for this object. The length of the destination
4861: * array determines the number of texture coordinates copied.
4862: * A maximum of <code>vertexCount-index</code> texture coordinates
4863: * are copied. If the destination array is larger than is needed
4864: * to hold the texture coordinates, the excess locations in the
4865: * array are not modified. If the destination array is smaller
4866: * than is needed to hold the texture coordinates, only as
4867: * many texture coordinates as the array will hold are copied.
4868: *
4869: * @param texCoordSet texture coordinate set in this geometry array
4870: * @param index starting source vertex index in this geometry array
4871: * @param texCoords destination array of TexCoord3f objects that will
4872: * receive the texture coordinates
4873: *
4874: * @exception CapabilityNotSetException if the appropriate capability is
4875: * not set and this object is part of a live or compiled scene graph
4876: *
4877: * @exception ArrayIndexOutOfBoundsException if none of the
4878: * <code>TEXTURE_COORDINATE</code> bits are set in the
4879: * <code>vertexFormat</code> or if the index or
4880: * texCoordSet is out of range.
4881: *
4882: * @exception IllegalStateException if the data mode for this geometry
4883: * array object is <code>BY_REFERENCE</code>.
4884: *
4885: * @exception IllegalStateException if TEXTURE_COORDINATE_2 or
4886: * TEXTURE_COORDINATE_4 is specified in vertex format
4887: *
4888: * @since Java 3D 1.2
4889: */
4890: public void getTextureCoordinates(int texCoordSet, int index,
4891: TexCoord3f texCoords[]) {
4892: if (isLiveOrCompiled())
4893: if (!this .getCapability(ALLOW_TEXCOORD_READ))
4894: throw new CapabilityNotSetException(J3dI18N
4895: .getString("GeometryArray75"));
4896:
4897: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4898: if ((format & BY_REFERENCE) != 0)
4899: throw new IllegalStateException(J3dI18N
4900: .getString("GeometryArray82"));
4901:
4902: if ((format & TEXTURE_COORDINATE) == 0)
4903: throw new ArrayIndexOutOfBoundsException(J3dI18N
4904: .getString("GeometryArray79"));
4905:
4906: if (((((GeometryArrayRetained) this .retained).vertexFormat) & (TEXTURE_COORDINATE_2 | TEXTURE_COORDINATE_4)) != 0)
4907: throw new IllegalStateException(J3dI18N
4908: .getString("GeometryArray95"));
4909: ((GeometryArrayRetained) this .retained).getTextureCoordinates(
4910: texCoordSet, index, texCoords);
4911: }
4912:
4913: /**
4914: * Gets the texture coordinates associated with the vertices starting at
4915: * the specified index in the specified texture coordinate set
4916: * for this object. The length of the destination
4917: * array determines the number of texture coordinates copied.
4918: * A maximum of <code>vertexCount-index</code> texture coordinates
4919: * are copied. If the destination array is larger than is needed
4920: * to hold the texture coordinates, the excess locations in the
4921: * array are not modified. If the destination array is smaller
4922: * than is needed to hold the texture coordinates, only as
4923: * many texture coordinates as the array will hold are copied.
4924: *
4925: * @param texCoordSet texture coordinate set in this geometry array
4926: * @param index starting source vertex index in this geometry array
4927: * @param texCoords destination array of TexCoord4f objects that will
4928: * receive the texture coordinates
4929: *
4930: * @exception CapabilityNotSetException if the appropriate capability is
4931: * not set and this object is part of a live or compiled scene graph
4932: *
4933: * @exception ArrayIndexOutOfBoundsException if none of the
4934: * <code>TEXTURE_COORDINATE</code> bits are set in the
4935: * <code>vertexFormat</code> or if the index or
4936: * texCoordSet is out of range.
4937: *
4938: * @exception IllegalStateException if the data mode for this geometry
4939: * array object is <code>BY_REFERENCE</code>.
4940: *
4941: * @exception IllegalStateException if TEXTURE_COORDINATE_2 or
4942: * TEXTURE_COORDINATE_3 is specified in vertex format
4943: *
4944: * @since Java 3D 1.3
4945: */
4946: public void getTextureCoordinates(int texCoordSet, int index,
4947: TexCoord4f texCoords[]) {
4948: if (isLiveOrCompiled())
4949: if (!this .getCapability(ALLOW_TEXCOORD_READ))
4950: throw new CapabilityNotSetException(J3dI18N
4951: .getString("GeometryArray75"));
4952:
4953: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
4954: if ((format & BY_REFERENCE) != 0)
4955: throw new IllegalStateException(J3dI18N
4956: .getString("GeometryArray82"));
4957:
4958: if ((format & TEXTURE_COORDINATE) == 0)
4959: throw new ArrayIndexOutOfBoundsException(J3dI18N
4960: .getString("GeometryArray79"));
4961:
4962: if (((((GeometryArrayRetained) this .retained).vertexFormat) & (TEXTURE_COORDINATE_2 | TEXTURE_COORDINATE_3)) != 0)
4963: throw new IllegalStateException(J3dI18N
4964: .getString("GeometryArray109"));
4965:
4966: ((GeometryArrayRetained) this .retained).getTextureCoordinates(
4967: texCoordSet, index, texCoords);
4968: }
4969:
4970: /**
4971: * Gets the vertex attribute associated with the vertex at
4972: * the specified index in the specified vertex attribute number
4973: * for this object.
4974: *
4975: * @param vertexAttrNum vertex attribute number in this geometry array
4976: * @param index source vertex index in this geometry array
4977: * @param vertexAttr array of 1, 2, 3 or 4 values that will receive the
4978: * vertex attribute
4979: * @exception CapabilityNotSetException if the appropriate capability is
4980: * not set and this object is part of a live or compiled scene graph
4981: *
4982: * @exception ArrayIndexOutOfBoundsException if the index or
4983: * vertexAttrNum is out of range, or if the vertexAttr array is
4984: * too small.
4985: *
4986: * @exception IllegalStateException if the data mode for this geometry
4987: * array object is <code>BY_REFERENCE</code>.
4988: *
4989: * @since Java 3D 1.4
4990: */
4991: public void getVertexAttr(int vertexAttrNum, int index,
4992: float[] vertexAttr) {
4993: if (isLiveOrCompiled()) {
4994: if (!this .getCapability(ALLOW_VERTEX_ATTR_READ)) {
4995: throw new CapabilityNotSetException(J3dI18N
4996: .getString("GeometryArray127"));
4997: }
4998: }
4999:
5000: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5001: if ((format & BY_REFERENCE) != 0) {
5002: throw new IllegalStateException(J3dI18N
5003: .getString("GeometryArray82"));
5004: }
5005:
5006: ((GeometryArrayRetained) this .retained).getVertexAttr(
5007: vertexAttrNum, index, vertexAttr);
5008: }
5009:
5010: /**
5011: * Gets the vertex attribute associated with the vertex at
5012: * the specified index in the specified vertex attribute number
5013: * for this object.
5014: *
5015: * @param vertexAttrNum vertex attribute number in this geometry array
5016: * @param index source vertex index in this geometry array
5017: * @param vertexAttr the vector that will receive the vertex attributes
5018: *
5019: * @exception CapabilityNotSetException if the appropriate capability is
5020: * not set and this object is part of a live or compiled scene graph
5021: *
5022: * @exception ArrayIndexOutOfBoundsException if the index or
5023: * vertexAttrNum is out of range.
5024: *
5025: * @exception IllegalStateException if the data mode for this geometry
5026: * array object is <code>BY_REFERENCE</code>.
5027: *
5028: * @exception IllegalStateException if the size of the specified
5029: * vertex attribute number is not 2.
5030: *
5031: * @since Java 3D 1.4
5032: */
5033: public void getVertexAttr(int vertexAttrNum, int index,
5034: Point2f vertexAttr) {
5035: if (isLiveOrCompiled()) {
5036: if (!this .getCapability(ALLOW_VERTEX_ATTR_READ)) {
5037: throw new CapabilityNotSetException(J3dI18N
5038: .getString("GeometryArray127"));
5039: }
5040: }
5041:
5042: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5043: if ((format & BY_REFERENCE) != 0) {
5044: throw new IllegalStateException(J3dI18N
5045: .getString("GeometryArray82"));
5046: }
5047:
5048: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
5049: if (size != 2) {
5050: throw new IllegalStateException(J3dI18N
5051: .getString("GeometryArray134"));
5052: }
5053:
5054: ((GeometryArrayRetained) this .retained).getVertexAttr(
5055: vertexAttrNum, index, vertexAttr);
5056: }
5057:
5058: /**
5059: * Gets the vertex attribute associated with the vertex at
5060: * the specified index in the specified vertex attribute number
5061: * for this object.
5062: *
5063: * @param vertexAttrNum vertex attribute number in this geometry array
5064: * @param index source vertex index in this geometry array
5065: * @param vertexAttr the vector that will receive the vertex attributes
5066: *
5067: * @exception CapabilityNotSetException if the appropriate capability is
5068: * not set and this object is part of a live or compiled scene graph
5069: *
5070: * @exception ArrayIndexOutOfBoundsException if the index or
5071: * vertexAttrNum is out of range.
5072: *
5073: * @exception IllegalStateException if the data mode for this geometry
5074: * array object is <code>BY_REFERENCE</code>.
5075: *
5076: * @exception IllegalStateException if the size of the specified
5077: * vertex attribute number is not 3.
5078: *
5079: * @since Java 3D 1.4
5080: */
5081: public void getVertexAttr(int vertexAttrNum, int index,
5082: Point3f vertexAttr) {
5083: if (isLiveOrCompiled()) {
5084: if (!this .getCapability(ALLOW_VERTEX_ATTR_READ)) {
5085: throw new CapabilityNotSetException(J3dI18N
5086: .getString("GeometryArray127"));
5087: }
5088: }
5089:
5090: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5091: if ((format & BY_REFERENCE) != 0) {
5092: throw new IllegalStateException(J3dI18N
5093: .getString("GeometryArray82"));
5094: }
5095:
5096: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
5097: if (size != 3) {
5098: throw new IllegalStateException(J3dI18N
5099: .getString("GeometryArray134"));
5100: }
5101:
5102: ((GeometryArrayRetained) this .retained).getVertexAttr(
5103: vertexAttrNum, index, vertexAttr);
5104: }
5105:
5106: /**
5107: * Gets the vertex attribute associated with the vertex at
5108: * the specified index in the specified vertex attribute number
5109: * for this object.
5110: *
5111: * @param vertexAttrNum vertex attribute number in this geometry array
5112: * @param index source vertex index in this geometry array
5113: * @param vertexAttr the vector that will receive the vertex attributes
5114: *
5115: * @exception CapabilityNotSetException if the appropriate capability is
5116: * not set and this object is part of a live or compiled scene graph
5117: *
5118: * @exception ArrayIndexOutOfBoundsException if the index or
5119: * vertexAttrNum is out of range.
5120: *
5121: * @exception IllegalStateException if the data mode for this geometry
5122: * array object is <code>BY_REFERENCE</code>.
5123: *
5124: * @exception IllegalStateException if the size of the specified
5125: * vertex attribute number is not 4.
5126: *
5127: * @since Java 3D 1.4
5128: */
5129: public void getVertexAttr(int vertexAttrNum, int index,
5130: Point4f vertexAttr) {
5131: if (isLiveOrCompiled()) {
5132: if (!this .getCapability(ALLOW_VERTEX_ATTR_READ)) {
5133: throw new CapabilityNotSetException(J3dI18N
5134: .getString("GeometryArray127"));
5135: }
5136: }
5137:
5138: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5139: if ((format & BY_REFERENCE) != 0) {
5140: throw new IllegalStateException(J3dI18N
5141: .getString("GeometryArray82"));
5142: }
5143:
5144: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
5145: if (size != 4) {
5146: throw new IllegalStateException(J3dI18N
5147: .getString("GeometryArray134"));
5148: }
5149:
5150: ((GeometryArrayRetained) this .retained).getVertexAttr(
5151: vertexAttrNum, index, vertexAttr);
5152: }
5153:
5154: /**
5155: * Gets the vertex attributes associated with the vertices starting at
5156: * the specified index in the specified vertex attribute number
5157: * for this object. The length of the destination
5158: * array determines the number of vertex attributes copied.
5159: * A maximum of <code>vertexCount-index</code> vertex attributes
5160: * are copied. If the destination array is larger than is needed
5161: * to hold the vertex attributes, the excess locations in the
5162: * array are not modified. If the destination array is smaller
5163: * than is needed to hold the vertex attributes, only as
5164: * many vertex attributes as the array will hold are copied.
5165: *
5166: * @param vertexAttrNum vertex attribute number in this geometry array
5167: * @param index starting source vertex index in this geometry array
5168: * @param vertexAttrs destination array of 1*n, 2*n, 3*n, or 4*n values
5169: * that will receive n new vertex attributes
5170: *
5171: * @exception CapabilityNotSetException if the appropriate capability is
5172: * not set and this object is part of a live or compiled scene graph
5173: *
5174: * @exception ArrayIndexOutOfBoundsException if the index or
5175: * vertexAttrNum is out of range.
5176: *
5177: * @exception IllegalStateException if the data mode for this geometry
5178: * array object is <code>BY_REFERENCE</code>.
5179: *
5180: * @since Java 3D 1.4
5181: */
5182: public void getVertexAttrs(int vertexAttrNum, int index,
5183: float[] vertexAttrs) {
5184:
5185: if (isLiveOrCompiled()) {
5186: if (!this .getCapability(ALLOW_VERTEX_ATTR_READ)) {
5187: throw new CapabilityNotSetException(J3dI18N
5188: .getString("GeometryArray127"));
5189: }
5190: }
5191:
5192: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5193: if ((format & BY_REFERENCE) != 0) {
5194: throw new IllegalStateException(J3dI18N
5195: .getString("GeometryArray82"));
5196: }
5197:
5198: ((GeometryArrayRetained) this .retained).getVertexAttrs(
5199: vertexAttrNum, index, vertexAttrs);
5200: }
5201:
5202: /**
5203: * Gets the vertex attributes associated with the vertices starting at
5204: * the specified index in the specified vertex attribute number
5205: * for this object. The length of the destination
5206: * array determines the number of vertex attributes copied.
5207: * A maximum of <code>vertexCount-index</code> vertex attributes
5208: * are copied. If the destination array is larger than is needed
5209: * to hold the vertex attributes, the excess locations in the
5210: * array are not modified. If the destination array is smaller
5211: * than is needed to hold the vertex attributes, only as
5212: * many vertex attributes as the array will hold are copied.
5213: *
5214: * @param vertexAttrNum vertex attribute number in this geometry array
5215: * @param index starting source vertex index in this geometry array
5216: * @param vertexAttrs destination array of Point2f objects that will
5217: * receive the vertex attributes
5218: *
5219: * @exception CapabilityNotSetException if the appropriate capability is
5220: * not set and this object is part of a live or compiled scene graph
5221: *
5222: * @exception ArrayIndexOutOfBoundsException if the index or
5223: * vertexAttrNum is out of range.
5224: *
5225: * @exception IllegalStateException if the data mode for this geometry
5226: * array object is <code>BY_REFERENCE</code>.
5227: *
5228: * @exception IllegalStateException if the size of the specified
5229: * vertex attribute number is not 2.
5230: *
5231: * @since Java 3D 1.4
5232: */
5233: public void getVertexAttrs(int vertexAttrNum, int index,
5234: Point2f[] vertexAttrs) {
5235: if (isLiveOrCompiled()) {
5236: if (!this .getCapability(ALLOW_VERTEX_ATTR_READ)) {
5237: throw new CapabilityNotSetException(J3dI18N
5238: .getString("GeometryArray127"));
5239: }
5240: }
5241:
5242: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5243: if ((format & BY_REFERENCE) != 0) {
5244: throw new IllegalStateException(J3dI18N
5245: .getString("GeometryArray82"));
5246: }
5247:
5248: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
5249: if (size != 2) {
5250: throw new IllegalStateException(J3dI18N
5251: .getString("GeometryArray134"));
5252: }
5253:
5254: ((GeometryArrayRetained) this .retained).getVertexAttrs(
5255: vertexAttrNum, index, vertexAttrs);
5256: }
5257:
5258: /**
5259: * Gets the vertex attributes associated with the vertices starting at
5260: * the specified index in the specified vertex attribute number
5261: * for this object. The length of the destination
5262: * array determines the number of vertex attributes copied.
5263: * A maximum of <code>vertexCount-index</code> vertex attributes
5264: * are copied. If the destination array is larger than is needed
5265: * to hold the vertex attributes, the excess locations in the
5266: * array are not modified. If the destination array is smaller
5267: * than is needed to hold the vertex attributes, only as
5268: * many vertex attributes as the array will hold are copied.
5269: *
5270: * @param vertexAttrNum vertex attribute number in this geometry array
5271: * @param index starting source vertex index in this geometry array
5272: * @param vertexAttrs destination array of Point3f objects that will
5273: * receive the vertex attributes
5274: *
5275: * @exception CapabilityNotSetException if the appropriate capability is
5276: * not set and this object is part of a live or compiled scene graph
5277: *
5278: * @exception ArrayIndexOutOfBoundsException if the index or
5279: * vertexAttrNum is out of range.
5280: *
5281: * @exception IllegalStateException if the data mode for this geometry
5282: * array object is <code>BY_REFERENCE</code>.
5283: *
5284: * @exception IllegalStateException if the size of the specified
5285: * vertex attribute number is not 3.
5286: *
5287: * @since Java 3D 1.4
5288: */
5289: public void getVertexAttrs(int vertexAttrNum, int index,
5290: Point3f[] vertexAttrs) {
5291: if (isLiveOrCompiled()) {
5292: if (!this .getCapability(ALLOW_VERTEX_ATTR_READ)) {
5293: throw new CapabilityNotSetException(J3dI18N
5294: .getString("GeometryArray127"));
5295: }
5296: }
5297:
5298: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5299: if ((format & BY_REFERENCE) != 0) {
5300: throw new IllegalStateException(J3dI18N
5301: .getString("GeometryArray82"));
5302: }
5303:
5304: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
5305: if (size != 3) {
5306: throw new IllegalStateException(J3dI18N
5307: .getString("GeometryArray134"));
5308: }
5309:
5310: ((GeometryArrayRetained) this .retained).getVertexAttrs(
5311: vertexAttrNum, index, vertexAttrs);
5312: }
5313:
5314: /**
5315: * Gets the vertex attributes associated with the vertices starting at
5316: * the specified index in the specified vertex attribute number
5317: * for this object. The length of the destination
5318: * array determines the number of vertex attributes copied.
5319: * A maximum of <code>vertexCount-index</code> vertex attributes
5320: * are copied. If the destination array is larger than is needed
5321: * to hold the vertex attributes, the excess locations in the
5322: * array are not modified. If the destination array is smaller
5323: * than is needed to hold the vertex attributes, only as
5324: * many vertex attributes as the array will hold are copied.
5325: *
5326: * @param vertexAttrNum vertex attribute number in this geometry array
5327: * @param index starting source vertex index in this geometry array
5328: * @param vertexAttrs destination array of Point4f objects that will
5329: * receive the vertex attributes
5330: *
5331: * @exception CapabilityNotSetException if the appropriate capability is
5332: * not set and this object is part of a live or compiled scene graph
5333: *
5334: * @exception ArrayIndexOutOfBoundsException if the index or
5335: * vertexAttrNum is out of range.
5336: *
5337: * @exception IllegalStateException if the data mode for this geometry
5338: * array object is <code>BY_REFERENCE</code>.
5339: *
5340: * @exception IllegalStateException if the size of the specified
5341: * vertex attribute number is not 4.
5342: *
5343: * @since Java 3D 1.4
5344: */
5345: public void getVertexAttrs(int vertexAttrNum, int index,
5346: Point4f[] vertexAttrs) {
5347: if (isLiveOrCompiled()) {
5348: if (!this .getCapability(ALLOW_VERTEX_ATTR_READ)) {
5349: throw new CapabilityNotSetException(J3dI18N
5350: .getString("GeometryArray127"));
5351: }
5352: }
5353:
5354: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5355: if ((format & BY_REFERENCE) != 0) {
5356: throw new IllegalStateException(J3dI18N
5357: .getString("GeometryArray82"));
5358: }
5359:
5360: int size = ((GeometryArrayRetained) this .retained).vertexAttrSizes[vertexAttrNum];
5361: if (size != 4) {
5362: throw new IllegalStateException(J3dI18N
5363: .getString("GeometryArray134"));
5364: }
5365:
5366: ((GeometryArrayRetained) this .retained).getVertexAttrs(
5367: vertexAttrNum, index, vertexAttrs);
5368: }
5369:
5370: //------------------------------------------------------------------
5371: // By-reference methods
5372: //------------------------------------------------------------------
5373:
5374: /**
5375: * Sets the initial coordinate index for this GeometryArray object.
5376: * This index specifies the first coordinate within the array of
5377: * coordinates referenced by this geometry
5378: * array that is actually used in rendering or other operations
5379: * such as picking and collision. This attribute is initialized
5380: * to 0.
5381: * This attribute is only used when the data mode for this
5382: * geometry array object is <code>BY_REFERENCE</code>
5383: * and is <i>not</i> </code>INTERLEAVED</code>.
5384: *
5385: * @param initialCoordIndex the new initial coordinate index.
5386: *
5387: * @exception CapabilityNotSetException if the appropriate capability is
5388: * not set and this object is part of a live or compiled scene graph
5389: * <p>
5390: * @exception IllegalStateException if the data mode for this geometry
5391: * array object is not <code>BY_REFERENCE</code> or if the data mode
5392: * is <code>INTERLEAVED</code>.
5393: * <p>
5394: * @exception IllegalArgumentException if either of the following are
5395: * true:
5396: * <ul>
5397: * <code>initialCoordIndex < 0</code> or<br>
5398: * <code>initialCoordIndex + validVertexCount > vertexCount</code><br>
5399: * </ul>
5400: * <p>
5401: * @exception ArrayIndexOutOfBoundsException if
5402: * the CoordRef array is non-null and:
5403: * <ul>
5404: * <code>CoordRef.length</code> < <i>num_words</i> *
5405: * (<code>initialCoordIndex + validVertexCount</code>)<br>
5406: * </ul>
5407: * where <i>num_words</i> depends on which variant of
5408: * <code>setCoordRef</code> is used.
5409: *
5410: * @since Java 3D 1.2
5411: */
5412: public void setInitialCoordIndex(int initialCoordIndex) {
5413: if (isLiveOrCompiled())
5414: if (!this .getCapability(ALLOW_COUNT_WRITE))
5415: throw new CapabilityNotSetException(J3dI18N
5416: .getString("GeometryArray90"));
5417:
5418: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5419: if (initialCoordIndex < 0)
5420: throw new IllegalArgumentException(J3dI18N
5421: .getString("GeometryArray97"));
5422: if ((format & BY_REFERENCE) == 0)
5423: throw new IllegalStateException(J3dI18N
5424: .getString("GeometryArray83"));
5425:
5426: if ((format & INTERLEAVED) != 0)
5427: throw new IllegalStateException(J3dI18N
5428: .getString("GeometryArray84"));
5429:
5430: ((GeometryArrayRetained) this .retained)
5431: .setInitialCoordIndex(initialCoordIndex);
5432: // NOTE: the check for initialCoordIndex + validVertexCount >
5433: // vertexCount needs to be done in the retained method
5434: }
5435:
5436: /**
5437: * Gets the initial coordinate index for this GeometryArray object.
5438: * This attribute is only used when the data mode for this
5439: * geometry array object is <code>BY_REFERENCE</code>
5440: * and is <i>not</i> </code>INTERLEAVED</code>.
5441: * @return the current initial coordinate index for this
5442: * GeometryArray object.
5443: * @exception CapabilityNotSetException if the appropriate capability is
5444: * not set and this object is part of a live or compiled scene graph
5445: *
5446: * @since Java 3D 1.2
5447: */
5448: public int getInitialCoordIndex() {
5449: if (isLiveOrCompiled())
5450: if (!this .getCapability(ALLOW_COUNT_READ))
5451: throw new CapabilityNotSetException(J3dI18N
5452: .getString("GeometryArray91"));
5453:
5454: return ((GeometryArrayRetained) this .retained)
5455: .getInitialCoordIndex();
5456: }
5457:
5458: /**
5459: * Sets the initial color index for this GeometryArray object.
5460: * This index specifies the first color within the array of
5461: * colors referenced by this geometry
5462: * array that is actually used in rendering or other operations
5463: * such as picking and collision. This attribute is initialized
5464: * to 0.
5465: * This attribute is only used when the data mode for this
5466: * geometry array object is <code>BY_REFERENCE</code>
5467: * and is <i>not</i> </code>INTERLEAVED</code>.
5468: *
5469: * @param initialColorIndex the new initial color index.
5470: * @exception CapabilityNotSetException if the appropriate capability is
5471: * not set and this object is part of a live or compiled scene graph
5472: * <p>
5473: * @exception IllegalStateException if the data mode for this geometry
5474: * array object is not <code>BY_REFERENCE</code> or if the data mode
5475: * is <code>INTERLEAVED</code>.
5476: * <p>
5477: * @exception IllegalArgumentException if either of the following are
5478: * true:
5479: * <ul>
5480: * <code>initialColorIndex < 0</code> or<br>
5481: * <code>initialColorIndex + validVertexCount > vertexCount</code><br>
5482: * </ul>
5483: * <p>
5484: * @exception ArrayIndexOutOfBoundsException if
5485: * the ColorRef array is non-null and:
5486: * <ul>
5487: * <code>ColorRef.length</code> < <i>num_words</i> *
5488: * (<code>initialColorIndex + validVertexCount</code>)<br>
5489: * </ul>
5490: * where <i>num_words</i> depends on which variant of
5491: * <code>setColorRef</code> is used.
5492: *
5493: * @since Java 3D 1.2
5494: */
5495: public void setInitialColorIndex(int initialColorIndex) {
5496: if (isLiveOrCompiled())
5497: if (!this .getCapability(ALLOW_COUNT_WRITE))
5498: throw new CapabilityNotSetException(J3dI18N
5499: .getString("GeometryArray90"));
5500:
5501: if (initialColorIndex < 0)
5502: throw new IllegalArgumentException(J3dI18N
5503: .getString("GeometryArray97"));
5504: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5505: if ((format & BY_REFERENCE) == 0)
5506: throw new IllegalStateException(J3dI18N
5507: .getString("GeometryArray83"));
5508:
5509: if ((format & INTERLEAVED) != 0)
5510: throw new IllegalStateException(J3dI18N
5511: .getString("GeometryArray84"));
5512:
5513: ((GeometryArrayRetained) this .retained)
5514: .setInitialColorIndex(initialColorIndex);
5515: // NOTE: the check for initialColorIndex + validVertexCount >
5516: // vertexCount needs to be done in the retained method
5517: }
5518:
5519: /**
5520: * Gets the initial color index for this GeometryArray object.
5521: * This attribute is only used when the data mode for this
5522: * geometry array object is <code>BY_REFERENCE</code>
5523: * and is <i>not</i> </code>INTERLEAVED</code>.
5524: * @return the current initial color index for this
5525: * GeometryArray object.
5526: * @exception CapabilityNotSetException if the appropriate capability is
5527: * not set and this object is part of a live or compiled scene graph
5528: *
5529: * @since Java 3D 1.2
5530: */
5531: public int getInitialColorIndex() {
5532: if (isLiveOrCompiled())
5533: if (!this .getCapability(ALLOW_COUNT_READ))
5534: throw new CapabilityNotSetException(J3dI18N
5535: .getString("GeometryArray91"));
5536:
5537: return ((GeometryArrayRetained) this .retained)
5538: .getInitialColorIndex();
5539: }
5540:
5541: /**
5542: * Sets the initial normal index for this GeometryArray object.
5543: * This index specifies the first normal within the array of
5544: * normals referenced by this geometry
5545: * array that is actually used in rendering or other operations
5546: * such as picking and collision. This attribute is initialized
5547: * to 0.
5548: * This attribute is only used when the data mode for this
5549: * geometry array object is <code>BY_REFERENCE</code>
5550: * and is <i>not</i> </code>INTERLEAVED</code>.
5551: *
5552: * @param initialNormalIndex the new initial normal index.
5553: * @exception CapabilityNotSetException if the appropriate capability is
5554: * not set and this object is part of a live or compiled scene graph
5555: * <p>
5556: * @exception IllegalStateException if the data mode for this geometry
5557: * array object is not <code>BY_REFERENCE</code> or if the data mode
5558: * is <code>INTERLEAVED</code>.
5559: * <p>
5560: * @exception IllegalArgumentException if either of the following are
5561: * true:
5562: * <ul>
5563: * <code>initialNormalIndex < 0</code> or<br>
5564: * <code>initialNormalIndex + validVertexCount > vertexCount</code><br>
5565: * </ul>
5566: * <p>
5567: * @exception ArrayIndexOutOfBoundsException if normals
5568: * the NormalRef array is non-null and:
5569: * <ul>
5570: * <code>NormalRef.length</code> < <i>num_words</i> *
5571: * (<code>initialNormalIndex + validVertexCount</code>)<br>
5572: * </ul>
5573: * where <i>num_words</i> depends on which variant of
5574: * <code>setNormalRef</code> is used.
5575: *
5576: * @since Java 3D 1.2
5577: */
5578: public void setInitialNormalIndex(int initialNormalIndex) {
5579: if (isLiveOrCompiled())
5580: if (!this .getCapability(ALLOW_COUNT_WRITE))
5581: throw new CapabilityNotSetException(J3dI18N
5582: .getString("GeometryArray90"));
5583:
5584: if (initialNormalIndex < 0)
5585: throw new IllegalArgumentException(J3dI18N
5586: .getString("GeometryArray97"));
5587:
5588: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5589: if ((format & BY_REFERENCE) == 0)
5590: throw new IllegalStateException(J3dI18N
5591: .getString("GeometryArray83"));
5592:
5593: if ((format & INTERLEAVED) != 0)
5594: throw new IllegalStateException(J3dI18N
5595: .getString("GeometryArray84"));
5596:
5597: ((GeometryArrayRetained) this .retained)
5598: .setInitialNormalIndex(initialNormalIndex);
5599: // NOTE: the check for initialNormalIndex + validVertexCount >
5600: // vertexCount needs to be done in the retained method
5601: }
5602:
5603: /**
5604: * Gets the initial normal index for this GeometryArray object.
5605: * This attribute is only used when the data mode for this
5606: * geometry array object is <code>BY_REFERENCE</code>
5607: * and is <i>not</i> </code>INTERLEAVED</code>.
5608: * @return the current initial normal index for this
5609: * GeometryArray object.
5610: * @exception CapabilityNotSetException if the appropriate capability is
5611: * not set and this object is part of a live or compiled scene graph
5612: *
5613: * @since Java 3D 1.2
5614: */
5615: public int getInitialNormalIndex() {
5616: if (isLiveOrCompiled())
5617: if (!this .getCapability(ALLOW_COUNT_READ))
5618: throw new CapabilityNotSetException(J3dI18N
5619: .getString("GeometryArray91"));
5620:
5621: return ((GeometryArrayRetained) this .retained)
5622: .getInitialNormalIndex();
5623: }
5624:
5625: /**
5626: * Sets the initial texture coordinate index for the specified
5627: * texture coordinate set for this GeometryArray object. This
5628: * index specifies the first texture coordinate within the array
5629: * of texture coordinates referenced by this geometry array that
5630: * is actually used in rendering or other operations such as
5631: * picking and collision. This attribute is initialized to 0.
5632: * This attribute is only used when the data mode for this
5633: * geometry array object is <code>BY_REFERENCE</code>
5634: * and is <i>not</i> </code>INTERLEAVED</code>.
5635: *
5636: * @param texCoordSet texture coordinate set in this geometry array
5637: * @param initialTexCoordIndex the new initial texture coordinate index.
5638: *
5639: * @exception CapabilityNotSetException if the appropriate capability is
5640: * not set and this object is part of a live or compiled scene graph
5641: * <p>
5642: * @exception IllegalStateException if the data mode for this geometry
5643: * array object is not <code>BY_REFERENCE</code> or if the data mode
5644: * is <code>INTERLEAVED</code>.
5645: * <p>
5646: * @exception IllegalArgumentException if either of the following are
5647: * true:
5648: * <ul>
5649: * <code>initialTexCoordIndex < 0</code> or<br>
5650: * <code>initialTexCoordIndex + validVertexCount > vertexCount</code><br>
5651: * </ul>
5652: * <p>
5653: * @exception ArrayIndexOutOfBoundsException if
5654: * the TexCoordRef array is non-null and:
5655: * <ul>
5656: * <code>TexCoordRef.length</code> < <i>num_words</i> *
5657: * (<code>initialTexCoordIndex + validVertexCount</code>)<br>
5658: * </ul>
5659: * where <i>num_words</i> depends on which variant of
5660: * <code>setTexCoordRef</code> is used.
5661: * <p>
5662: * @exception ArrayIndexOutOfBoundsException if none of the
5663: * <code>TEXTURE_COORDINATE</code> bits are set in the
5664: * <code>vertexFormat</code> or if texCoordSet is out of range.
5665: *
5666: * @since Java 3D 1.2
5667: */
5668: public void setInitialTexCoordIndex(int texCoordSet,
5669: int initialTexCoordIndex) {
5670: if (isLiveOrCompiled())
5671: if (!this .getCapability(ALLOW_COUNT_WRITE))
5672: throw new CapabilityNotSetException(J3dI18N
5673: .getString("GeometryArray90"));
5674:
5675: if (initialTexCoordIndex < 0)
5676: throw new IllegalArgumentException(J3dI18N
5677: .getString("GeometryArray97"));
5678:
5679: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5680: if ((format & BY_REFERENCE) == 0)
5681: throw new IllegalStateException(J3dI18N
5682: .getString("GeometryArray83"));
5683:
5684: if ((format & INTERLEAVED) != 0)
5685: throw new IllegalStateException(J3dI18N
5686: .getString("GeometryArray84"));
5687:
5688: ((GeometryArrayRetained) this .retained)
5689: .setInitialTexCoordIndex(texCoordSet,
5690: initialTexCoordIndex);
5691:
5692: // NOTE: the check for initialTexCoordIndex + validVertexCount >
5693: // vertexCount needs to be done in the retained method
5694: }
5695:
5696: /**
5697: * Gets the initial texture coordinate index for the specified
5698: * texture coordinate set for this GeometryArray object.
5699: * This attribute is only used when the data mode for this
5700: * geometry array object is <code>BY_REFERENCE</code>
5701: * and is <i>not</i> </code>INTERLEAVED</code>.
5702: *
5703: * @param texCoordSet texture coordinate set in this geometry array
5704: *
5705: * @return the current initial texture coordinate index for the specified
5706: * texture coordinate set
5707: *
5708: * @exception ArrayIndexOutOfBoundsException if none of the
5709: * <code>TEXTURE_COORDINATE</code> bits are set in the
5710: * <code>vertexFormat</code> or if texCoordSet is out of range.
5711: *
5712: * @exception CapabilityNotSetException if the appropriate capability is
5713: * not set and this object is part of a live or compiled scene graph
5714: *
5715: * @since Java 3D 1.2
5716: */
5717: public int getInitialTexCoordIndex(int texCoordSet) {
5718: if (isLiveOrCompiled())
5719: if (!this .getCapability(ALLOW_COUNT_READ))
5720: throw new CapabilityNotSetException(J3dI18N
5721: .getString("GeometryArray91"));
5722:
5723: return ((GeometryArrayRetained) this .retained)
5724: .getInitialTexCoordIndex(texCoordSet);
5725: }
5726:
5727: /**
5728: * Sets the initial vertex attribute index for the specified
5729: * vertex attribute number for this GeometryArray object. This
5730: * index specifies the first vertex attribute within the array
5731: * of vertex attributes referenced by this geometry array that
5732: * is actually used in rendering or other operations such as
5733: * picking and collision. This attribute is initialized to 0.
5734: * This attribute is only used when the data mode for this
5735: * geometry array object is <code>BY_REFERENCE</code>
5736: * and is <i>not</i> </code>INTERLEAVED</code>.
5737: *
5738: * @param vertexAttrNum vertex attribute number in this geometry array
5739: * @param initialVertexAttrIndex the new initial vertex attribute index.
5740: *
5741: * @exception CapabilityNotSetException if the appropriate capability is
5742: * not set and this object is part of a live or compiled scene graph
5743: * <p>
5744: * @exception IllegalStateException if the data mode for this geometry
5745: * array object is not <code>BY_REFERENCE</code> or if the data mode
5746: * is <code>INTERLEAVED</code>.
5747: * <p>
5748: * @exception IllegalArgumentException if either of the following are
5749: * true:
5750: * <ul>
5751: * <code>initialVertexAttrIndex < 0</code> or<br>
5752: * <code>initialVertexAttrIndex + validVertexCount > vertexCount</code><br>
5753: * </ul>
5754: * <p>
5755: * @exception ArrayIndexOutOfBoundsException if
5756: * the VertexAttrRef array is non-null and:
5757: * <ul>
5758: * <code>VertexAttrRef.length</code> < <i>num_words</i> *
5759: * (<code>initialVertexAttrIndex + validVertexCount</code>)<br>
5760: * </ul>
5761: * where <i>num_words</i> is the size of the specified
5762: * vertexAttrNum (1, 2, 3, or 4).
5763: * <p>
5764: * @exception ArrayIndexOutOfBoundsException if vertexAttrNum is
5765: * out of range.
5766: *
5767: * @since Java 3D 1.4
5768: */
5769: public void setInitialVertexAttrIndex(int vertexAttrNum,
5770: int initialVertexAttrIndex) {
5771: if (isLiveOrCompiled()) {
5772: if (!this .getCapability(ALLOW_COUNT_WRITE)) {
5773: throw new CapabilityNotSetException(J3dI18N
5774: .getString("GeometryArray90"));
5775: }
5776: }
5777:
5778: if (initialVertexAttrIndex < 0) {
5779: throw new IllegalArgumentException(J3dI18N
5780: .getString("GeometryArray97"));
5781: }
5782:
5783: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5784: if ((format & BY_REFERENCE) == 0) {
5785: throw new IllegalStateException(J3dI18N
5786: .getString("GeometryArray83"));
5787: }
5788:
5789: if ((format & INTERLEAVED) != 0) {
5790: throw new IllegalStateException(J3dI18N
5791: .getString("GeometryArray84"));
5792: }
5793:
5794: ((GeometryArrayRetained) this .retained)
5795: .setInitialVertexAttrIndex(vertexAttrNum,
5796: initialVertexAttrIndex);
5797:
5798: // NOTE: the check for initialVertexAttrIndex + validVertexCount >
5799: // vertexCount needs to be done in the retained method
5800: }
5801:
5802: /**
5803: * Gets the initial vertex attribute index for the specified
5804: * vertex attribute number for this GeometryArray object.
5805: * This attribute is only used when the data mode for this
5806: * geometry array object is <code>BY_REFERENCE</code>
5807: * and is <i>not</i> </code>INTERLEAVED</code>.
5808: *
5809: * @param vertexAttrNum vertex attribute number in this geometry array
5810: *
5811: * @return the current initial vertex attribute index for the specified
5812: * vertex attribute number
5813: *
5814: * @exception ArrayIndexOutOfBoundsException if vertexAttrNum is
5815: * out of range.
5816: *
5817: * @exception CapabilityNotSetException if the appropriate capability is
5818: * not set and this object is part of a live or compiled scene graph
5819: *
5820: * @since Java 3D 1.4
5821: */
5822: public int getInitialVertexAttrIndex(int vertexAttrNum) {
5823: if (isLiveOrCompiled()) {
5824: if (!this .getCapability(ALLOW_COUNT_READ)) {
5825: throw new CapabilityNotSetException(J3dI18N
5826: .getString("GeometryArray91"));
5827: }
5828: }
5829:
5830: return ((GeometryArrayRetained) this .retained)
5831: .getInitialVertexAttrIndex(vertexAttrNum);
5832: }
5833:
5834: /**
5835: * Sets the coordinate buffer reference to the specified
5836: * buffer object. The buffer contains either a java.nio.FloatBuffer
5837: * or java.nio.DoubleBuffer object containing single or double
5838: * precision floating-point <i>x</i>, <i>y</i>,
5839: * and <i>z</i> values for each vertex (for a total of 3*<i>n</i>
5840: * values, where <i>n</i> is the number of vertices).
5841: * If the coordinate buffer
5842: * reference is null, the entire geometry array object is
5843: * treated as if it were null--any Shape3D or Morph node that uses
5844: * this geometry array will not be drawn.
5845: *
5846: * @param coords a J3DBuffer object to which a reference will be set.
5847: * The buffer contains an NIO buffer of 3*<i>n</i> float or
5848: * double values.
5849: *
5850: * @exception CapabilityNotSetException if the appropriate capability is
5851: * not set and this object is part of a live or compiled scene graph
5852: *
5853: * @exception IllegalStateException if the data mode for this geometry
5854: * array object is not <code>BY_REFERENCE</code>,
5855: * is not <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
5856: *
5857: * @exception IllegalArgumentException if the java.nio.Buffer
5858: * contained in the specified J3DBuffer is not a
5859: * java.nio.FloatBuffer or a java.nio.DoubleBuffer object.
5860: *
5861: * @exception ArrayIndexOutOfBoundsException if
5862: * <code>coords.getBuffer().limit() <
5863: * 3 * (initialCoordIndex + validVertexCount)</code>.
5864: *
5865: * @exception ArrayIndexOutOfBoundsException if this GeometryArray
5866: * object is a subclass of IndexedGeometryArray, and any element
5867: * in the range
5868: * <code>[initialIndexIndex, initialIndexIndex+validIndexCount-1]</code>
5869: * in the coordinate index array is greater than or equal to the
5870: * number of vertices defined by the coords object,
5871: * <code>coords.getBuffer().limit() / 3</code>.
5872: *
5873: * @since Java 3D 1.3
5874: */
5875: public void setCoordRefBuffer(J3DBuffer coords) {
5876: if (isLiveOrCompiled())
5877: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
5878: throw new CapabilityNotSetException(J3dI18N
5879: .getString("GeometryArray86"));
5880:
5881: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5882:
5883: if ((format & USE_NIO_BUFFER) == 0)
5884: throw new IllegalStateException(J3dI18N
5885: .getString("GeometryArray118"));
5886:
5887: if ((format & INTERLEAVED) != 0)
5888: throw new IllegalStateException(J3dI18N
5889: .getString("GeometryArray84"));
5890:
5891: ((GeometryArrayRetained) this .retained)
5892: .setCoordRefBuffer(coords);
5893: }
5894:
5895: /**
5896: * Gets the coordinate array buffer reference.
5897: * @return the current coordinate array buffer reference.
5898: * @exception CapabilityNotSetException if the appropriate capability is
5899: * not set and this object is part of a live or compiled scene graph
5900: * @exception IllegalStateException if the data mode for this geometry
5901: * array object is not <code>BY_REFERENCE</code>,
5902: * is not <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
5903: *
5904: * @since Java 3D 1.3
5905: */
5906: public J3DBuffer getCoordRefBuffer() {
5907: if (isLiveOrCompiled())
5908: if (!this .getCapability(ALLOW_REF_DATA_READ)
5909: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
5910: throw new CapabilityNotSetException(J3dI18N
5911: .getString("GeometryArray87"));
5912: }
5913:
5914: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5915: if ((format & USE_NIO_BUFFER) == 0)
5916: throw new IllegalStateException(J3dI18N
5917: .getString("GeometryArray118"));
5918:
5919: if ((format & INTERLEAVED) != 0)
5920: throw new IllegalStateException(J3dI18N
5921: .getString("GeometryArray84"));
5922:
5923: return ((GeometryArrayRetained) this .retained)
5924: .getCoordRefBuffer();
5925: }
5926:
5927: /**
5928: * Sets the float coordinate array reference to the specified
5929: * array. The array contains floating-point <i>x</i>, <i>y</i>,
5930: * and <i>z</i> values for each vertex (for a total of 3*<i>n</i>
5931: * values, where <i>n</i> is the number of vertices). Only one of
5932: * <code>coordRefFloat</code>, <code>coordRefDouble</code>,
5933: * <code>coordRef3f</code>, or <code>coordRef3d</code> may be
5934: * non-null (or they may all be null). An attempt to set more
5935: * than one of these attributes to a non-null reference will
5936: * result in an exception being thrown. If all coordinate array
5937: * references are null, the entire geometry array object is
5938: * treated as if it were null--any Shape3D or Morph node that uses
5939: * this geometry array will not be drawn.
5940: *
5941: * @param coords an array of 3*<i>n</i> values to which a
5942: * reference will be set.
5943: * @exception CapabilityNotSetException if the appropriate capability is
5944: * not set and this object is part of a live or compiled scene graph
5945: * @exception IllegalStateException if the data mode for this geometry
5946: * array object is not <code>BY_REFERENCE</code>,
5947: * is <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
5948: * @exception IllegalArgumentException if the specified array is
5949: * non-null and any other coordinate reference is also non-null.
5950: * @exception ArrayIndexOutOfBoundsException if
5951: * <code>coords.length < 3 * (initialCoordIndex + validVertexCount)</code>.
5952: *
5953: * @exception ArrayIndexOutOfBoundsException if this GeometryArray
5954: * object is a subclass of IndexedGeometryArray, and any element
5955: * in the range
5956: * <code>[initialIndexIndex, initialIndexIndex+validIndexCount-1]</code>
5957: * in the coordinate index array is greater than or equal to the
5958: * number of vertices defined by the coords array,
5959: * <code>coords.length / 3</code>.
5960: *
5961: * @since Java 3D 1.2
5962: */
5963: public void setCoordRefFloat(float[] coords) {
5964: if (isLiveOrCompiled())
5965: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
5966: throw new CapabilityNotSetException(J3dI18N
5967: .getString("GeometryArray86"));
5968:
5969: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
5970: if ((format & BY_REFERENCE) == 0)
5971: throw new IllegalStateException(J3dI18N
5972: .getString("GeometryArray83"));
5973:
5974: if ((format & USE_NIO_BUFFER) != 0)
5975: throw new IllegalStateException(J3dI18N
5976: .getString("GeometryArray119"));
5977:
5978: if ((format & INTERLEAVED) != 0)
5979: throw new IllegalStateException(J3dI18N
5980: .getString("GeometryArray84"));
5981:
5982: ((GeometryArrayRetained) this .retained)
5983: .setCoordRefFloat(coords);
5984:
5985: }
5986:
5987: /**
5988: * Gets the float coordinate array reference.
5989: * @return the current float coordinate array reference.
5990: * @exception CapabilityNotSetException if the appropriate capability is
5991: * not set and this object is part of a live or compiled scene graph
5992: * @exception IllegalStateException if the data mode for this geometry
5993: * array object is not <code>BY_REFERENCE</code>,
5994: * is <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
5995: *
5996: * @since Java 3D 1.2
5997: */
5998: public float[] getCoordRefFloat() {
5999: if (isLiveOrCompiled())
6000: if (!this .getCapability(ALLOW_REF_DATA_READ)
6001: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
6002: throw new CapabilityNotSetException(J3dI18N
6003: .getString("GeometryArray87"));
6004: }
6005:
6006: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6007: if ((format & BY_REFERENCE) == 0)
6008: throw new IllegalStateException(J3dI18N
6009: .getString("GeometryArray83"));
6010:
6011: if ((format & USE_NIO_BUFFER) != 0)
6012: throw new IllegalStateException(J3dI18N
6013: .getString("GeometryArray119"));
6014:
6015: if ((format & INTERLEAVED) != 0)
6016: throw new IllegalStateException(J3dI18N
6017: .getString("GeometryArray84"));
6018:
6019: return ((GeometryArrayRetained) this .retained)
6020: .getCoordRefFloat();
6021: }
6022:
6023: /**
6024: * Sets the double coordinate array reference to the specified
6025: * array. The array contains double-precision
6026: * floating-point <i>x</i>, <i>y</i>,
6027: * and <i>z</i> values for each vertex (for a total of 3*<i>n</i>
6028: * values, where <i>n</i> is the number of vertices). Only one of
6029: * <code>coordRefFloat</code>, <code>coordRefDouble</code>,
6030: * <code>coordRef3f</code>, or <code>coordRef3d</code> may be
6031: * non-null (or they may all be null). An attempt to set more
6032: * than one of these attributes to a non-null reference will
6033: * result in an exception being thrown. If all coordinate array
6034: * references are null, the entire geometry array object is
6035: * treated as if it were null--any Shape3D or Morph node that uses
6036: * this geometry array will not be drawn.
6037: *
6038: * @param coords an array of 3*<i>n</i> values to which a
6039: * reference will be set.
6040: * @exception CapabilityNotSetException if the appropriate capability is
6041: * not set and this object is part of a live or compiled scene graph
6042: * @exception IllegalStateException if the data mode for this geometry
6043: * array object is not <code>BY_REFERENCE</code>,
6044: * is <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
6045: * @exception IllegalArgumentException if the specified array is
6046: * non-null and any other coordinate reference is also non-null.
6047: * @exception ArrayIndexOutOfBoundsException if
6048: * <code>coords.length < 3 * (initialCoordIndex + validVertexCount)</code>.
6049: *
6050: * @exception ArrayIndexOutOfBoundsException if this GeometryArray
6051: * object is a subclass of IndexedGeometryArray, and any element
6052: * in the range
6053: * <code>[initialIndexIndex, initialIndexIndex+validIndexCount-1]</code>
6054: * in the coordinate index array is greater than or equal to the
6055: * number of vertices defined by the coords array,
6056: * <code>coords.length / 3</code>.
6057: *
6058: * @since Java 3D 1.2
6059: */
6060: public void setCoordRefDouble(double[] coords) {
6061: if (isLiveOrCompiled())
6062: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
6063: throw new CapabilityNotSetException(J3dI18N
6064: .getString("GeometryArray86"));
6065:
6066: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6067: if ((format & BY_REFERENCE) == 0)
6068: throw new IllegalStateException(J3dI18N
6069: .getString("GeometryArray83"));
6070:
6071: if ((format & USE_NIO_BUFFER) != 0)
6072: throw new IllegalStateException(J3dI18N
6073: .getString("GeometryArray119"));
6074:
6075: if ((format & INTERLEAVED) != 0)
6076: throw new IllegalStateException(J3dI18N
6077: .getString("GeometryArray84"));
6078:
6079: ((GeometryArrayRetained) this .retained)
6080: .setCoordRefDouble(coords);
6081:
6082: }
6083:
6084: /**
6085: * Gets the double coordinate array reference.
6086: * @return the current double coordinate array reference.
6087: * @exception CapabilityNotSetException if the appropriate capability is
6088: * not set and this object is part of a live or compiled scene graph
6089: * @exception IllegalStateException if the data mode for this geometry
6090: * array object is not <code>BY_REFERENCE</code>,
6091: * is <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
6092: *
6093: * @since Java 3D 1.2
6094: */
6095: public double[] getCoordRefDouble() {
6096: if (isLiveOrCompiled())
6097: if (!this .getCapability(ALLOW_REF_DATA_READ)
6098: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
6099: throw new CapabilityNotSetException(J3dI18N
6100: .getString("GeometryArray87"));
6101: }
6102:
6103: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6104: if ((format & BY_REFERENCE) == 0)
6105: throw new IllegalStateException(J3dI18N
6106: .getString("GeometryArray83"));
6107:
6108: if ((format & USE_NIO_BUFFER) != 0)
6109: throw new IllegalStateException(J3dI18N
6110: .getString("GeometryArray119"));
6111:
6112: if ((format & INTERLEAVED) != 0)
6113: throw new IllegalStateException(J3dI18N
6114: .getString("GeometryArray84"));
6115:
6116: return ((GeometryArrayRetained) this .retained)
6117: .getCoordRefDouble();
6118: }
6119:
6120: /**
6121: * @deprecated As of Java 3D version 1.3, use geometry by-copy
6122: * for Point3f arrays
6123: *
6124: * @since Java 3D 1.2
6125: */
6126: public void setCoordRef3f(Point3f[] coords) {
6127: if (isLiveOrCompiled())
6128: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
6129: throw new CapabilityNotSetException(J3dI18N
6130: .getString("GeometryArray86"));
6131:
6132: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6133: if ((format & BY_REFERENCE) == 0)
6134: throw new IllegalStateException(J3dI18N
6135: .getString("GeometryArray83"));
6136:
6137: if ((format & USE_NIO_BUFFER) != 0)
6138: throw new IllegalStateException(J3dI18N
6139: .getString("GeometryArray119"));
6140:
6141: if ((format & INTERLEAVED) != 0)
6142: throw new IllegalStateException(J3dI18N
6143: .getString("GeometryArray84"));
6144:
6145: ((GeometryArrayRetained) this .retained).setCoordRef3f(coords);
6146:
6147: }
6148:
6149: /**
6150: * @deprecated As of Java 3D version 1.3, use geometry by-copy
6151: * for Point3f arrays
6152: *
6153: * @since Java 3D 1.2
6154: */
6155: public Point3f[] getCoordRef3f() {
6156: if (isLiveOrCompiled())
6157: if (!this .getCapability(ALLOW_REF_DATA_READ)
6158: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
6159: throw new CapabilityNotSetException(J3dI18N
6160: .getString("GeometryArray87"));
6161: }
6162:
6163: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6164: if ((format & BY_REFERENCE) == 0)
6165: throw new IllegalStateException(J3dI18N
6166: .getString("GeometryArray83"));
6167:
6168: if ((format & USE_NIO_BUFFER) != 0)
6169: throw new IllegalStateException(J3dI18N
6170: .getString("GeometryArray119"));
6171:
6172: if ((format & INTERLEAVED) != 0)
6173: throw new IllegalStateException(J3dI18N
6174: .getString("GeometryArray84"));
6175:
6176: return ((GeometryArrayRetained) this .retained).getCoordRef3f();
6177: }
6178:
6179: /**
6180: * @deprecated As of Java 3D version 1.3, use geometry by-copy
6181: * for Point3d arrays
6182: *
6183: * @since Java 3D 1.2
6184: */
6185: public void setCoordRef3d(Point3d[] coords) {
6186: if (isLiveOrCompiled())
6187: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
6188: throw new CapabilityNotSetException(J3dI18N
6189: .getString("GeometryArray86"));
6190:
6191: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6192: if ((format & BY_REFERENCE) == 0)
6193: throw new IllegalStateException(J3dI18N
6194: .getString("GeometryArray83"));
6195:
6196: if ((format & USE_NIO_BUFFER) != 0)
6197: throw new IllegalStateException(J3dI18N
6198: .getString("GeometryArray119"));
6199:
6200: if ((format & INTERLEAVED) != 0)
6201: throw new IllegalStateException(J3dI18N
6202: .getString("GeometryArray84"));
6203:
6204: ((GeometryArrayRetained) this .retained).setCoordRef3d(coords);
6205:
6206: }
6207:
6208: /**
6209: * @deprecated As of Java 3D version 1.3, use geometry by-copy
6210: * for Point3d arrays
6211: *
6212: * @since Java 3D 1.2
6213: */
6214: public Point3d[] getCoordRef3d() {
6215: if (isLiveOrCompiled())
6216: if (!this .getCapability(ALLOW_REF_DATA_READ)
6217: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
6218: throw new CapabilityNotSetException(J3dI18N
6219: .getString("GeometryArray87"));
6220: }
6221:
6222: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6223: if ((format & BY_REFERENCE) == 0)
6224: throw new IllegalStateException(J3dI18N
6225: .getString("GeometryArray83"));
6226:
6227: if ((format & USE_NIO_BUFFER) != 0)
6228: throw new IllegalStateException(J3dI18N
6229: .getString("GeometryArray119"));
6230:
6231: if ((format & INTERLEAVED) != 0)
6232: throw new IllegalStateException(J3dI18N
6233: .getString("GeometryArray84"));
6234:
6235: return ((GeometryArrayRetained) this .retained).getCoordRef3d();
6236: }
6237:
6238: /**
6239: * Sets the color buffer reference to the specified
6240: * buffer object. The buffer contains either a java.nio.FloatBuffer
6241: * or java.nio.ByteBuffer object containing floating-point
6242: * or byte <i>red</i>, <i>green</i>,
6243: * <i>blue</i>, and, optionally, <i>alpha</i> values for each
6244: * vertex (for a total of 3*<i>n</i> or 4*<i>n</i> values, where
6245: * <i>n</i> is the number of vertices).
6246: * If the color buffer reference is null and colors are enabled
6247: * (that is, the vertexFormat includes either <code>COLOR_3</code> or
6248: * <code>COLOR_4</code>), the entire geometry array object is
6249: * treated as if it were null--any Shape3D or Morph node that uses
6250: * this geometry array will not be drawn.
6251: *
6252: * @param colors a J3DBuffer object to which a reference will be set.
6253: * The buffer contains an NIO buffer of 3*<i>n</i> or 4*<i>n</i>
6254: * float or byte values.
6255: *
6256: * @exception CapabilityNotSetException if the appropriate capability is
6257: * not set and this object is part of a live or compiled scene graph
6258: *
6259: * @exception IllegalStateException if the data mode for this geometry
6260: * array object is not <code>BY_REFERENCE</code>,
6261: * is not <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
6262: *
6263: * @exception IllegalArgumentException if the java.nio.Buffer
6264: * contained in the specified J3DBuffer is not a
6265: * java.nio.FloatBuffer or a java.nio.ByteBuffer object.
6266: *
6267: * @exception ArrayIndexOutOfBoundsException if none of the
6268: * <code>COLOR</code> bits are set in the
6269: * <code>vertexFormat</code>, or if
6270: * <code>colors.getBuffer().limit() < </code> <i>num_words</i> <code> *
6271: * (initialColorIndex + validVertexCount)</code>,
6272: * where <i>num_words</i> is 3 or 4 depending on the vertex color format.
6273: *
6274: * @exception ArrayIndexOutOfBoundsException if this GeometryArray
6275: * object is a subclass of IndexedGeometryArray, and any element
6276: * in the range
6277: * <code>[initialIndexIndex, initialIndexIndex+validIndexCount-1]</code>
6278: * in the color index array is greater than or equal to the
6279: * number of vertices defined by the colors object,
6280: * <code>colors.getBuffer().limit() / </code> <i>num_words</i>.
6281: *
6282: * @since Java 3D 1.3
6283: */
6284: public void setColorRefBuffer(J3DBuffer colors) {
6285: if (isLiveOrCompiled())
6286: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
6287: throw new CapabilityNotSetException(J3dI18N
6288: .getString("GeometryArray86"));
6289:
6290: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6291:
6292: if ((format & USE_NIO_BUFFER) == 0)
6293: throw new IllegalStateException(J3dI18N
6294: .getString("GeometryArray118"));
6295:
6296: if ((format & INTERLEAVED) != 0)
6297: throw new IllegalStateException(J3dI18N
6298: .getString("GeometryArray84"));
6299:
6300: ((GeometryArrayRetained) this .retained)
6301: .setColorRefBuffer(colors);
6302:
6303: }
6304:
6305: /**
6306: * Gets the color array buffer reference.
6307: * @return the current color array buffer reference.
6308: * @exception CapabilityNotSetException if the appropriate capability is
6309: * not set and this object is part of a live or compiled scene graph
6310: * @exception IllegalStateException if the data mode for this geometry
6311: * array object is not <code>BY_REFERENCE</code>,
6312: * is not <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
6313: *
6314: * @since Java 3D 1.3
6315: */
6316: public J3DBuffer getColorRefBuffer() {
6317: if (isLiveOrCompiled())
6318: if (!this .getCapability(ALLOW_REF_DATA_READ)
6319: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
6320: throw new CapabilityNotSetException(J3dI18N
6321: .getString("GeometryArray87"));
6322: }
6323:
6324: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6325:
6326: if ((format & USE_NIO_BUFFER) == 0)
6327: throw new IllegalStateException(J3dI18N
6328: .getString("GeometryArray118"));
6329:
6330: if ((format & INTERLEAVED) != 0)
6331: throw new IllegalStateException(J3dI18N
6332: .getString("GeometryArray84"));
6333:
6334: return ((GeometryArrayRetained) this .retained)
6335: .getColorRefBuffer();
6336: }
6337:
6338: /**
6339: * Sets the float color array reference to the specified array.
6340: * The array contains floating-point <i>red</i>, <i>green</i>,
6341: * <i>blue</i>, and, optionally, <i>alpha</i> values for each
6342: * vertex (for a total of 3*<i>n</i> or 4*<i>n</i> values, where
6343: * <i>n</i> is the number of vertices). Only one of
6344: * <code>colorRefFloat</code>, <code>colorRefByte</code>,
6345: * <code>colorRef3f</code>, <code>colorRef4f</code>,
6346: * <code>colorRef3b</code>, or <code>colorRef4b</code> may be
6347: * non-null (or they may all be null). An attempt to set more
6348: * than one of these attributes to a non-null reference will
6349: * result in an exception being thrown. If all color array
6350: * references are null and colors are enabled (that is, the
6351: * vertexFormat includes either <code>COLOR_3</code> or
6352: * <code>COLOR_4</code>), the entire geometry array object is
6353: * treated as if it were null--any Shape3D or Morph node that uses
6354: * this geometry array will not be drawn.
6355: *
6356: * @param colors an array of 3*<i>n</i> or 4*<i>n</i> values to which a
6357: * reference will be set.
6358: * @exception CapabilityNotSetException if the appropriate capability is
6359: * not set and this object is part of a live or compiled scene graph
6360: * @exception IllegalStateException if the data mode for this geometry
6361: * array object is not <code>BY_REFERENCE</code>,
6362: * is <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
6363: * @exception IllegalArgumentException if the specified array is
6364: * non-null and any other color reference is also non-null.
6365: *
6366: * @exception ArrayIndexOutOfBoundsException if none of the
6367: * <code>COLOR</code> bits are set in the
6368: * <code>vertexFormat</code>, or if
6369: * <code>colors.length < </code> <i>num_words</i> <code> *
6370: * (initialColorIndex + validVertexCount)</code>,
6371: * where <i>num_words</i> is 3 or 4 depending on the vertex color format.
6372: *
6373: * @exception ArrayIndexOutOfBoundsException if this GeometryArray
6374: * object is a subclass of IndexedGeometryArray, and any element
6375: * in the range
6376: * <code>[initialIndexIndex, initialIndexIndex+validIndexCount-1]</code>
6377: * in the color index array is greater than or equal to the
6378: * number of vertices defined by the colors array,
6379: * <code>colors.length / </code> <i>num_words</i>.
6380: *
6381: * @since Java 3D 1.2
6382: */
6383: public void setColorRefFloat(float[] colors) {
6384: if (isLiveOrCompiled())
6385: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
6386: throw new CapabilityNotSetException(J3dI18N
6387: .getString("GeometryArray86"));
6388:
6389: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6390: if ((format & BY_REFERENCE) == 0)
6391: throw new IllegalStateException(J3dI18N
6392: .getString("GeometryArray83"));
6393:
6394: if ((format & USE_NIO_BUFFER) != 0)
6395: throw new IllegalStateException(J3dI18N
6396: .getString("GeometryArray119"));
6397:
6398: if ((format & INTERLEAVED) != 0)
6399: throw new IllegalStateException(J3dI18N
6400: .getString("GeometryArray84"));
6401:
6402: ((GeometryArrayRetained) this .retained)
6403: .setColorRefFloat(colors);
6404:
6405: }
6406:
6407: /**
6408: * Gets the float color array reference.
6409: * @return the current float color array reference.
6410: * @exception CapabilityNotSetException if the appropriate capability is
6411: * not set and this object is part of a live or compiled scene graph
6412: * @exception IllegalStateException if the data mode for this geometry
6413: * array object is not <code>BY_REFERENCE</code>,
6414: * is <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
6415: *
6416: * @since Java 3D 1.2
6417: */
6418: public float[] getColorRefFloat() {
6419: if (isLiveOrCompiled())
6420: if (!this .getCapability(ALLOW_REF_DATA_READ)
6421: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
6422: throw new CapabilityNotSetException(J3dI18N
6423: .getString("GeometryArray87"));
6424: }
6425:
6426: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6427: if ((format & BY_REFERENCE) == 0)
6428: throw new IllegalStateException(J3dI18N
6429: .getString("GeometryArray83"));
6430:
6431: if ((format & USE_NIO_BUFFER) != 0)
6432: throw new IllegalStateException(J3dI18N
6433: .getString("GeometryArray119"));
6434:
6435: if ((format & INTERLEAVED) != 0)
6436: throw new IllegalStateException(J3dI18N
6437: .getString("GeometryArray84"));
6438:
6439: return ((GeometryArrayRetained) this .retained)
6440: .getColorRefFloat();
6441: }
6442:
6443: /**
6444: * Sets the byte color array reference to the specified array.
6445: * The array contains <i>red</i>, <i>green</i>,
6446: * <i>blue</i>, and, optionally, <i>alpha</i> values for each
6447: * vertex (for a total of 3*<i>n</i> or 4*<i>n</i> values, where
6448: * <i>n</i> is the number of vertices). Only one of
6449: * <code>colorRefFloat</code>, <code>colorRefByte</code>,
6450: * <code>colorRef3f</code>, <code>colorRef4f</code>,
6451: * <code>colorRef3b</code>, or <code>colorRef4b</code> may be
6452: * non-null (or they may all be null). An attempt to set more
6453: * than one of these attributes to a non-null reference will
6454: * result in an exception being thrown. If all color array
6455: * references are null and colors are enabled (that is, the
6456: * vertexFormat includes either <code>COLOR_3</code> or
6457: * <code>COLOR_4</code>), the entire geometry array object is
6458: * treated as if it were null--any Shape3D or Morph node that uses
6459: * this geometry array will not be drawn.
6460: *
6461: * @param colors an array of 3*<i>n</i> or 4*<i>n</i> values to which a
6462: * reference will be set.
6463: * @exception CapabilityNotSetException if the appropriate capability is
6464: * not set and this object is part of a live or compiled scene graph
6465: * @exception IllegalStateException if the data mode for this geometry
6466: * array object is not <code>BY_REFERENCE</code>,
6467: * is <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
6468: * @exception IllegalArgumentException if the specified array is
6469: * non-null and any other color reference is also non-null.
6470: *
6471: * @exception ArrayIndexOutOfBoundsException if none of the
6472: * <code>COLOR</code> bits are set in the
6473: * <code>vertexFormat</code>, or if
6474: * <code>colors.length < </code> <i>num_words</i> <code> *
6475: * (initialColorIndex + validVertexCount)</code>,
6476: * where <i>num_words</i> is 3 or 4 depending on the vertex color format.
6477: *
6478: * @exception ArrayIndexOutOfBoundsException if this GeometryArray
6479: * object is a subclass of IndexedGeometryArray, and any element
6480: * in the range
6481: * <code>[initialIndexIndex, initialIndexIndex+validIndexCount-1]</code>
6482: * in the color index array is greater than or equal to the
6483: * number of vertices defined by the colors array,
6484: * <code>colors.length / </code> <i>num_words</i>.
6485: *
6486: * @since Java 3D 1.2
6487: */
6488: public void setColorRefByte(byte[] colors) {
6489: if (isLiveOrCompiled())
6490: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
6491: throw new CapabilityNotSetException(J3dI18N
6492: .getString("GeometryArray86"));
6493:
6494: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6495: if ((format & BY_REFERENCE) == 0)
6496: throw new IllegalStateException(J3dI18N
6497: .getString("GeometryArray83"));
6498:
6499: if ((format & USE_NIO_BUFFER) != 0)
6500: throw new IllegalStateException(J3dI18N
6501: .getString("GeometryArray119"));
6502:
6503: if ((format & INTERLEAVED) != 0)
6504: throw new IllegalStateException(J3dI18N
6505: .getString("GeometryArray84"));
6506:
6507: ((GeometryArrayRetained) this .retained).setColorRefByte(colors);
6508:
6509: // NOTE: the checks for multiple non-null references, and the
6510: // array length check need to be done in the retained method
6511: }
6512:
6513: /**
6514: * Gets the byte color array reference.
6515: * @return the current byte color array reference.
6516: * @exception CapabilityNotSetException if the appropriate capability is
6517: * not set and this object is part of a live or compiled scene graph
6518: * @exception IllegalStateException if the data mode for this geometry
6519: * array object is not <code>BY_REFERENCE</code>,
6520: * is <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
6521: *
6522: * @since Java 3D 1.2
6523: */
6524: public byte[] getColorRefByte() {
6525: if (isLiveOrCompiled())
6526: if (!this .getCapability(ALLOW_REF_DATA_READ)
6527: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
6528: throw new CapabilityNotSetException(J3dI18N
6529: .getString("GeometryArray87"));
6530: }
6531:
6532: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6533: if ((format & BY_REFERENCE) == 0)
6534: throw new IllegalStateException(J3dI18N
6535: .getString("GeometryArray83"));
6536:
6537: if ((format & USE_NIO_BUFFER) != 0)
6538: throw new IllegalStateException(J3dI18N
6539: .getString("GeometryArray119"));
6540:
6541: if ((format & INTERLEAVED) != 0)
6542: throw new IllegalStateException(J3dI18N
6543: .getString("GeometryArray84"));
6544:
6545: return ((GeometryArrayRetained) this .retained)
6546: .getColorRefByte();
6547: }
6548:
6549: /**
6550: * @deprecated As of Java 3D version 1.3, use geometry by-copy
6551: * for Color3f arrays
6552: *
6553: * @since Java 3D 1.2
6554: */
6555: public void setColorRef3f(Color3f[] colors) {
6556: if (isLiveOrCompiled())
6557: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
6558: throw new CapabilityNotSetException(J3dI18N
6559: .getString("GeometryArray86"));
6560:
6561: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6562: if ((format & BY_REFERENCE) == 0)
6563: throw new IllegalStateException(J3dI18N
6564: .getString("GeometryArray83"));
6565:
6566: if ((format & USE_NIO_BUFFER) != 0)
6567: throw new IllegalStateException(J3dI18N
6568: .getString("GeometryArray119"));
6569:
6570: if ((format & INTERLEAVED) != 0)
6571: throw new IllegalStateException(J3dI18N
6572: .getString("GeometryArray84"));
6573:
6574: if ((format & WITH_ALPHA) != 0)
6575: throw new IllegalStateException(J3dI18N
6576: .getString("GeometryArray92"));
6577:
6578: ((GeometryArrayRetained) this .retained).setColorRef3f(colors);
6579:
6580: // NOTE: the checks for multiple non-null references, and the
6581: // array length check need to be done in the retained method
6582: }
6583:
6584: /**
6585: * @deprecated As of Java 3D version 1.3, use geometry by-copy
6586: * for Color3f arrays
6587: *
6588: * @since Java 3D 1.2
6589: */
6590: public Color3f[] getColorRef3f() {
6591: if (isLiveOrCompiled())
6592: if (!this .getCapability(ALLOW_REF_DATA_READ)
6593: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
6594: throw new CapabilityNotSetException(J3dI18N
6595: .getString("GeometryArray87"));
6596: }
6597:
6598: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6599: if ((format & BY_REFERENCE) == 0)
6600: throw new IllegalStateException(J3dI18N
6601: .getString("GeometryArray83"));
6602:
6603: if ((format & USE_NIO_BUFFER) != 0)
6604: throw new IllegalStateException(J3dI18N
6605: .getString("GeometryArray119"));
6606:
6607: if ((format & INTERLEAVED) != 0)
6608: throw new IllegalStateException(J3dI18N
6609: .getString("GeometryArray84"));
6610:
6611: return ((GeometryArrayRetained) this .retained).getColorRef3f();
6612: }
6613:
6614: /**
6615: * @deprecated As of Java 3D version 1.3, use geometry by-copy
6616: * for Color4f arrays
6617: *
6618: * @since Java 3D 1.2
6619: */
6620: public void setColorRef4f(Color4f[] colors) {
6621: if (isLiveOrCompiled())
6622: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
6623: throw new CapabilityNotSetException(J3dI18N
6624: .getString("GeometryArray86"));
6625:
6626: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6627: if ((format & BY_REFERENCE) == 0)
6628: throw new IllegalStateException(J3dI18N
6629: .getString("GeometryArray83"));
6630:
6631: if ((format & USE_NIO_BUFFER) != 0)
6632: throw new IllegalStateException(J3dI18N
6633: .getString("GeometryArray119"));
6634:
6635: if ((format & INTERLEAVED) != 0)
6636: throw new IllegalStateException(J3dI18N
6637: .getString("GeometryArray84"));
6638:
6639: if ((format & WITH_ALPHA) == 0)
6640: throw new IllegalStateException(J3dI18N
6641: .getString("GeometryArray93"));
6642:
6643: ((GeometryArrayRetained) this .retained).setColorRef4f(colors);
6644:
6645: // NOTE: the checks for multiple non-null references, and the
6646: // array length check need to be done in the retained method
6647: }
6648:
6649: /**
6650: * @deprecated As of Java 3D version 1.3, use geometry by-copy
6651: * for Color4f arrays
6652: *
6653: * @since Java 3D 1.2
6654: */
6655: public Color4f[] getColorRef4f() {
6656: if (isLiveOrCompiled())
6657: if (!this .getCapability(ALLOW_REF_DATA_READ)
6658: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
6659: throw new CapabilityNotSetException(J3dI18N
6660: .getString("GeometryArray87"));
6661: }
6662:
6663: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6664: if ((format & BY_REFERENCE) == 0)
6665: throw new IllegalStateException(J3dI18N
6666: .getString("GeometryArray83"));
6667:
6668: if ((format & USE_NIO_BUFFER) != 0)
6669: throw new IllegalStateException(J3dI18N
6670: .getString("GeometryArray119"));
6671:
6672: if ((format & INTERLEAVED) != 0)
6673: throw new IllegalStateException(J3dI18N
6674: .getString("GeometryArray84"));
6675:
6676: return ((GeometryArrayRetained) this .retained).getColorRef4f();
6677: }
6678:
6679: /**
6680: * @deprecated As of Java 3D version 1.3, use geometry by-copy
6681: * for Color3b arrays
6682: *
6683: * @since Java 3D 1.2
6684: */
6685: public void setColorRef3b(Color3b[] colors) {
6686: if (isLiveOrCompiled())
6687: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
6688: throw new CapabilityNotSetException(J3dI18N
6689: .getString("GeometryArray86"));
6690:
6691: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6692: if ((format & BY_REFERENCE) == 0)
6693: throw new IllegalStateException(J3dI18N
6694: .getString("GeometryArray83"));
6695:
6696: if ((format & USE_NIO_BUFFER) != 0)
6697: throw new IllegalStateException(J3dI18N
6698: .getString("GeometryArray119"));
6699:
6700: if ((format & INTERLEAVED) != 0)
6701: throw new IllegalStateException(J3dI18N
6702: .getString("GeometryArray84"));
6703:
6704: if ((format & WITH_ALPHA) != 0)
6705: throw new IllegalStateException(J3dI18N
6706: .getString("GeometryArray92"));
6707:
6708: ((GeometryArrayRetained) this .retained).setColorRef3b(colors);
6709:
6710: // NOTE: the checks for multiple non-null references, and the
6711: // array length check need to be done in the retained method
6712: }
6713:
6714: /**
6715: * @deprecated As of Java 3D version 1.3, use geometry by-copy
6716: * for Color3b arrays
6717: *
6718: * @since Java 3D 1.2
6719: */
6720: public Color3b[] getColorRef3b() {
6721: if (isLiveOrCompiled())
6722: if (!this .getCapability(ALLOW_REF_DATA_READ)
6723: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
6724: throw new CapabilityNotSetException(J3dI18N
6725: .getString("GeometryArray87"));
6726: }
6727:
6728: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6729: if ((format & BY_REFERENCE) == 0)
6730: throw new IllegalStateException(J3dI18N
6731: .getString("GeometryArray83"));
6732:
6733: if ((format & USE_NIO_BUFFER) != 0)
6734: throw new IllegalStateException(J3dI18N
6735: .getString("GeometryArray119"));
6736:
6737: if ((format & USE_NIO_BUFFER) != 0)
6738: throw new IllegalStateException(J3dI18N
6739: .getString("GeometryArray119"));
6740:
6741: if ((format & INTERLEAVED) != 0)
6742: throw new IllegalStateException(J3dI18N
6743: .getString("GeometryArray84"));
6744:
6745: return ((GeometryArrayRetained) this .retained).getColorRef3b();
6746: }
6747:
6748: /**
6749: * @deprecated As of Java 3D version 1.3, use geometry by-copy
6750: * for Color4b arrays
6751: *
6752: * @since Java 3D 1.2
6753: */
6754: public void setColorRef4b(Color4b[] colors) {
6755: if (isLiveOrCompiled())
6756: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
6757: throw new CapabilityNotSetException(J3dI18N
6758: .getString("GeometryArray86"));
6759:
6760: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6761: if ((format & BY_REFERENCE) == 0)
6762: throw new IllegalStateException(J3dI18N
6763: .getString("GeometryArray83"));
6764:
6765: if ((format & USE_NIO_BUFFER) != 0)
6766: throw new IllegalStateException(J3dI18N
6767: .getString("GeometryArray119"));
6768:
6769: if ((format & INTERLEAVED) != 0)
6770: throw new IllegalStateException(J3dI18N
6771: .getString("GeometryArray84"));
6772:
6773: if ((format & WITH_ALPHA) == 0)
6774: throw new IllegalStateException(J3dI18N
6775: .getString("GeometryArray93"));
6776:
6777: ((GeometryArrayRetained) this .retained).setColorRef4b(colors);
6778:
6779: // NOTE: the checks for multiple non-null references, and the
6780: // array length check need to be done in the retained method
6781: }
6782:
6783: /**
6784: * @deprecated As of Java 3D version 1.3, use geometry by-copy
6785: * for Color4b arrays
6786: *
6787: * @since Java 3D 1.2
6788: */
6789: public Color4b[] getColorRef4b() {
6790: if (isLiveOrCompiled())
6791: if (!this .getCapability(ALLOW_REF_DATA_READ)
6792: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
6793: throw new CapabilityNotSetException(J3dI18N
6794: .getString("GeometryArray87"));
6795: }
6796:
6797: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6798: if ((format & BY_REFERENCE) == 0)
6799: throw new IllegalStateException(J3dI18N
6800: .getString("GeometryArray83"));
6801:
6802: if ((format & USE_NIO_BUFFER) != 0)
6803: throw new IllegalStateException(J3dI18N
6804: .getString("GeometryArray119"));
6805:
6806: if ((format & INTERLEAVED) != 0)
6807: throw new IllegalStateException(J3dI18N
6808: .getString("GeometryArray84"));
6809:
6810: return ((GeometryArrayRetained) this .retained).getColorRef4b();
6811: }
6812:
6813: /**
6814: * Sets the normal buffer reference to the specified
6815: * buffer object. The buffer contains a java.nio.FloatBuffer
6816: * object containing <i>nx</i>, <i>ny</i>,
6817: * and <i>nz</i> values for each vertex (for a total of 3*<i>n</i>
6818: * values, where <i>n</i> is the number of vertices).
6819: * If the normal buffer reference is null and normals are enabled
6820: * (that is, the vertexFormat includes <code>NORMAL</code>), the
6821: * entire geometry array object is treated as if it were null--any
6822: * Shape3D or Morph node that uses this geometry array will not be
6823: * drawn.
6824: *
6825: * @param normals a J3DBuffer object to which a reference will be set.
6826: * The buffer contains an NIO buffer of 3*<i>n</i> float values.
6827: *
6828: * @exception CapabilityNotSetException if the appropriate capability is
6829: * not set and this object is part of a live or compiled scene graph
6830: *
6831: * @exception IllegalStateException if the data mode for this geometry
6832: * array object is not <code>BY_REFERENCE</code>,
6833: * is not <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
6834: *
6835: * @exception IllegalArgumentException if the java.nio.Buffer
6836: * contained in the specified J3DBuffer is not a
6837: * java.nio.FloatBuffer object.
6838: *
6839: * @exception ArrayIndexOutOfBoundsException if
6840: * <code>NORMALS</code> bit is not set in the
6841: * <code>vertexFormat</code>, or if
6842: * <code>normals.getBuffer().limit() <
6843: * 3 * (initialNormalIndex + validVertexCount)</code>.
6844: *
6845: * @exception ArrayIndexOutOfBoundsException if this GeometryArray
6846: * object is a subclass of IndexedGeometryArray, and any element
6847: * in the range
6848: * <code>[initialIndexIndex, initialIndexIndex+validIndexCount-1]</code>
6849: * in the normal index array is greater than or equal to the
6850: * number of vertices defined by the normals object,
6851: * <code>normals.getBuffer().limit() / 3</code>.
6852: *
6853: * @since Java 3D 1.3
6854: */
6855: public void setNormalRefBuffer(J3DBuffer normals) {
6856: if (isLiveOrCompiled())
6857: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
6858: throw new CapabilityNotSetException(J3dI18N
6859: .getString("GeometryArray86"));
6860:
6861: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6862: if ((format & USE_NIO_BUFFER) == 0)
6863: throw new IllegalStateException(J3dI18N
6864: .getString("GeometryArray118"));
6865:
6866: if ((format & INTERLEAVED) != 0)
6867: throw new IllegalStateException(J3dI18N
6868: .getString("GeometryArray84"));
6869:
6870: ((GeometryArrayRetained) this .retained)
6871: .setNormalRefBuffer(normals);
6872: }
6873:
6874: /**
6875: * Gets the normal array buffer reference.
6876: * @return the current normal array buffer reference.
6877: * @exception CapabilityNotSetException if the appropriate capability is
6878: * not set and this object is part of a live or compiled scene graph
6879: * @exception IllegalStateException if the data mode for this geometry
6880: * array object is not <code>BY_REFERENCE</code>,
6881: * is not <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
6882: *
6883: * @since Java 3D 1.3
6884: */
6885: public J3DBuffer getNormalRefBuffer() {
6886: if (isLiveOrCompiled())
6887: if (!this .getCapability(ALLOW_REF_DATA_READ)
6888: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
6889: throw new CapabilityNotSetException(J3dI18N
6890: .getString("GeometryArray87"));
6891: }
6892:
6893: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6894:
6895: if ((format & USE_NIO_BUFFER) == 0)
6896: throw new IllegalStateException(J3dI18N
6897: .getString("GeometryArray118"));
6898:
6899: if ((format & INTERLEAVED) != 0)
6900: throw new IllegalStateException(J3dI18N
6901: .getString("GeometryArray84"));
6902:
6903: return ((GeometryArrayRetained) this .retained)
6904: .getNormalRefBuffer();
6905: }
6906:
6907: /**
6908: * Sets the float normal array reference to the specified
6909: * array. The array contains floating-point <i>nx</i>, <i>ny</i>,
6910: * and <i>nz</i> values for each vertex (for a total of 3*<i>n</i>
6911: * values, where <i>n</i> is the number of vertices). Only one of
6912: * <code>normalRefFloat</code> or <code>normalRef3f</code> may be
6913: * non-null (or they may all be null). An attempt to set more
6914: * than one of these attributes to a non-null reference will
6915: * result in an exception being thrown. If all normal array
6916: * references are null and normals are enabled (that is, the
6917: * vertexFormat includes
6918: * <code>NORMAL</code>), the entire geometry array object is
6919: * treated as if it were null--any Shape3D or Morph node that uses
6920: * this geometry array will not be drawn.
6921: *
6922: * @param normals an array of 3*<i>n</i> values to which a
6923: * reference will be set.
6924: * @exception CapabilityNotSetException if the appropriate capability is
6925: * not set and this object is part of a live or compiled scene graph
6926: * @exception IllegalStateException if the data mode for this geometry
6927: * array object is not <code>BY_REFERENCE</code>,
6928: * is <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
6929: * @exception IllegalArgumentException if the specified array is
6930: * non-null and any other normal reference is also non-null.
6931: * @exception ArrayIndexOutOfBoundsException if
6932: * <code>NORMALS</code> bit is not set in the
6933: * <code>vertexFormat</code>, or if
6934: * <code>normals.length < 3 * (initialNormalIndex + validVertexCount)</code>.
6935: *
6936: * @exception ArrayIndexOutOfBoundsException if this GeometryArray
6937: * object is a subclass of IndexedGeometryArray, and any element
6938: * in the range
6939: * <code>[initialIndexIndex, initialIndexIndex+validIndexCount-1]</code>
6940: * in the normal index array is greater than or equal to the
6941: * number of vertices defined by the normals array,
6942: * <code>normals.length / 3</code>.
6943: *
6944: * @since Java 3D 1.2
6945: */
6946: public void setNormalRefFloat(float[] normals) {
6947: if (isLiveOrCompiled())
6948: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
6949: throw new CapabilityNotSetException(J3dI18N
6950: .getString("GeometryArray86"));
6951:
6952: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6953: if ((format & BY_REFERENCE) == 0)
6954: throw new IllegalStateException(J3dI18N
6955: .getString("GeometryArray83"));
6956:
6957: if ((format & USE_NIO_BUFFER) != 0)
6958: throw new IllegalStateException(J3dI18N
6959: .getString("GeometryArray119"));
6960:
6961: if ((format & INTERLEAVED) != 0)
6962: throw new IllegalStateException(J3dI18N
6963: .getString("GeometryArray84"));
6964:
6965: ((GeometryArrayRetained) this .retained)
6966: .setNormalRefFloat(normals);
6967:
6968: // NOTE: the checks for multiple non-null references, and the
6969: // array length check need to be done in the retained method
6970: }
6971:
6972: /**
6973: * Gets the float normal array reference.
6974: * @return the current float normal array reference.
6975: * @exception CapabilityNotSetException if the appropriate capability is
6976: * not set and this object is part of a live or compiled scene graph
6977: * @exception IllegalStateException if the data mode for this geometry
6978: * array object is not <code>BY_REFERENCE</code>,
6979: * is <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
6980: *
6981: * @since Java 3D 1.2
6982: */
6983: public float[] getNormalRefFloat() {
6984: if (isLiveOrCompiled())
6985: if (!this .getCapability(ALLOW_REF_DATA_READ)
6986: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
6987: throw new CapabilityNotSetException(J3dI18N
6988: .getString("GeometryArray87"));
6989: }
6990:
6991: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
6992: if ((format & BY_REFERENCE) == 0)
6993: throw new IllegalStateException(J3dI18N
6994: .getString("GeometryArray83"));
6995:
6996: if ((format & USE_NIO_BUFFER) != 0)
6997: throw new IllegalStateException(J3dI18N
6998: .getString("GeometryArray119"));
6999:
7000: if ((format & INTERLEAVED) != 0)
7001: throw new IllegalStateException(J3dI18N
7002: .getString("GeometryArray84"));
7003:
7004: return ((GeometryArrayRetained) this .retained)
7005: .getNormalRefFloat();
7006: }
7007:
7008: /**
7009: * @deprecated As of Java 3D version 1.3, use geometry by-copy
7010: * for Vector3f arrays
7011: *
7012: * @since Java 3D 1.2
7013: */
7014: public void setNormalRef3f(Vector3f[] normals) {
7015: if (isLiveOrCompiled())
7016: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
7017: throw new CapabilityNotSetException(J3dI18N
7018: .getString("GeometryArray86"));
7019:
7020: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7021: if ((format & BY_REFERENCE) == 0)
7022: throw new IllegalStateException(J3dI18N
7023: .getString("GeometryArray83"));
7024:
7025: if ((format & USE_NIO_BUFFER) != 0)
7026: throw new IllegalStateException(J3dI18N
7027: .getString("GeometryArray119"));
7028:
7029: if ((format & INTERLEAVED) != 0)
7030: throw new IllegalStateException(J3dI18N
7031: .getString("GeometryArray84"));
7032:
7033: ((GeometryArrayRetained) this .retained).setNormalRef3f(normals);
7034:
7035: // NOTE: the checks for multiple non-null references, and the
7036: // array length check need to be done in the retained method
7037: }
7038:
7039: /**
7040: * @deprecated As of Java 3D version 1.3, use geometry by-copy
7041: * for Vector3f arrays
7042: *
7043: * @since Java 3D 1.2
7044: */
7045: public Vector3f[] getNormalRef3f() {
7046: if (isLiveOrCompiled())
7047: if (!this .getCapability(ALLOW_REF_DATA_READ)
7048: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
7049: throw new CapabilityNotSetException(J3dI18N
7050: .getString("GeometryArray87"));
7051: }
7052:
7053: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7054: if ((format & BY_REFERENCE) == 0)
7055: throw new IllegalStateException(J3dI18N
7056: .getString("GeometryArray83"));
7057:
7058: if ((format & USE_NIO_BUFFER) != 0)
7059: throw new IllegalStateException(J3dI18N
7060: .getString("GeometryArray119"));
7061:
7062: if ((format & INTERLEAVED) != 0)
7063: throw new IllegalStateException(J3dI18N
7064: .getString("GeometryArray84"));
7065:
7066: return ((GeometryArrayRetained) this .retained).getNormalRef3f();
7067: }
7068:
7069: /**
7070: * Sets the texture coordinate buffer reference for the specified
7071: * texture coordinate set to the
7072: * specified buffer object. The buffer contains a java.nio.FloatBuffer
7073: * object containing <i>s</i>,
7074: * <i>t</i>, and, optionally, <i>r</i> and <i>q</i> values for each
7075: * vertex (for
7076: * a total of 2*<i>n</i> , 3*<i>n</i> or 4*<i>n</i> values,
7077: * where <i>n</i> is
7078: * the number of vertices).
7079: * If the texCoord buffer reference is null and texture
7080: * coordinates are enabled (that is, the vertexFormat includes
7081: * <code>TEXTURE_COORDINATE_2</code>,
7082: * <code>TEXTURE_COORDINATE_3</code>, or
7083: * <code>TEXTURE_COORDINATE_4</code>), the entire geometry
7084: * array object is treated as if it were null--any Shape3D or
7085: * Morph node that uses this geometry array will not be drawn.
7086: *
7087: * @param texCoordSet texture coordinate set in this geometry array
7088: * @param texCoords a J3DBuffer object to which a reference will be set.
7089: * The buffer contains an NIO buffer of 2*<i>n</i>, 3*<i>n</i> or
7090: * 4*<i>n</i> float values.
7091: *
7092: * @exception CapabilityNotSetException if the appropriate capability is
7093: * not set and this object is part of a live or compiled scene graph
7094: *
7095: * @exception IllegalStateException if the data mode for this geometry
7096: * array object is not <code>BY_REFERENCE</code>,
7097: * is not <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
7098: *
7099: * @exception IllegalArgumentException if the java.nio.Buffer
7100: * contained in the specified J3DBuffer is not a
7101: * java.nio.FloatBuffer object.
7102: *
7103: * @exception ArrayIndexOutOfBoundsException if none of the
7104: * <code>TEXTURE_COORDINATE</code> bits are set in the
7105: * <code>vertexFormat</code>, or if texCoordSet is out of range,
7106: * or if
7107: * <code>texCoords.getBuffer().limit() < </code> <i>num_words</i>
7108: * <code> * (initialTexCoordIndex + validVertexCount)</code>,
7109: * where <i>num_words</i> is 2, 3, or 4 depending on the vertex
7110: * texture coordinate format.
7111: *
7112: * @exception ArrayIndexOutOfBoundsException if this GeometryArray
7113: * object is a subclass of IndexedGeometryArray, and any element
7114: * in the range
7115: * <code>[initialIndexIndex, initialIndexIndex+validIndexCount-1]</code>
7116: * in the texture coordinate index array is greater than or equal to the
7117: * number of vertices defined by the texCoords object,
7118: * <code>texCoords.getBuffer().limit() / </code> <i>num_words</i>.
7119: *
7120: * @since Java 3D 1.3
7121: */
7122: public void setTexCoordRefBuffer(int texCoordSet,
7123: J3DBuffer texCoords) {
7124: if (isLiveOrCompiled())
7125: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
7126: throw new CapabilityNotSetException(J3dI18N
7127: .getString("GeometryArray86"));
7128:
7129: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7130:
7131: if ((format & USE_NIO_BUFFER) == 0)
7132: throw new IllegalStateException(J3dI18N
7133: .getString("GeometryArray118"));
7134:
7135: if ((format & INTERLEAVED) != 0)
7136: throw new IllegalStateException(J3dI18N
7137: .getString("GeometryArray84"));
7138:
7139: ((GeometryArrayRetained) this .retained).setTexCoordRefBuffer(
7140: texCoordSet, texCoords);
7141:
7142: }
7143:
7144: /**
7145: * Gets the texture coordinate array buffer reference for the specified
7146: * texture coordinate set.
7147: *
7148: * @param texCoordSet texture coordinate set in this geometry array
7149: *
7150: * @return the current texture coordinate array buffer reference
7151: * for the specified texture coordinate set
7152: *
7153: * @exception CapabilityNotSetException if the appropriate capability is
7154: * not set and this object is part of a live or compiled scene graph
7155: *
7156: * @exception IllegalStateException if the data mode for this geometry
7157: * array object is not <code>BY_REFERENCE</code>,
7158: * is not <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
7159: *
7160: * @exception ArrayIndexOutOfBoundsException if none of the
7161: * <code>TEXTURE_COORDINATE</code> bits are set in the
7162: * <code>vertexFormat</code> or texCoordSet is out of range.
7163: *
7164: * @since Java 3D 1.3
7165: */
7166: public J3DBuffer getTexCoordRefBuffer(int texCoordSet) {
7167: if (isLiveOrCompiled())
7168: if (!this .getCapability(ALLOW_REF_DATA_READ)
7169: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
7170: throw new CapabilityNotSetException(J3dI18N
7171: .getString("GeometryArray87"));
7172: }
7173:
7174: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7175:
7176: if ((format & USE_NIO_BUFFER) == 0)
7177: throw new IllegalStateException(J3dI18N
7178: .getString("GeometryArray118"));
7179:
7180: if ((format & INTERLEAVED) != 0)
7181: throw new IllegalStateException(J3dI18N
7182: .getString("GeometryArray84"));
7183:
7184: return ((GeometryArrayRetained) this .retained)
7185: .getTexCoordRefBuffer(texCoordSet);
7186: }
7187:
7188: /**
7189: * Sets the float texture coordinate array reference for the specified
7190: * texture coordinate set to the
7191: * specified array. The array contains floating-point <i>s</i>,
7192: * <i>t</i>, and, optionally, <i>r</i> and <i>q</i> values for each
7193: * vertex (for
7194: * a total of 2*<i>n</i> , 3*<i>n</i> or 4*<i>n</i> values,
7195: * where <i>n</i> is
7196: * the number of vertices). Only one of
7197: * <code>texCoordRefFloat</code>, <code>texCoordRef2f</code>, or
7198: * <code>texCoordRef3f</code> may be non-null (or they may all be
7199: * null). An attempt to set more than one of these attributes to
7200: * a non-null reference will result in an exception being thrown.
7201: * If all texCoord array references are null and texture
7202: * coordinates are enabled (that is, the vertexFormat includes
7203: * <code>TEXTURE_COORDINATE_2</code>,
7204: * <code>TEXTURE_COORDINATE_3</code>, or
7205: * <code>TEXTURE_COORDINATE_4</code>), the entire geometry
7206: * array object is treated as if it were null--any Shape3D or
7207: * Morph node that uses this geometry array will not be drawn.
7208: *
7209: * @param texCoordSet texture coordinate set in this geometry array
7210: * @param texCoords an array of 2*<i>n</i>, 3*<i>n</i> or
7211: * 4*<i>n</i> values to
7212: * which a reference will be set.
7213: *
7214: * @exception CapabilityNotSetException if the appropriate capability is
7215: * not set and this object is part of a live or compiled scene graph
7216: * @exception IllegalStateException if the data mode for this geometry
7217: * array object is not <code>BY_REFERENCE</code>,
7218: * is <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
7219: * @exception IllegalArgumentException if the specified array is
7220: * non-null and any other texCoord reference is also non-null.
7221: *
7222: * @exception ArrayIndexOutOfBoundsException if none of the
7223: * <code>TEXTURE_COORDINATE</code> bits are set in the
7224: * <code>vertexFormat</code>, or if texCoordSet is out of range,
7225: * or if
7226: * <code>texCoords.length < </code> <i>num_words</i> <code> *
7227: * (initialTexCoordIndex + validVertexCount)</code>,
7228: * where <i>num_words</i> is 2, 3, or 4 depending on the vertex
7229: * texture coordinate format.
7230: *
7231: * @exception ArrayIndexOutOfBoundsException if this GeometryArray
7232: * object is a subclass of IndexedGeometryArray, and any element
7233: * in the range
7234: * <code>[initialIndexIndex, initialIndexIndex+validIndexCount-1]</code>
7235: * in the texture coordinate index array is greater than or equal to the
7236: * number of vertices defined by the texCoords array,
7237: * <code>texCoords.length / </code> <i>num_words</i>.
7238: *
7239: * @since Java 3D 1.2
7240: */
7241: public void setTexCoordRefFloat(int texCoordSet, float[] texCoords) {
7242:
7243: if (isLiveOrCompiled())
7244: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
7245: throw new CapabilityNotSetException(J3dI18N
7246: .getString("GeometryArray86"));
7247:
7248: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7249: if ((format & BY_REFERENCE) == 0)
7250: throw new IllegalStateException(J3dI18N
7251: .getString("GeometryArray83"));
7252:
7253: if ((format & USE_NIO_BUFFER) != 0)
7254: throw new IllegalStateException(J3dI18N
7255: .getString("GeometryArray119"));
7256:
7257: if ((format & INTERLEAVED) != 0)
7258: throw new IllegalStateException(J3dI18N
7259: .getString("GeometryArray84"));
7260:
7261: ((GeometryArrayRetained) this .retained).setTexCoordRefFloat(
7262: texCoordSet, texCoords);
7263:
7264: // NOTE: the checks for multiple non-null references, and the
7265: // array length check need to be done in the retained method
7266: }
7267:
7268: /**
7269: * Gets the float texture coordinate array reference for the specified
7270: * texture coordinate set.
7271: *
7272: * @param texCoordSet texture coordinate set in this geometry array
7273: *
7274: * @return the current float texture coordinate array reference
7275: * for the specified texture coordinate set
7276: *
7277: * @exception CapabilityNotSetException if the appropriate capability is
7278: * not set and this object is part of a live or compiled scene graph
7279: *
7280: * @exception IllegalStateException if the data mode for this geometry
7281: * array object is not <code>BY_REFERENCE</code>,
7282: * is <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
7283: *
7284: * @exception ArrayIndexOutOfBoundsException if none of the
7285: * <code>TEXTURE_COORDINATE</code> bits are set in the
7286: * <code>vertexFormat</code> or texCoordSet is out of range.
7287: *
7288: * @since Java 3D 1.2
7289: */
7290: public float[] getTexCoordRefFloat(int texCoordSet) {
7291:
7292: if (isLiveOrCompiled())
7293: if (!this .getCapability(ALLOW_REF_DATA_READ)
7294: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
7295: throw new CapabilityNotSetException(J3dI18N
7296: .getString("GeometryArray87"));
7297: }
7298:
7299: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7300: if ((format & BY_REFERENCE) == 0)
7301: throw new IllegalStateException(J3dI18N
7302: .getString("GeometryArray83"));
7303:
7304: if ((format & USE_NIO_BUFFER) != 0)
7305: throw new IllegalStateException(J3dI18N
7306: .getString("GeometryArray119"));
7307:
7308: if ((format & INTERLEAVED) != 0)
7309: throw new IllegalStateException(J3dI18N
7310: .getString("GeometryArray84"));
7311:
7312: return ((GeometryArrayRetained) this .retained)
7313: .getTexCoordRefFloat(texCoordSet);
7314: }
7315:
7316: /**
7317: * @deprecated As of Java 3D version 1.3, use geometry by-copy
7318: * for TexCoord2f arrays
7319: *
7320: * @since Java 3D 1.2
7321: */
7322: public void setTexCoordRef2f(int texCoordSet, TexCoord2f[] texCoords) {
7323:
7324: if (isLiveOrCompiled())
7325: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
7326: throw new CapabilityNotSetException(J3dI18N
7327: .getString("GeometryArray86"));
7328:
7329: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7330: if ((format & BY_REFERENCE) == 0)
7331: throw new IllegalStateException(J3dI18N
7332: .getString("GeometryArray83"));
7333:
7334: if ((format & USE_NIO_BUFFER) != 0)
7335: throw new IllegalStateException(J3dI18N
7336: .getString("GeometryArray119"));
7337:
7338: if ((format & INTERLEAVED) != 0)
7339: throw new IllegalStateException(J3dI18N
7340: .getString("GeometryArray84"));
7341:
7342: if ((format & (TEXTURE_COORDINATE_3 | TEXTURE_COORDINATE_4)) != 0)
7343: throw new IllegalStateException(J3dI18N
7344: .getString("GeometryArray94"));
7345:
7346: ((GeometryArrayRetained) this .retained).setTexCoordRef2f(
7347: texCoordSet, texCoords);
7348:
7349: // NOTE: the checks for multiple non-null references, and the
7350: // array length check need to be done in the retained method
7351: }
7352:
7353: /**
7354: * @deprecated As of Java 3D version 1.3, use geometry by-copy
7355: * for TexCoord2f arrays
7356: *
7357: * @since Java 3D 1.2
7358: */
7359: public TexCoord2f[] getTexCoordRef2f(int texCoordSet) {
7360:
7361: if (isLiveOrCompiled())
7362: if (!this .getCapability(ALLOW_REF_DATA_READ)
7363: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
7364: throw new CapabilityNotSetException(J3dI18N
7365: .getString("GeometryArray87"));
7366: }
7367:
7368: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7369: if ((format & BY_REFERENCE) == 0)
7370: throw new IllegalStateException(J3dI18N
7371: .getString("GeometryArray83"));
7372:
7373: if ((format & USE_NIO_BUFFER) != 0)
7374: throw new IllegalStateException(J3dI18N
7375: .getString("GeometryArray119"));
7376:
7377: if ((format & INTERLEAVED) != 0)
7378: throw new IllegalStateException(J3dI18N
7379: .getString("GeometryArray84"));
7380:
7381: return ((GeometryArrayRetained) this .retained)
7382: .getTexCoordRef2f(texCoordSet);
7383: }
7384:
7385: /**
7386: * @deprecated As of Java 3D version 1.3, use geometry by-copy
7387: * for TexCoord3f arrays
7388: *
7389: * @since Java 3D 1.2
7390: */
7391: public void setTexCoordRef3f(int texCoordSet, TexCoord3f[] texCoords) {
7392:
7393: if (isLiveOrCompiled())
7394: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
7395: throw new CapabilityNotSetException(J3dI18N
7396: .getString("GeometryArray86"));
7397:
7398: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7399: if ((format & BY_REFERENCE) == 0)
7400: throw new IllegalStateException(J3dI18N
7401: .getString("GeometryArray83"));
7402:
7403: if ((format & USE_NIO_BUFFER) != 0)
7404: throw new IllegalStateException(J3dI18N
7405: .getString("GeometryArray119"));
7406:
7407: if ((format & INTERLEAVED) != 0)
7408: throw new IllegalStateException(J3dI18N
7409: .getString("GeometryArray84"));
7410:
7411: if ((format & (TEXTURE_COORDINATE_2 | TEXTURE_COORDINATE_4)) != 0)
7412: throw new IllegalStateException(J3dI18N
7413: .getString("GeometryArray95"));
7414:
7415: ((GeometryArrayRetained) this .retained).setTexCoordRef3f(
7416: texCoordSet, texCoords);
7417:
7418: // NOTE: the checks for multiple non-null references, and the
7419: // array length check need to be done in the retained method
7420: }
7421:
7422: /**
7423: * @deprecated As of Java 3D version 1.3, use geometry by-copy
7424: * for TexCoord3f arrays
7425: *
7426: * @since Java 3D 1.2
7427: */
7428: public TexCoord3f[] getTexCoordRef3f(int texCoordSet) {
7429:
7430: if (isLiveOrCompiled())
7431: if (!this .getCapability(ALLOW_REF_DATA_READ)
7432: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
7433: throw new CapabilityNotSetException(J3dI18N
7434: .getString("GeometryArray87"));
7435: }
7436:
7437: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7438: if ((format & BY_REFERENCE) == 0)
7439: throw new IllegalStateException(J3dI18N
7440: .getString("GeometryArray83"));
7441:
7442: if ((format & USE_NIO_BUFFER) != 0)
7443: throw new IllegalStateException(J3dI18N
7444: .getString("GeometryArray119"));
7445:
7446: if ((format & INTERLEAVED) != 0)
7447: throw new IllegalStateException(J3dI18N
7448: .getString("GeometryArray84"));
7449:
7450: return ((GeometryArrayRetained) this .retained)
7451: .getTexCoordRef3f(texCoordSet);
7452: }
7453:
7454: /**
7455: * Sets the vertex attribute buffer reference for the specified
7456: * vertex attribute number to the specified buffer object. The
7457: * buffer contains a java.nio.FloatBuffer object containing 1, 2,
7458: * 3, or 4 values for each vertex (for a total of 1*<i>n</i>,
7459: * 2*<i>n</i>, 3*<i>n</i>, or 4*<i>n</i> values, where <i>n</i> is
7460: * the number of vertices).
7461: * If the vertexAttr buffer reference is null and vertex
7462: * attributes are enabled (that is, the vertexFormat includes
7463: * <code>VERTEX_ATTRIBUTES</code>), the entire geometry array
7464: * object is treated as if it were null--any Shape3D node that
7465: * uses this geometry array will not be drawn.
7466: *
7467: * @param vertexAttrNum vertex attribute number in this geometry array
7468: *
7469: * @param vertexAttrs a J3DBuffer object to which a reference will
7470: * be set. The buffer contains an NIO buffer of 1*<i>n</i>,
7471: * 2*<i>n</i>, 3*<i>n</i>, or 4*<i>n</i> float values.
7472: *
7473: * @exception CapabilityNotSetException if the appropriate capability is
7474: * not set and this object is part of a live or compiled scene graph
7475: *
7476: * @exception IllegalStateException if the data mode for this geometry
7477: * array object is not <code>BY_REFERENCE</code>,
7478: * is not <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
7479: *
7480: * @exception IllegalArgumentException if the java.nio.Buffer
7481: * contained in the specified J3DBuffer is not a
7482: * java.nio.FloatBuffer object.
7483: *
7484: * @exception ArrayIndexOutOfBoundsException if vertexAttrNum is out of
7485: * range, or if
7486: * <code>vertexAttrs.getBuffer().limit() < </code> <i>num_words</i>
7487: * <code> * (initialVertexAttrIndex + validVertexCount)</code>,
7488: * where <i>num_words</i> is the size of the specified
7489: * vertexAttrNum (1, 2, 3, or 4).
7490: *
7491: * @exception ArrayIndexOutOfBoundsException if this GeometryArray
7492: * object is a subclass of IndexedGeometryArray, and any element
7493: * in the range
7494: * <code>[initialIndexIndex, initialIndexIndex+validIndexCount-1]</code>
7495: * in the vertex attribute index array is greater than or equal to the
7496: * number of vertices defined by the vertexAttrs object,
7497: * <code>vertexAttrs.getBuffer().limit() / </code> <i>num_words</i>.
7498: *
7499: * @since Java 3D 1.4
7500: */
7501: public void setVertexAttrRefBuffer(int vertexAttrNum,
7502: J3DBuffer vertexAttrs) {
7503: if (isLiveOrCompiled()) {
7504: if (!this .getCapability(ALLOW_REF_DATA_WRITE)) {
7505: throw new CapabilityNotSetException(J3dI18N
7506: .getString("GeometryArray86"));
7507: }
7508: }
7509:
7510: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7511:
7512: if ((format & USE_NIO_BUFFER) == 0) {
7513: throw new IllegalStateException(J3dI18N
7514: .getString("GeometryArray118"));
7515: }
7516:
7517: if ((format & INTERLEAVED) != 0) {
7518: throw new IllegalStateException(J3dI18N
7519: .getString("GeometryArray84"));
7520: }
7521:
7522: ((GeometryArrayRetained) this .retained).setVertexAttrRefBuffer(
7523: vertexAttrNum, vertexAttrs);
7524: }
7525:
7526: /**
7527: * Gets the vertex attribute array buffer reference for the specified
7528: * vertex attribute number.
7529: *
7530: * @param vertexAttrNum vertex attribute number in this geometry array
7531: *
7532: * @return the current vertex attribute array buffer reference
7533: * for the specified vertex attribute number
7534: *
7535: * @exception CapabilityNotSetException if the appropriate capability is
7536: * not set and this object is part of a live or compiled scene graph
7537: *
7538: * @exception IllegalStateException if the data mode for this geometry
7539: * array object is not <code>BY_REFERENCE</code>,
7540: * is not <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
7541: *
7542: * @exception ArrayIndexOutOfBoundsException if vertexAttrNum is out
7543: * of range.
7544: *
7545: * @since Java 3D 1.4
7546: */
7547: public J3DBuffer getVertexAttrRefBuffer(int vertexAttrNum) {
7548: if (isLiveOrCompiled()) {
7549: if (!this .getCapability(ALLOW_REF_DATA_READ)
7550: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
7551:
7552: throw new CapabilityNotSetException(J3dI18N
7553: .getString("GeometryArray87"));
7554: }
7555: }
7556:
7557: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7558:
7559: if ((format & USE_NIO_BUFFER) == 0) {
7560: throw new IllegalStateException(J3dI18N
7561: .getString("GeometryArray118"));
7562: }
7563:
7564: if ((format & INTERLEAVED) != 0) {
7565: throw new IllegalStateException(J3dI18N
7566: .getString("GeometryArray84"));
7567: }
7568:
7569: return ((GeometryArrayRetained) this .retained)
7570: .getVertexAttrRefBuffer(vertexAttrNum);
7571: }
7572:
7573: /*
7574: * XXXX: add the following to the javadoc if we ever add double-precision
7575: * methods for vertex attribtues.
7576: *
7577: *-----------------------------------------------------------------
7578: * Only one of <code>vertexAttrRefFloat</code>, or
7579: * <code>vertexAttrRefDouble</code> may be non-null (or they may
7580: * all be null). An attempt to set more than one of these
7581: * attributes to a non-null reference will result in an exception
7582: * being thrown.
7583: *
7584: * If all vertexAttr array references are null and vertex
7585: * ...
7586: * @exception IllegalArgumentException if the specified array is
7587: * non-null and any other vertexAttr reference is also non-null.
7588: * ...
7589: *-----------------------------------------------------------------
7590: */
7591:
7592: /**
7593: * Sets the float vertex attribute array reference for the
7594: * specified vertex attribute number to the specified array. The
7595: * array contains 1, 2, 3, or 4 floating-point values for each
7596: * vertex (for a total of 1*<i>n</i>, 2*<i>n</i>, 3*<i>n</i>, or
7597: * 4*<i>n</i> values, where <i>n</i> is the number of vertices).
7598: *
7599: * If the vertexAttr array reference is null and vertex
7600: * attributes are enabled (that is, the vertexFormat includes
7601: * <code>VERTEX_ATTRIBUTES</code>), the entire geometry array
7602: * object is treated as if it were null--any Shape3D node that
7603: * uses this geometry array will not be drawn.
7604: *
7605: * @param vertexAttrNum vertex attribute number in this geometry array
7606: *
7607: * @param vertexAttrs an array of 1*<i>n</i>, 2*<i>n</i>,
7608: * 3*<i>n</i>, or 4*<i>n</i> values to which a reference will be
7609: * set.
7610: *
7611: * @exception CapabilityNotSetException if the appropriate capability is
7612: * not set and this object is part of a live or compiled scene graph
7613: * @exception IllegalStateException if the data mode for this geometry
7614: * array object is not <code>BY_REFERENCE</code>,
7615: * is <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
7616: *
7617: * @exception ArrayIndexOutOfBoundsException if vertexAttrNum is
7618: * out of range, or if
7619: * <code>vertexAttrs.length < </code> <i>num_words</i> <code> *
7620: * (initialVertexAttrIndex + validVertexCount)</code>,
7621: * where <i>num_words</i> is the size of the specified
7622: * vertexAttrNum (1, 2, 3, or 4).
7623: *
7624: * @exception ArrayIndexOutOfBoundsException if this GeometryArray
7625: * object is a subclass of IndexedGeometryArray, and any element
7626: * in the range
7627: * <code>[initialIndexIndex, initialIndexIndex+validIndexCount-1]</code>
7628: * in the vertex attribute index array is greater than or equal to the
7629: * number of vertices defined by the vertexAttrs array,
7630: * <code>vertexAttrs.length / </code> <i>num_words</i>.
7631: *
7632: * @since Java 3D 1.4
7633: */
7634: public void setVertexAttrRefFloat(int vertexAttrNum,
7635: float[] vertexAttrs) {
7636:
7637: if (isLiveOrCompiled()) {
7638: if (!this .getCapability(ALLOW_REF_DATA_WRITE)) {
7639: throw new CapabilityNotSetException(J3dI18N
7640: .getString("GeometryArray86"));
7641: }
7642: }
7643:
7644: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7645: if ((format & BY_REFERENCE) == 0) {
7646: throw new IllegalStateException(J3dI18N
7647: .getString("GeometryArray83"));
7648: }
7649:
7650: if ((format & USE_NIO_BUFFER) != 0) {
7651: throw new IllegalStateException(J3dI18N
7652: .getString("GeometryArray119"));
7653: }
7654:
7655: if ((format & INTERLEAVED) != 0) {
7656: throw new IllegalStateException(J3dI18N
7657: .getString("GeometryArray84"));
7658: }
7659:
7660: ((GeometryArrayRetained) this .retained).setVertexAttrRefFloat(
7661: vertexAttrNum, vertexAttrs);
7662:
7663: // NOTE: the checks for multiple non-null references, and the
7664: // array length check need to be done in the retained method
7665: }
7666:
7667: /**
7668: * Gets the float vertex attribute array reference for the specified
7669: * vertex attribute number.
7670: *
7671: * @param vertexAttrNum vertex attribute number in this geometry array
7672: *
7673: * @return the current float vertex attribute array reference
7674: * for the specified vertex attribute number
7675: *
7676: * @exception CapabilityNotSetException if the appropriate capability is
7677: * not set and this object is part of a live or compiled scene graph
7678: *
7679: * @exception IllegalStateException if the data mode for this geometry
7680: * array object is not <code>BY_REFERENCE</code>,
7681: * is <code>USE_NIO_BUFFER</code>, or is <code>INTERLEAVED</code>.
7682: *
7683: * @exception ArrayIndexOutOfBoundsException if vertexAttrNum is
7684: * out of range.
7685: *
7686: * @since Java 3D 1.4
7687: */
7688: public float[] getVertexAttrRefFloat(int vertexAttrNum) {
7689:
7690: if (isLiveOrCompiled()) {
7691: if (!this .getCapability(ALLOW_REF_DATA_READ)
7692: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
7693: throw new CapabilityNotSetException(J3dI18N
7694: .getString("GeometryArray87"));
7695: }
7696: }
7697:
7698: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7699: if ((format & BY_REFERENCE) == 0) {
7700: throw new IllegalStateException(J3dI18N
7701: .getString("GeometryArray83"));
7702: }
7703:
7704: if ((format & USE_NIO_BUFFER) != 0) {
7705: throw new IllegalStateException(J3dI18N
7706: .getString("GeometryArray119"));
7707: }
7708:
7709: if ((format & INTERLEAVED) != 0) {
7710: throw new IllegalStateException(J3dI18N
7711: .getString("GeometryArray84"));
7712: }
7713:
7714: return ((GeometryArrayRetained) this .retained)
7715: .getVertexAttrRefFloat(vertexAttrNum);
7716: }
7717:
7718: /**
7719: * Sets the interleaved vertex array reference to the specified
7720: * array. The vertex components must be stored in a predetermined
7721: * order in the array. The order is: texture coordinates, colors,
7722: * normals, and positional coordinates.
7723: * Vertex attributes are not supported in interleaved mode.
7724: * In the case of texture
7725: * coordinates, the values for each texture coordinate set
7726: * are stored in order from 0 through texCoordSetCount-1. Only those
7727: * components that are enabled appear in the vertex. The number
7728: * of words per vertex depends on which vertex components are
7729: * enabled. Texture coordinates, if enabled, use 2 words per
7730: * texture coordinate set per vertex for
7731: * <code>TEXTURE_COORDINATE_2</code>, 3 words per texture
7732: * coordinate set per vertex for
7733: * <code>TEXTURE_COORDINATE_3</code> or 4 words per texture
7734: * coordinate set per vertex for
7735: * <code>TEXTURE_COORDINATE_4</code>. Colors, if enabled, use 3
7736: * words per vertex for <code>COLOR_3</code> or 4 words per vertex
7737: * for <code>COLOR_4</code>. Normals, if enabled, use 3 words per
7738: * vertex. Positional coordinates, which are always enabled, use
7739: * 3 words per vertex. For example, the format of interleaved
7740: * data for a GeometryArray object whose vertexFormat includes
7741: * <code>COORDINATES</code>, <code>COLOR_3</code>, and
7742: * <code>NORMALS</code> would be: <i>red</i>, <i>green</i>,
7743: * <i>blue</i>, <i>Nx</i>, <i>Ny</i>, <i>Nz</i>, <i>x</i>,
7744: * <i>y</i>, <i>z</i>. All components of a vertex are stored in
7745: * adjacent memory locations. The first component of vertex 0 is
7746: * stored beginning at index 0 in the array. The first component
7747: * of vertex 1 is stored beginning at index
7748: * <i>words_per_vertex</i> in the array. The total number of
7749: * words needed to store <i>n</i> vertices is
7750: * <i>words_per_vertex</i>*<i>n</i>.
7751: *
7752: * @param vertexData an array of vertex values to which a
7753: * reference will be set.
7754: * @exception CapabilityNotSetException if the appropriate capability is
7755: * not set and this object is part of a live or compiled scene graph
7756: * @exception IllegalStateException if the data mode for this geometry
7757: * array object is not <code>INTERLEAVED</code>
7758: * or is <code>USE_NIO_BUFFER</code>.
7759: *
7760: * @exception ArrayIndexOutOfBoundsException if
7761: * <code>vertexData.length</code> < <i>words_per_vertex</i> *
7762: * (<code>initialVertexIndex + validVertexCount</code>),
7763: * where <i>words_per_vertex</i> depends on which formats are enabled.
7764: *
7765: * @exception ArrayIndexOutOfBoundsException if this GeometryArray
7766: * object is a subclass of IndexedGeometryArray, and any element
7767: * in the range
7768: * <code>[initialIndexIndex, initialIndexIndex+validIndexCount-1]</code>
7769: * in the index array associated with any of the enabled vertex
7770: * components (coord, color, normal, texcoord) is greater than or
7771: * equal to the number of vertices defined by the vertexData
7772: * array,
7773: * <code>vertexData.length / </code> <i>words_per_vertex</i>.
7774: *
7775: * @since Java 3D 1.2
7776: */
7777: public void setInterleavedVertices(float[] vertexData) {
7778: if (isLiveOrCompiled())
7779: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
7780: throw new CapabilityNotSetException(J3dI18N
7781: .getString("GeometryArray86"));
7782:
7783: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7784: if ((format & INTERLEAVED) == 0)
7785: throw new IllegalStateException(J3dI18N
7786: .getString("GeometryArray85"));
7787:
7788: if ((format & USE_NIO_BUFFER) != 0)
7789: throw new IllegalStateException(J3dI18N
7790: .getString("GeometryArray119"));
7791:
7792: ((GeometryArrayRetained) this .retained)
7793: .setInterleavedVertices(vertexData);
7794:
7795: // NOTE: the array length check needs to be done in the retained method
7796: }
7797:
7798: /**
7799: * Gets the interleaved vertices array reference.
7800: * @return the current interleaved vertices array reference.
7801: * @exception CapabilityNotSetException if the appropriate capability is
7802: * not set and this object is part of a live or compiled scene graph
7803: * @exception IllegalStateException if the data mode for this geometry
7804: * array object is not <code>INTERLEAVED</code>
7805: * or is <code>USE_NIO_BUFFER</code>.
7806: *
7807: * @since Java 3D 1.2
7808: */
7809: public float[] getInterleavedVertices() {
7810: if (isLiveOrCompiled())
7811: if (!this .getCapability(ALLOW_REF_DATA_READ)
7812: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
7813: throw new CapabilityNotSetException(J3dI18N
7814: .getString("GeometryArray87"));
7815: }
7816:
7817: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7818: if ((format & INTERLEAVED) == 0)
7819: throw new IllegalStateException(J3dI18N
7820: .getString("GeometryArray85"));
7821:
7822: if ((format & USE_NIO_BUFFER) != 0)
7823: throw new IllegalStateException(J3dI18N
7824: .getString("GeometryArray119"));
7825:
7826: return ((GeometryArrayRetained) this .retained)
7827: .getInterleavedVertices();
7828: }
7829:
7830: /**
7831: * Sets the interleaved vertex buffer reference to the specified
7832: * buffer object. The buffer must contain a java.nio.FloatBuffer object.
7833: * The vertex components must be stored in a predetermined
7834: * order in the buffer. The order is: texture coordinates, colors,
7835: * normals, and positional coordinates.
7836: * Vertex attributes are not supported in interleaved mode.
7837: * In the case of texture
7838: * coordinates, the values for each texture coordinate set
7839: * are stored in order from 0 through texCoordSetCount-1. Only those
7840: * components that are enabled appear in the vertex. The number
7841: * of words per vertex depends on which vertex components are
7842: * enabled. Texture coordinates, if enabled, use 2 words per
7843: * texture coordinate set per vertex for
7844: * <code>TEXTURE_COORDINATE_2</code>, 3 words per texture
7845: * coordinate set per vertex for
7846: * <code>TEXTURE_COORDINATE_3</code> or 4 words per texture
7847: * coordinate set per vertex for
7848: * <code>TEXTURE_COORDINATE_4</code>. Colors, if enabled, use 3
7849: * words per vertex for <code>COLOR_3</code> or 4 words per vertex
7850: * for <code>COLOR_4</code>. Normals, if enabled, use 3 words per
7851: * vertex. Positional coordinates, which are always enabled, use
7852: * 3 words per vertex. For example, the format of interleaved
7853: * data for a GeometryArray object whose vertexFormat includes
7854: * <code>COORDINATES</code>, <code>COLOR_3</code>, and
7855: * <code>NORMALS</code> would be: <i>red</i>, <i>green</i>,
7856: * <i>blue</i>, <i>Nx</i>, <i>Ny</i>, <i>Nz</i>, <i>x</i>,
7857: * <i>y</i>, <i>z</i>. All components of a vertex are stored in
7858: * adjacent memory locations. The first component of vertex 0 is
7859: * stored beginning at index 0 in the buffer. The first component
7860: * of vertex 1 is stored beginning at index
7861: * <i>words_per_vertex</i> in the buffer. The total number of
7862: * words needed to store <i>n</i> vertices is
7863: * <i>words_per_vertex</i>*<i>n</i>.
7864: *
7865: * @param vertexData a J3DBuffer object to which a reference will be set.
7866: * The buffer contains an NIO float buffer of
7867: * <i>words_per_vertex</i>*<i>n</i> values.
7868: *
7869: * @exception CapabilityNotSetException if the appropriate capability is
7870: * not set and this object is part of a live or compiled scene graph
7871: *
7872: * @exception IllegalStateException if the data mode for this geometry
7873: * array object is not <code>INTERLEAVED</code>
7874: * or is not <code>USE_NIO_BUFFER</code>.
7875: *
7876: * @exception IllegalArgumentException if the java.nio.Buffer
7877: * contained in the specified J3DBuffer is not a
7878: * java.nio.FloatBuffer object.
7879: *
7880: * @exception ArrayIndexOutOfBoundsException if
7881: * <code>vertexData.getBuffer().limit()</code> < <i>words_per_vertex</i> *
7882: * (<code>initialVertexIndex + validVertexCount</code>),
7883: * where <i>words_per_vertex</i> depends on which formats are enabled.
7884: *
7885: * @exception ArrayIndexOutOfBoundsException if this GeometryArray
7886: * object is a subclass of IndexedGeometryArray, and any element
7887: * in the range
7888: * <code>[initialIndexIndex, initialIndexIndex+validIndexCount-1]</code>
7889: * in the index array associated with any of the enabled vertex
7890: * components (coord, color, normal, texcoord) is greater than or
7891: * equal to the number of vertices defined by the vertexData
7892: * object,
7893: * <code>vertexData.getBuffer().limit() / </code> <i>words_per_vertex</i>.
7894: *
7895: * @since Java 3D 1.3
7896: */
7897: public void setInterleavedVertexBuffer(J3DBuffer vertexData) {
7898: if (isLiveOrCompiled())
7899: if (!this .getCapability(ALLOW_REF_DATA_WRITE))
7900: throw new CapabilityNotSetException(J3dI18N
7901: .getString("GeometryArray86"));
7902:
7903: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7904: if ((format & INTERLEAVED) == 0)
7905: throw new IllegalStateException(J3dI18N
7906: .getString("GeometryArray85"));
7907:
7908: if ((format & USE_NIO_BUFFER) == 0)
7909: throw new IllegalStateException(J3dI18N
7910: .getString("GeometryArray118"));
7911:
7912: ((GeometryArrayRetained) this .retained)
7913: .setInterleavedVertexBuffer(vertexData);
7914:
7915: }
7916:
7917: /**
7918: * Gets the interleaved vertex array buffer reference.
7919: * @return the current interleaved vertex array buffer reference.
7920: *
7921: * @exception CapabilityNotSetException if the appropriate capability is
7922: * not set and this object is part of a live or compiled scene graph
7923: *
7924: * @exception IllegalStateException if the data mode for this geometry
7925: * array object is not <code>INTERLEAVED</code>
7926: * or is not <code>USE_NIO_BUFFER</code>.
7927: *
7928: * @since Java 3D 1.3
7929: */
7930: public J3DBuffer getInterleavedVertexBuffer() {
7931: if (isLiveOrCompiled())
7932: if (!this .getCapability(ALLOW_REF_DATA_READ)
7933: && !this .getCapability(J3D_1_2_ALLOW_REF_DATA_READ)) {
7934: throw new CapabilityNotSetException(J3dI18N
7935: .getString("GeometryArray87"));
7936: }
7937:
7938: int format = ((GeometryArrayRetained) this .retained).vertexFormat;
7939: if ((format & INTERLEAVED) == 0)
7940: throw new IllegalStateException(J3dI18N
7941: .getString("GeometryArray85"));
7942:
7943: if ((format & USE_NIO_BUFFER) == 0)
7944: throw new IllegalStateException(J3dI18N
7945: .getString("GeometryArray118"));
7946:
7947: return ((GeometryArrayRetained) this.retained)
7948: .getInterleavedVertexBuffer();
7949:
7950: }
7951: }
|