Open Inventor Reference
|
00001 /* 00002 * 00003 * Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved. 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * Further, this software is distributed without any warranty that it is 00016 * free of the rightful claim of any third person regarding infringement 00017 * or the like. Any license provided herein, whether implied or 00018 * otherwise, applies only to this software file. Patent licenses, if 00019 * any, provided herein do not apply to combinations of this program with 00020 * other software, or any other product whatsoever. 00021 * 00022 * You should have received a copy of the GNU Lesser General Public 00023 * License along with this library; if not, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00025 * 00026 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 00027 * Mountain View, CA 94043, or: 00028 * 00029 * http://www.sgi.com 00030 * 00031 * For further information regarding this notice, see: 00032 * 00033 * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ 00034 * 00035 */ 00036 00105 00106 00107 #ifndef _SO_SPOT_LIGHT_DRAGGER_ 00108 #define _SO_SPOT_LIGHT_DRAGGER_ 00109 00110 #include <Inventor/SbLinear.h> 00111 #include <Inventor/draggers/SoDragger.h> 00112 #include <Inventor/fields/SoSFVec3f.h> 00113 #include <Inventor/fields/SoSFFloat.h> 00114 #include <Inventor/fields/SoSFRotation.h> 00115 #include <Inventor/sensors/SoSensor.h> 00116 00117 class SoFieldSensor; 00118 class SbPlaneProjector; 00119 00122 00223 00224 00225 class INVENTOR_API SoSpotLightDragger : public SoDragger 00226 { 00227 SO_KIT_HEADER(SoSpotLightDragger); 00228 00232 SO_KIT_CATALOG_ENTRY_HEADER(material); 00233 00238 SO_KIT_CATALOG_ENTRY_HEADER(translatorSep); 00239 SO_KIT_CATALOG_ENTRY_HEADER(translatorRotInv); 00240 SO_KIT_CATALOG_ENTRY_HEADER(translator); 00241 SO_KIT_CATALOG_ENTRY_HEADER(rotator); 00245 SO_KIT_CATALOG_ENTRY_HEADER(beamSep); 00246 SO_KIT_CATALOG_ENTRY_HEADER(beamPlacement); 00247 SO_KIT_CATALOG_ENTRY_HEADER(beamScale); 00248 SO_KIT_CATALOG_ENTRY_HEADER(beamSwitch); 00249 SO_KIT_CATALOG_ENTRY_HEADER(beam); 00250 SO_KIT_CATALOG_ENTRY_HEADER(beamActive); 00251 00252 public: 00253 00255 SoSpotLightDragger(); 00256 00257 SoSFRotation rotation; 00258 SoSFVec3f translation; 00259 SoSFFloat angle; 00260 00261 SoINTERNAL public: 00262 static void initClass(); 00263 00264 protected: 00265 00266 SbPlaneProjector *planeProj; 00267 00268 static void startCB( void *, SoDragger * ); 00269 static void motionCB( void *, SoDragger * ); 00270 static void doneCB( void *, SoDragger * ); 00271 00272 void dragStart(); 00273 void drag(); 00274 void dragFinish(); 00275 00276 SoFieldSensor *rotFieldSensor; 00277 SoFieldSensor *translFieldSensor; 00278 SoFieldSensor *angleFieldSensor; 00279 static void fieldSensorCB( void *, SoSensor * ); 00280 static void valueChangedCB( void *, SoDragger * ); 00281 00283 void setBeamScaleFromAngle(float beamAngle); 00284 00293 virtual SbBool setUpConnections( SbBool onOff, SbBool doItAlways = FALSE ); 00294 00295 virtual void setDefaultOnNonWritingFields(); 00296 00297 virtual ~SoSpotLightDragger(); 00298 00299 private: 00300 static const char geomBuffer[]; 00301 }; 00302 00303 #endif /* _SO_SPOT_LIGHT_DRAGGER_ */