Source Code Cross Referenced for GeometryStripArray.java in  » 6.0-JDK-Modules » java-3d » javax » media » j3d » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » java 3d » javax.media.j3d 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $RCSfile: GeometryStripArray.java,v $
003:         *
004:         * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
005:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
006:         *
007:         * This code is free software; you can redistribute it and/or modify it
008:         * under the terms of the GNU General Public License version 2 only, as
009:         * published by the Free Software Foundation.  Sun designates this
010:         * particular file as subject to the "Classpath" exception as provided
011:         * by Sun in the LICENSE file that accompanied this code.
012:         *
013:         * This code is distributed in the hope that it will be useful, but WITHOUT
014:         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
015:         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
016:         * version 2 for more details (a copy is included in the LICENSE file that
017:         * accompanied this code).
018:         *
019:         * You should have received a copy of the GNU General Public License version
020:         * 2 along with this work; if not, write to the Free Software Foundation,
021:         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
022:         *
023:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
024:         * CA 95054 USA or visit www.sun.com if you need additional information or
025:         * have any questions.
026:         *
027:         * $Revision: 1.6 $
028:         * $Date: 2008/02/28 20:17:22 $
029:         * $State: Exp $
030:         */
031:
032:        package javax.media.j3d;
033:
034:        /**
035:         * The GeometryStripArray object is an abstract class that is extended for
036:         * a set of GeometryArray strip primitives.  These include LINE_STRIP,
037:         * TRIANGLE_STRIP, and TRIANGLE_FAN. In addition to specifying the array
038:         * of vertex elements, which is inherited from GeometryArray, the
039:         * GeometryStripArray class specifies the number of strips and an
040:         * array of per-strip vertex counts that specify where the separate strips
041:         * appear in the vertex array.
042:         */
043:
044:        public abstract class GeometryStripArray extends GeometryArray {
045:
046:            // non-public, no parameter constructor
047:            GeometryStripArray() {
048:            }
049:
050:            /**
051:             * Constructs an empty GeometryStripArray object with the specified
052:             * number of vertices, vertex format, and
053:             * array of per-strip vertex counts.
054:             *
055:             * @param vertexCount
056:             * see {@link GeometryArray#GeometryArray(int,int)}
057:             * for a description of this parameter.
058:             *
059:             * @param vertexFormat
060:             * see {@link GeometryArray#GeometryArray(int,int)}
061:             * for a description of this parameter.
062:             *
063:             * @param stripVertexCounts array that specifies
064:             * the count of the number of vertices for each separate strip.
065:             * The length of this array is the number of separate strips.
066:             * The sum of the elements in this array defines the total number
067:             * of valid vertices that are rendered (validVertexCount).
068:             *
069:             * @exception IllegalArgumentException if
070:             * <code>validVertexCount &gt; vertexCount</code>
071:             * ;<br>
072:             * See {@link GeometryArray#GeometryArray(int,int)}
073:             * for more exceptions that can be thrown
074:             */
075:            public GeometryStripArray(int vertexCount, int vertexFormat,
076:                    int[] stripVertexCounts) {
077:
078:                super (vertexCount, vertexFormat);
079:                ((GeometryStripArrayRetained) this .retained)
080:                        .setStripVertexCounts(stripVertexCounts);
081:            }
082:
083:            /**
084:             * Constructs an empty GeometryStripArray object with the specified
085:             * number of vertices, vertex format, number of texture coordinate
086:             * sets, texture coordinate mapping array, and
087:             * array of per-strip vertex counts.
088:             *
089:             * @param vertexCount
090:             * see {@link GeometryArray#GeometryArray(int,int,int,int[])}
091:             * for a description of this parameter.
092:             *
093:             * @param vertexFormat
094:             * see {@link GeometryArray#GeometryArray(int,int,int,int[])}
095:             * for a description of this parameter.
096:             *
097:             * @param texCoordSetCount
098:             * see {@link GeometryArray#GeometryArray(int,int,int,int[])}
099:             * for a description of this parameter.
100:             *
101:             * @param texCoordSetMap
102:             * see {@link GeometryArray#GeometryArray(int,int,int,int[])}
103:             * for a description of this parameter.
104:             *
105:             * @param stripVertexCounts array that specifies
106:             * the count of the number of vertices for each separate strip.
107:             * The length of this array is the number of separate strips.
108:             * The sum of the elements in this array defines the total number
109:             * of valid vertices that are rendered (validVertexCount).
110:             *
111:             * @exception IllegalArgumentException if
112:             * <code>validVertexCount &gt; vertexCount</code>
113:             * ;<br>
114:             * See {@link GeometryArray#GeometryArray(int,int,int,int[])}
115:             * for more exceptions that can be thrown
116:             *
117:             * @since Java 3D 1.2
118:             */
119:            public GeometryStripArray(int vertexCount, int vertexFormat,
120:                    int texCoordSetCount, int[] texCoordSetMap,
121:                    int[] stripVertexCounts) {
122:
123:                super (vertexCount, vertexFormat, texCoordSetCount,
124:                        texCoordSetMap);
125:                ((GeometryStripArrayRetained) this .retained)
126:                        .setStripVertexCounts(stripVertexCounts);
127:            }
128:
129:            /**
130:             * Constructs an empty GeometryStripArray object with the
131:             * specified number of vertices, vertex format, number of texture
132:             * coordinate sets, texture coordinate mapping array, vertex
133:             * attribute count, vertex attribute sizes array, and array of
134:             * per-strip vertex counts.
135:             *
136:             * @param vertexCount
137:             * see {@link GeometryArray#GeometryArray(int,int,int,int[],int,int[])}
138:             * for a description of this parameter.
139:             *
140:             * @param vertexFormat
141:             * see {@link GeometryArray#GeometryArray(int,int,int,int[],int,int[])}
142:             * for a description of this parameter.
143:             *
144:             * @param texCoordSetMap
145:             * see {@link GeometryArray#GeometryArray(int,int,int,int[],int,int[])}
146:             * for a description of this parameter.
147:             *
148:             * @param vertexAttrCount
149:             * see {@link GeometryArray#GeometryArray(int,int,int,int[],int,int[])}
150:             * for a description of this parameter.
151:             *
152:             * @param vertexAttrSizes
153:             * see {@link GeometryArray#GeometryArray(int,int,int,int[],int,int[])}
154:             * for a description of this parameter.
155:             *
156:             * @param stripVertexCounts array that specifies
157:             * the count of the number of vertices for each separate strip.
158:             * The length of this array is the number of separate strips.
159:             * The sum of the elements in this array defines the total number
160:             * of valid vertices that are rendered (validVertexCount).
161:             *
162:             * @exception IllegalArgumentException if
163:             * <code>validVertexCount &gt; vertexCount</code>
164:             * ;<br>
165:             * See {@link GeometryArray#GeometryArray(int,int,int,int[],int,int[])}
166:             * for more exceptions that can be thrown
167:             *
168:             * @since Java 3D 1.4
169:             */
170:            public GeometryStripArray(int vertexCount, int vertexFormat,
171:                    int texCoordSetCount, int[] texCoordSetMap,
172:                    int vertexAttrCount, int[] vertexAttrSizes,
173:                    int[] stripVertexCounts) {
174:
175:                super (vertexCount, vertexFormat, texCoordSetCount,
176:                        texCoordSetMap, vertexAttrCount, vertexAttrSizes);
177:
178:                ((GeometryStripArrayRetained) this .retained)
179:                        .setStripVertexCounts(stripVertexCounts);
180:            }
181:
182:            /**
183:             * Get number of strips in the GeometryStripArray.
184:             * @return numStrips number of strips
185:             */
186:            public int getNumStrips() {
187:                if (isLiveOrCompiled())
188:                    if (!this .getCapability(GeometryArray.ALLOW_COUNT_READ))
189:                        throw new CapabilityNotSetException(J3dI18N
190:                                .getString("GeometryStripArray0"));
191:
192:                return ((GeometryStripArrayRetained) this .retained)
193:                        .getNumStrips();
194:            }
195:
196:            /**
197:             * Sets the array of strip vertex counts.  The length of this
198:             * array is the number of separate strips.  The elements in this
199:             * array specify the number of vertices for each separate strip.
200:             * The sum of the elements in this array defines the total number
201:             * of valid vertices that are rendered (validVertexCount).
202:             *
203:             * @param stripVertexCounts array that specifies
204:             * the count of the number of vertices for each separate strip.
205:             *
206:             * @exception IllegalArgumentException if any of the following are
207:             * true:
208:             * <ul>
209:             * <code>initialVertexIndex + validVertexCount > vertexCount</code>,<br>
210:             * <code>initialCoordIndex + validVertexCount > vertexCount</code>,<br>
211:             * <code>initialColorIndex + validVertexCount > vertexCount</code>,<br>
212:             * <code>initialNormalIndex + validVertexCount > vertexCount</code>,<br>
213:             * <code>initialTexCoordIndex + validVertexCount > vertexCount</code>
214:             * </ul>
215:             * <p>
216:             *
217:             * @exception ArrayIndexOutOfBoundsException if the geometry data format
218:             * is <code>BY_REFERENCE</code> and any the following
219:             * are true for non-null array references:
220:             * <ul>
221:             * <code>CoordRef.length</code> < <i>num_words</i> *
222:             * (<code>initialCoordIndex + validVertexCount</code>)<br>
223:             * <code>ColorRef.length</code> < <i>num_words</i> *
224:             * (<code>initialColorIndex + validVertexCount</code>)<br>
225:             * <code>NormalRef.length</code> < <i>num_words</i> *
226:             * (<code>initialNormalIndex + validVertexCount</code>)<br>
227:             * <code>TexCoordRef.length</code> < <i>num_words</i> *
228:             * (<code>initialTexCoordIndex + validVertexCount</code>)<br>
229:             * </ul>
230:             * where <i>num_words</i> depends on which variant of
231:             * <code>set</code><i>Array</i><code>Ref</code> is used.
232:             *
233:             * @since Java 3D 1.3
234:             */
235:            public void setStripVertexCounts(int[] stripVertexCounts) {
236:                if (isLiveOrCompiled())
237:                    if (!this .getCapability(GeometryArray.ALLOW_COUNT_WRITE))
238:                        throw new CapabilityNotSetException(J3dI18N
239:                                .getString("GeometryStripArray2"));
240:
241:                ((GeometryStripArrayRetained) this .retained)
242:                        .setStripVertexCounts(stripVertexCounts);
243:
244:            }
245:
246:            /**
247:             * Get a list of vertexCounts for each strip. The list is copied
248:             * into the specified array. The array must be large enough to hold 
249:             * all of the ints.
250:             * @param stripVertexCounts an array that will receive vertexCounts
251:             */
252:            public void getStripVertexCounts(int[] stripVertexCounts) {
253:                if (isLiveOrCompiled())
254:                    if (!this .getCapability(GeometryArray.ALLOW_COUNT_READ))
255:                        throw new CapabilityNotSetException(J3dI18N
256:                                .getString("GeometryStripArray1"));
257:
258:                ((GeometryStripArrayRetained) this .retained)
259:                        .getStripVertexCounts(stripVertexCounts);
260:            }
261:
262:            /**
263:             * This method is not supported for geometry strip arrays.
264:             * The sum of the elements in the strip vertex counts array
265:             * defines the valid vertex count.
266:             *
267:             * @exception UnsupportedOperationException this method is not supported
268:             *
269:             * @since Java 3D 1.3
270:             */
271:            public void setValidVertexCount(int validVertexCount) {
272:                throw new UnsupportedOperationException();
273:            }
274:
275:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.