001: /*
002: * $RCSfile: VisibilitySensor.java,v $
003: *
004: * @(#)VisibilitySensor.java 1.12 98/11/05 20:35:30
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.2 $
033: * $Date: 2005/02/03 23:07:04 $
034: * $State: Exp $
035: */
036: /*
037: * @Author: Rick Goldberg
038: *
039: */
040: package org.jdesktop.j3d.loaders.vrml97.impl;
041:
042: /** Description of the Class */
043: public class VisibilitySensor extends Node {
044:
045: // exposedField
046: SFVec3f center;
047: SFBool enabled;
048: SFVec3f size;
049:
050: // Event outs
051: SFBool isActive;
052: SFTime enterTime;
053: SFTime exitTime;
054:
055: /**
056: *Constructor for the VisibilitySensor object
057: *
058: *@param loader Description of the Parameter
059: */
060: public VisibilitySensor(Loader loader) {
061: super (loader);
062: enabled = new SFBool(true);
063: isActive = new SFBool(true);
064: enterTime = new SFTime(0.0);
065: exitTime = new SFTime(0.0);
066: loader.addVisibilitySensor(this );
067: initFields();
068: }
069:
070: /**
071: *Constructor for the VisibilitySensor object
072: *
073: *@param loader Description of the Parameter
074: *@param enabled Description of the Parameter
075: *@param center Description of the Parameter
076: *@param size Description of the Parameter
077: *@param enterTime Description of the Parameter
078: *@param exitTime Description of the Parameter
079: *@param isActive Description of the Parameter
080: */
081: VisibilitySensor(Loader loader, SFBool enabled, SFVec3f center,
082: SFVec3f size, SFTime enterTime, SFTime exitTime,
083: SFBool isActive) {
084: super (loader);
085: this .enabled = enabled;
086: this .enterTime = enterTime;
087: this .exitTime = exitTime;
088: this .isActive = isActive;
089: loader.addVisibilitySensor(this );
090: initFields();
091: }
092:
093: //public void initImpl() { ; } // tbd
094:
095: /**
096: * Description of the Method
097: *
098: *@param eventInName Description of the Parameter
099: *@param time Description of the Parameter
100: */
101: public void notifyMethod(String eventInName, double time) {
102: if (eventInName.equals("enabled")) {
103: } else {
104: System.err.println("VisibilitySensor: unknown eventInName "
105: + eventInName);
106: }
107: }
108:
109: /**
110: * Description of the Method
111: *
112: *@return Description of the Return Value
113: */
114: public Object clone() {
115: VisibilitySensor v = new VisibilitySensor(loader,
116: (SFBool) enabled.clone(), (SFVec3f) center.clone(),
117: (SFVec3f) size.clone(), (SFTime) enterTime.clone(),
118: (SFTime) exitTime.clone(), (SFBool) isActive.clone());
119: return v;
120: }
121:
122: /**
123: * Gets the type attribute of the VisibilitySensor object
124: *
125: *@return The type value
126: */
127: public String getType() {
128: return "VisibilitySensor";
129: }
130:
131: /** Description of the Method */
132: void initFields() {
133: enabled.init(this , FieldSpec, Field.EXPOSED_FIELD, "enabled");
134: center.init(this , FieldSpec, Field.EXPOSED_FIELD, "center");
135: size.init(this , FieldSpec, Field.EXPOSED_FIELD, "size");
136: isActive.init(this , FieldSpec, Field.EVENT_OUT, "isActive");
137: enterTime.init(this , FieldSpec, Field.EVENT_OUT, "enterTime");
138: exitTime.init(this , FieldSpec, Field.EVENT_OUT, "exitTime");
139: }
140:
141: }
|