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

📄 geometryinfo.java

📁 JAVA3D矩陈的相关类
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
      texCoordSets = new TexCoord2f[1][];      setTextureCoordinates(0, texCoords);  } // End of setTextureCoordinates2(float[])   /**   * Sets the TextureCoordinates array by copying the data   * into the GeometryInfo object, assuming three numbers   * (S, T, &amp; R) per vertex.   * This method sets the number of texture coordinate sets to 1,   * sets the dimensionality of the texture coordinates to 3,   * and sets the coordinates for texture coordinate set 0.   * @deprecated As of Java 3D 1.3 replaced by    * <code>setTextureCoordinates(int texCoordSet, float texCoords[])</code>   */  public void setTextureCoordinates3(float texCoords[])  {      texCoordSetCount = 1;      texCoordDim = 3;      texCoordSets = new TexCoord3f[1][];      setTextureCoordinates(0, texCoords);  } // End of setTextureCoordinates3(float[])  /**   * Returns a reference to the indicated texture coordinate array.   * The return type will be <code>TexCoord2f[]</code>, <code>TexCoord3f[]   * </code>, or <code>TexCoord4f[]</code> depending on the    * current dimensionality of the texture coordinates in the GeometryInfo   * object.  Use <code>getNumTexCoordComponents()</code> to find out which    * version is returned.   * @param texCoordSet The index of the texture coordinate set to   * retrieve.   * @return An array of texture coordinates at the specified index   * @throws IllegalArgumentException If <code> texCoordSet</code> < 0   * or <code>texCoordSet >= texCoordSetCount</code>   */  public Object[] getTextureCoordinates(int texCoordSet)  {      if ((texCoordSet >= texCoordSetCount) || (texCoordSet < 0))	  throw new IllegalArgumentException(	      J3dUtilsI18N.getString("GeometryInfo18"));      return texCoordSets[texCoordSet];  } // End of getTextureCoordinates(int)     /**   * Retrieves a reference to texture coordinate set 0.   * The return type will be <code>TexCoord2f[]</code>, <code>TexCoord3f[]   * </code>, or <code>TexCoord4f[]</code> depending on the    * current dimensionality of the texture coordinates in the GeometryInfo   * object.  Use <code>getNumTexCoordComponents()</code> to find out which    * version is returned.  Equivalent to <code>getTextureCoordinates(0)</code>.   * @return An array of texture coordinates for set 0.   * @deprecated As of Java 3D 1.3 replaced by    * <code>getTextureCoordinates(int texCoordSet)</code>   */  public Object[] getTextureCoordinates()  {      return texCoordSets[0];  } // End of getTextureCoordinates()    /**   * Sets the array of indices into the Coordinate array.   * No data copying is done - a reference to user data is used.    */  public void setCoordinateIndices(int coordinateIndices[])  {      this.coordinateIndices = coordinateIndices;  } // End of setCoordinateIndices  /**   * Retrieves a reference to the array of indices into the   * coordinate array.</p>   *   * This method should be considered for advanced users only.   * Novice users should just use getGeometryArray() to retrieve   * their data so that the internal format of GeometryInfo is   * of no concern.</p>   *   * Depending on which of the utility routines you've called   * on your GeometryInfo object, the results may not be what you   * expect.  If you've called the Stripifier, your GeometryInfo   * object's Primitive has been changed to indexed TRIANGLE_STRIP_ARRAY   * and your data will be formatted accordingly.  Similarly, if   * you've called the Triangulator, your data is in indexed   * TRIANGLE_ARRAY format.  Generating normals with the NormalGenerator   * utility will convert your data to indexed TRIANGLE_ARRAY also,   * but if you call getGeometryArray without calling the Stripifier or   * Triangulator, your data will be converted back to the original   * primitive type when creating the GeometryArray object to pass   * back.  However, if your creaseAngle was not Math.PI (no creases -   * smooth shading), then the introduction of   * creases into your model may have split primitives, lengthening    * the StripCounts and index arrays from your original data.   */  public int[] getCoordinateIndices()  {      return coordinateIndices;  } // End of getCoordinateIndices  /**   * Sets the array of indices into the Color array.   * No data copying is done - a reference to user data is used.    */  public void setColorIndices(int colorIndices[])  {      this.colorIndices = colorIndices;  } // End of setColorIndices  /**   * Retrieves a reference to the array of indices into the   * color array.</p>   *   * This method should be considered for advanced users only.   * Novice users should just use getGeometryArray() to retrieve   * their data so that the internal format of GeometryInfo is   * of no concern.</p>   *   * Depending on which of the utility routines you've called   * on your GeometryInfo object, the results may not be what you   * expect.  If you've called the Stripifier, your GeometryInfo   * object's Primitive has been changed to indexed TRIANGLE_STRIP_ARRAY   * and your data will be formatted accordingly.  Similarly, if   * you've called the Triangulator, your data is in indexed   * TRIANGLE_ARRAY format.  Generating normals with the NormalGenerator   * utility will convert your data to indexed TRIANGLE_ARRAY also,   * but if you call getGeometryArray without calling the Stripifier or   * Triangulator, your data will be converted back to the original   * primitive type when creating the GeometryArray object to pass   * back.  However, if your creaseAngle was not Math.PI (no creases -   * smooth shading), then the introduction of   * creases into your model may have split primitives, lengthening   * the StripCounts and index arrays from your original data.   */  public int[] getColorIndices()  {      return colorIndices;  } // End of getColorIndices  /**   * Sets the array of indices into the Normal array.   * No data copying is done - a reference to user data is used.    */  public void setNormalIndices(int normalIndices[])  {      this.normalIndices = normalIndices;        } // End of setNormalIndices  /**   * Retrieves a reference to the array of indices into the   * Normal array.</p>   *   * This method should be considered for advanced users only.   * Novice users should just use getGeometryArray() to retrieve   * their data so that the internal format of GeometryInfo is   * of no concern.</p>   *   * Depending on which of the utility routines you've called   * on your GeometryInfo object, the results may not be what you   * expect.  If you've called the Stripifier, your GeometryInfo   * object's Primitive has been changed to indexed TRIANGLE_STRIP_ARRAY   * and your data will be formatted accordingly.  Similarly, if   * you've called the Triangulator, your data is in indexed   * TRIANGLE_ARRAY format.  Generating normals with the NormalGenerator   * utility will convert your data to indexed TRIANGLE_ARRAY also,   * but if you call getGeometryArray without calling the Stripifier or   * Triangulator, your data will be converted back to the original   * primitive type when creating the GeometryArray object to pass   * back.  However, if your creaseAngle was not Math.PI (no creases -   * smooth shading), then the introduction of   * creases into your model may have split primitives, lengthening   * the StripCounts and index arrays from your original data.   */  public int[] getNormalIndices()  {      return normalIndices;  } // End of getNormalIndices    /**   * Sets one of the texture coordinate index arrays.   * No data copying is done - a reference to user data is used.    * @param texCoordSet The texture coordinate set for which these coordinate    * indices are being specified.   * @param texIndices The integer array of indices into the specified texture    * coordinate set   * @throws IllegalArgumentException If <code> texCoordSet</code> < 0 or   * <code>texCoordSet >= texCoordSetCount</code>.   */  public void setTextureCoordinateIndices(int texCoordSet, int texIndices[])  {      if ((texCoordSet >= texCoordSetCount) || (texCoordSet < 0))	  throw new IllegalArgumentException(		  J3dUtilsI18N.getString("GeometryInfo18"));            // Texture coordinates are indexed       texCoordIndexSets[texCoordSet] = texIndices;  } // End of setTextureCoordinateIndices(int, int[])  /**   * Sets the array of indices into texture coordinate set 0.  Do not   * call this method if you are using more than one set of texture   * coordinates.   * No data is copied - a reference to the user data is used.   * @deprecated As of Java 3D 1.3 replaced by    * <code>setTextureCoordinateIndices(int texCoordSet, int indices[])</code>   * @throws IllegalArgumentException If <code>texCoordSetCount > 1</code>.   */  public void setTextureCoordinateIndices(int texIndices[])  {      if (texCoordSetCount > 1) 	  throw new IllegalArgumentException(		  J3dUtilsI18N.getString("GeometryInfo1"));      texCoordIndexSets = new int[1][];      texCoordIndexSets[0] = texIndices;  } // End of setTextureCoordinateIndices(int[])  /**   * Retrieves a reference to the specified array of texture   * coordinate indices.<p>   *   * This method should be considered for advanced users only.   * Novice users should just use getGeometryArray() to retrieve   * their data so that the internal format of GeometryInfo is   * of no concern.</p>   *   * Depending on which of the utility routines you've called   * on your GeometryInfo object, the results may not be what you   * expect.  If you've called the Stripifier, your GeometryInfo   * object's Primitive has been changed to indexed TRIANGLE_STRIP_ARRAY   * and your data will be formatted accordingly.  Similarly, if   * you've called the Triangulator, your data is in indexed   * TRIANGLE_ARRAY format.  Generating normals with the NormalGenerator   * utility will convert your data to indexed TRIANGLE_ARRAY also,   * but if you call getGeometryArray without calling the Stripifier or   * Triangulator, your data will be converted back to the original   * primitive type when creating the GeometryArray object to pass   * back.  However, if your creaseAngle was not Math.PI (no creases -   * smooth shading), then the introduction of   * creases into your model may have split primitives, lengthening   * the StripCounts and index arrays from your original data.   * @param texCoordSet The texture coordinate index set to be   * retrieved.   * @return Integer array of the texture coordinate indices for the specified   * set.   */  public int[] getTextureCoordinateIndices(int texCoordSet) {      return texCoordIndexSets[texCoordSet];  }  /**   * Returns a reference to texture coordinate index set 0.   * Equivalent to   * <code>getTextureCoordinateIndices(0)</code>.   * @deprecated As of Java 3D 1.3 replaced by    * <code>int[] getTextureCoordinateIndices(int texCoordSet) </code>   * @return Integer array of the texture coordinate indices for set 0   */  public int[] getTextureCoordinateIndices()  {      if (texCoordIndexSets == null) return null;      return texCoordIndexSets[0];  } // End of getTextureCoordinateIndices()     /**   * Sets the array of strip counts.  If index lists have been set for   * this GeomteryInfo object then the data is indexed and the stripCounts   * are like stripIndexCounts.  If no index lists have been set then   * the data is non-indexed and the stripCounts are like    * stripVertexCounts.   * @see GeometryStripArray#GeometryStripArray(int, int,   * int[] stripVertexCounts)   * @see IndexedGeometryStripArray#IndexedGeometryStripArray(int, int, int,   * int[] stripIndexCounts)   */  public void setStripCounts(int stripCounts[])  {      this.stripCounts = stripCounts;  } // End of setStripCounts   /**   * Retrieves a reference to the array of stripCounts.</p>   *   * This method should be considered for advanced users only.   * Novice users should just use getGeometryArray() to retrieve   * their data so that the internal format of GeometryInfo is   * of no concern.</p>   *   * Depending on which of the utility routines you've called   * on your GeometryInfo object, the results may not be what you   * expect.  If you've called the Stripifier, your GeometryInfo   * object's Primitive has been changed to indexed TRIANGLE_STRIP_ARRAY   * and your data will be formatted accordingly.  Similarly, if   * you've called the Triangulator, your data is in indexed   * TRIANGLE_ARRAY format.  Generating normals with the NormalGenerator   * utility will convert your data to indexed TRIANGLE_ARRAY also,   * but if you call getGeometryArray without calling the Stripifier or   * Triangulator, your data will be converted back to the original   * primitive type when creating the GeometryArray object to pass   * back.  However, if your creaseAngle was not Math.PI (no creases -   * smooth shading), then the introduction of   * creases into your model may have split primitives, lengthening   * the StripCounts and index arrays from your original data.   */  public int[] getStripCounts()  {      return stripCounts;  } // End of getStripCounts   /**   * Sets the list of contour counts.  Only used with the POLYGON_ARRAY   * primitive.  Polygons can be made of several vertex lists    * called contours.  The first list is the polygon, and    * subsequent lists are "holes" that are removed from the   * polygon.  All of the holes must be contained entirely   * within the polygon.   */  public void setContourCounts(int contourCounts[])  {      this.contourCounts = contourCounts;  } // End of setContourCounts  /**   * Retrieves a reference to the array of contourCounts.   */  public int[] getContourCounts()  {      return contourCounts;  } // End of getContourCounts  /*   * This routine will return an index list for any array of objects.   */  int[] getListIndices(Object list[])  {      // Create list of indices to return      int indices[] = new int[list.length];            // Create hash table with initial capacity equal to the number      // of components (assuming about half will be duplicates)      HashMap table = new HashMap(list.length);            Integer idx;      for (int i = 0 ; i < list.length ; i++) {	  	  // Find index associated with this object	  idx = (Integer)table.get(list[i]);	  	  if (idx == null) {	      // We haven't seen this object before

⌨️ 快捷键说明

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