Source Code Cross Referenced for IndexedTriangleArray.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: IndexedTriangleArray.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:24 $
029:         * $State: Exp $
030:         */
031:
032:        package javax.media.j3d;
033:
034:        /**
035:         * The IndexedTriangleArray object draws the array of vertices as individual
036:         * triangles.  Each group
037:         * of three vertices defines a triangle to be drawn.
038:         */
039:
040:        public class IndexedTriangleArray extends IndexedGeometryArray {
041:
042:            /**
043:             * Package scoped default constructor.
044:             */
045:            IndexedTriangleArray() {
046:            }
047:
048:            /**
049:             * Constructs an empty IndexedTriangleArray object using the specified
050:             * parameters.
051:             *
052:             * @param vertexCount
053:             * see {@link GeometryArray#GeometryArray(int,int)}
054:             * for a description of this parameter.
055:             *
056:             * @param vertexFormat
057:             * see {@link GeometryArray#GeometryArray(int,int)}
058:             * for a description of this parameter.
059:             *
060:             * @param indexCount
061:             * see {@link IndexedGeometryArray#IndexedGeometryArray(int,int,int)}
062:             * for a description of this parameter.
063:             *
064:             * @exception IllegalArgumentException if vertexCount is less than 1,
065:             * or indexCount is less than 3, or indexCount is <i>not</i>
066:             * a multiple of 3
067:             * ;<br>
068:             * See {@link GeometryArray#GeometryArray(int,int)}
069:             * for more exceptions that can be thrown
070:             */
071:            public IndexedTriangleArray(int vertexCount, int vertexFormat,
072:                    int indexCount) {
073:                super (vertexCount, vertexFormat, indexCount);
074:
075:                if (vertexCount < 1)
076:                    throw new IllegalArgumentException(J3dI18N
077:                            .getString("IndexedTriangleArray0"));
078:
079:                if (indexCount < 3 || ((indexCount % 3) != 0))
080:                    throw new IllegalArgumentException(J3dI18N
081:                            .getString("IndexedTriangleArray1"));
082:            }
083:
084:            /**
085:             * Constructs an empty IndexedTriangleArray object using the specified
086:             * parameters.
087:             *
088:             * @param vertexCount
089:             * see {@link GeometryArray#GeometryArray(int,int,int,int[])}
090:             * for a description of this parameter.
091:             *
092:             * @param vertexFormat
093:             * see {@link GeometryArray#GeometryArray(int,int,int,int[])}
094:             * for a description of this parameter.
095:             *
096:             * @param texCoordSetCount
097:             * see {@link GeometryArray#GeometryArray(int,int,int,int[])}
098:             * for a description of this parameter.
099:             *
100:             * @param texCoordSetMap
101:             * see {@link GeometryArray#GeometryArray(int,int,int,int[])}
102:             * for a description of this parameter.
103:             *
104:             * @param indexCount
105:             * see {@link IndexedGeometryArray#IndexedGeometryArray(int,int,int,int[],int)}
106:             * for a description of this parameter.
107:             *
108:             * @exception IllegalArgumentException if vertexCount is less than 1,
109:             * or indexCount is less than 3, or indexCount is <i>not</i>
110:             * a multiple of 3
111:             * ;<br>
112:             * See {@link GeometryArray#GeometryArray(int,int,int,int[])}
113:             * for more exceptions that can be thrown
114:             *
115:             * @since Java 3D 1.2
116:             */
117:            public IndexedTriangleArray(int vertexCount, int vertexFormat,
118:                    int texCoordSetCount, int[] texCoordSetMap, int indexCount) {
119:
120:                super (vertexCount, vertexFormat, texCoordSetCount,
121:                        texCoordSetMap, indexCount);
122:
123:                if (vertexCount < 1)
124:                    throw new IllegalArgumentException(J3dI18N
125:                            .getString("IndexedTriangleArray0"));
126:
127:                if (indexCount < 3 || ((indexCount % 3) != 0))
128:                    throw new IllegalArgumentException(J3dI18N
129:                            .getString("IndexedTriangleArray1"));
130:            }
131:
132:            /**
133:             * Constructs an empty IndexedTriangleArray object using the specified
134:             * parameters.
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 indexCount
157:             * see {@link IndexedGeometryArray#IndexedGeometryArray(int,int,int,int[],int,int[],int)}
158:             * for a description of this parameter.
159:             *
160:             * @exception IllegalArgumentException if vertexCount is less than 1,
161:             * or indexCount is less than 3, or indexCount is <i>not</i>
162:             * a multiple of 3
163:             * ;<br>
164:             * See {@link GeometryArray#GeometryArray(int,int,int,int[],int,int[])}
165:             * for more exceptions that can be thrown
166:             *
167:             * @since Java 3D 1.4
168:             */
169:            public IndexedTriangleArray(int vertexCount, int vertexFormat,
170:                    int texCoordSetCount, int[] texCoordSetMap,
171:                    int vertexAttrCount, int[] vertexAttrSizes, int indexCount) {
172:
173:                super (vertexCount, vertexFormat, texCoordSetCount,
174:                        texCoordSetMap, vertexAttrCount, vertexAttrSizes,
175:                        indexCount);
176:
177:                if (vertexCount < 1)
178:                    throw new IllegalArgumentException(J3dI18N
179:                            .getString("IndexedTriangleArray0"));
180:
181:                if (indexCount < 3 || ((indexCount % 3) != 0))
182:                    throw new IllegalArgumentException(J3dI18N
183:                            .getString("IndexedTriangleArray1"));
184:            }
185:
186:            /**
187:             * Creates the retained mode IndexedTriangleArrayRetained object that this
188:             * IndexedTriangleArray object will point to.
189:             */
190:            void createRetained() {
191:                this .retained = new IndexedTriangleArrayRetained();
192:                this .retained.setSource(this );
193:            }
194:
195:            /**
196:             * @deprecated replaced with cloneNodeComponent(boolean forceDuplicate)
197:             */
198:            public NodeComponent cloneNodeComponent() {
199:                IndexedTriangleArrayRetained rt = (IndexedTriangleArrayRetained) retained;
200:                int texSetCount = rt.getTexCoordSetCount();
201:                int[] texMap = null;
202:                int vertexAttrCount = rt.getVertexAttrCount();
203:                int[] vertexAttrSizes = null;
204:                if (texSetCount > 0) {
205:                    texMap = new int[rt.getTexCoordSetMapLength()];
206:                    rt.getTexCoordSetMap(texMap);
207:                }
208:                if (vertexAttrCount > 0) {
209:                    vertexAttrSizes = new int[vertexAttrCount];
210:                    rt.getVertexAttrSizes(vertexAttrSizes);
211:                }
212:                IndexedTriangleArray t = new IndexedTriangleArray(rt
213:                        .getVertexCount(), rt.getVertexFormat(), texSetCount,
214:                        texMap, vertexAttrCount, vertexAttrSizes, rt
215:                                .getIndexCount());
216:                t.duplicateNodeComponent(this);
217:                return t;
218:            }
219:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.