001: /*
002: * $RCSfile: BHLeafNode.java,v $
003: *
004: * Copyright 1999-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:19 $
029: * $State: Exp $
030: */
031:
032: package javax.media.j3d;
033:
034: import javax.vecmath.*;
035:
036: class BHLeafNode extends BHNode {
037:
038: BHLeafInterface leafIF;
039:
040: BHLeafNode() {
041: super ();
042: nodeType = BH_TYPE_LEAF;
043: leafIF = null;
044: }
045:
046: BHLeafNode(BHNode parent) {
047: super (parent);
048: nodeType = BH_TYPE_LEAF;
049: }
050:
051: BHLeafNode(BHLeafInterface lIF) {
052: super ();
053: nodeType = BH_TYPE_LEAF;
054: leafIF = lIF;
055: }
056:
057: BHLeafNode(BHNode parent, BHLeafInterface lIF) {
058: super (parent);
059: leafIF = lIF;
060: nodeType = BH_TYPE_LEAF;
061: }
062:
063: BHLeafNode(BHNode parent, BoundingBox bHull) {
064: super (parent, bHull);
065: nodeType = BH_TYPE_LEAF;
066: }
067:
068: BHLeafNode(BHNode parent, BHLeafInterface lIF, BoundingBox bHull) {
069: super (parent, bHull);
070: leafIF = lIF;
071: nodeType = BH_TYPE_LEAF;
072: }
073:
074: void computeBoundingHull() {
075: bHull = leafIF.computeBoundingHull();
076: }
077:
078: void updateMarkedBoundingHull() {
079:
080: if (mark == false)
081: return;
082:
083: computeBoundingHull();
084: mark = false;
085: }
086:
087: boolean isEnable() {
088: return leafIF.isEnable();
089: }
090:
091: boolean isEnable(int vis) {
092: return leafIF.isEnable(vis);
093: }
094:
095: Locale getLocale() {
096: return leafIF.getLocale2();
097: }
098:
099: void destroyTree(BHNode[] bhArr, int[] index) {
100: if (bhArr.length <= index[0]) {
101: // System.err.println("BHLeafNode : Problem bhArr overflow!!!");
102: return;
103: }
104:
105: parent = null;
106: bhArr[index[0]] = this ;
107: index[0]++;
108: }
109:
110: }
|