Source Code Cross Referenced for Cone.java in  » 6.0-JDK-Modules » java-3d » org » jdesktop » j3d » loaders » vrml97 » impl » 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 » org.jdesktop.j3d.loaders.vrml97.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $RCSfile: Cone.java,v $
003:         *
004:         *      @(#)Cone.java 1.24 98/11/05 20:34:08
005:         *
006:         * Copyright (c) 1996-1998 Sun Microsystems, Inc. All Rights Reserved.
007:         *
008:         * Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
009:         * modify and redistribute this software in source and binary code form,
010:         * provided that i) this copyright notice and license appear on all copies of
011:         * the software; and ii) Licensee does not utilize the software in a manner
012:         * which is disparaging to Sun.
013:         *
014:         * This software is provided "AS IS," without a warranty of any kind. ALL
015:         * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
016:         * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
017:         * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
018:         * LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
019:         * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
020:         * LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
021:         * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
022:         * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
023:         * OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
024:         * POSSIBILITY OF SUCH DAMAGES.
025:         *
026:         * This software is not designed or intended for use in on-line control of
027:         * aircraft, air traffic, aircraft navigation or aircraft communications; or in
028:         * the design, construction, operation or maintenance of any nuclear
029:         * facility. Licensee represents and warrants that it will not use or
030:         * redistribute the Software for such purposes.
031:         *
032:         * $Revision: 1.3 $
033:         * $Date: 2006/03/28 14:58:09 $
034:         * $State: Exp $
035:         */
036:        /*
037:         *@Author:  Rick Goldberg
038:         *@Author:  Doug Gehringer
039:         *@Author:  Nikolai V. Chr.
040:         *
041:         */
042:        package org.jdesktop.j3d.loaders.vrml97.impl;
043:
044:        import javax.media.j3d.BoundingBox;
045:        import javax.vecmath.Point3d;
046:
047:        /**  Description of the Class */
048:        public class Cone extends GroupGeom {
049:
050:            // field
051:            SFFloat bottomRadius;
052:            SFFloat height;
053:            SFBool side;
054:            SFBool bottom;
055:
056:            BoundingBox bounds;
057:
058:            /**
059:             *Constructor for the Cone object
060:             *
061:             *@param  loader Description of the Parameter
062:             */
063:            public Cone(Loader loader) {
064:                super (loader);
065:                bottomRadius = new SFFloat(1.0f);
066:                height = new SFFloat(2.0f);
067:                side = new SFBool(true);
068:                bottom = new SFBool(true);
069:                initFields();
070:            }
071:
072:            /**
073:             *Constructor for the Cone object
074:             *
075:             *@param  loader Description of the Parameter
076:             *@param  bottomRadius Description of the Parameter
077:             *@param  height Description of the Parameter
078:             *@param  side Description of the Parameter
079:             *@param  bottom Description of the Parameter
080:             */
081:            Cone(Loader loader, SFFloat bottomRadius, SFFloat height,
082:                    SFBool side, SFBool bottom) {
083:                super (loader);
084:                this .bottomRadius = bottomRadius;
085:                this .height = height;
086:                this .side = side;
087:                this .bottom = bottom;
088:                initFields();
089:            }
090:
091:            /**  Description of the Method */
092:            void initFields() {
093:                bottomRadius.init(this , FieldSpec, Field.FIELD, "bottomRadius");
094:                height.init(this , FieldSpec, Field.FIELD, "height");
095:                side.init(this , FieldSpec, Field.FIELD, "side");
096:                bottom.init(this , FieldSpec, Field.FIELD, "bottom");
097:            }
098:
099:            /**
100:             *  Description of the Method
101:             *
102:             *@param  eventInName Description of the Parameter
103:             *@param  time Description of the Parameter
104:             */
105:            public void notifyMethod(String eventInName, double time) {
106:                ;
107:            }
108:
109:            /**
110:             *  Description of the Method
111:             *
112:             *@return  Description of the Return Value
113:             */
114:            public Object clone() {
115:                return new Cone(loader, (SFFloat) bottomRadius.clone(),
116:                        (SFFloat) height.clone(), (SFBool) side.clone(),
117:                        (SFBool) bottom.clone());
118:            }
119:
120:            /**  Description of the Method */
121:            public void initImpl() {
122:                ;
123:            }
124:
125:            /**
126:             *  Description of the Method
127:             *
128:             *@param  ap Description of the Parameter
129:             *@return  Description of the Return Value
130:             */
131:            public javax.media.j3d.Group initGroupImpl(
132:                    javax.media.j3d.Appearance ap) {
133:                implGroup = new com.sun.j3d.utils.geometry.Cone(
134:                        bottomRadius.value,
135:                        height.value,
136:                        com.sun.j3d.utils.geometry.Primitive.GENERATE_NORMALS
137:                                | com.sun.j3d.utils.geometry.Primitive.GEOMETRY_NOT_SHARED
138:                                | com.sun.j3d.utils.geometry.Primitive.GENERATE_TEXTURE_COORDS,
139:                        30, 4, ap);
140:
141:                ((javax.media.j3d.Node) implGroup)
142:                        .clearCapability(javax.media.j3d.Node.ENABLE_PICK_REPORTING);
143:
144:                // The util constructs a group with the side, and bottom as
145:                // children.  Handle removing the elements by moving from the end of
146:                // the group to the beginning
147:                if (loader.debug) {
148:                    System.out.println("Cone group before edit: ");
149:                    loader.treePrinter.print(implGroup);
150:                }
151:                if (!bottom.value) {
152:                    if (loader.debug) {
153:                        System.out.println("no bottom");
154:                    }
155:                    ((javax.media.j3d.Group) implGroup)
156:                            .removeChild(com.sun.j3d.utils.geometry.Cone.CAP);
157:                }
158:                if (!side.value) {
159:                    if (loader.debug) {
160:                        System.out.println("no side");
161:                    }
162:                    ((javax.media.j3d.Group) implGroup)
163:                            .removeChild(com.sun.j3d.utils.geometry.Cone.BODY);
164:                }
165:                if (loader.debug) {
166:                    System.out.println("Cone group after edit: ");
167:                    loader.treePrinter.print(implGroup);
168:                }
169:
170:                bounds = new BoundingBox(new Point3d(-bottomRadius.value,
171:                        -height.value / 2.0, -bottomRadius.value), new Point3d(
172:                        bottomRadius.value, height.value / 2.0,
173:                        bottomRadius.value));
174:                return implGroup;
175:            }
176:
177:            /**
178:             *  Gets the boundingBox attribute of the Cone object
179:             *
180:             *@return  The boundingBox value
181:             */
182:            public BoundingBox getBoundingBox() {
183:                return bounds;
184:            }
185:
186:            /**
187:             *  Gets the implGeom attribute of the Cone object
188:             *
189:             *@return  The implGeom value
190:             */
191:            public javax.media.j3d.Geometry getImplGeom() {
192:                // should not be called
193:                throw new NullPointerException();
194:            }
195:
196:            // this should perhaps be renamed haveTextureCoords().
197:            /**
198:             *  Description of the Method
199:             *
200:             *@return  Description of the Return Value
201:             */
202:            public boolean haveTexture() {
203:                return true;
204:            }
205:
206:            /**
207:             *  Gets the type attribute of the Cone object
208:             *
209:             *@return  The type value
210:             */
211:            public String getType() {
212:                return "Cone";
213:            }
214:
215:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.