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 00044 00045 00046 #ifndef _SO_SPOT_LIGHT_MANIP_ 00047 #define _SO_SPOT_LIGHT_MANIP_ 00048 00049 #include <Inventor/SbLinear.h> 00050 #include <Inventor/draggers/SoDragger.h> 00051 #include <Inventor/nodes/SoSpotLight.h> 00052 #include <Inventor/sensors/SoFieldSensor.h> 00053 00056 00156 00157 00158 class INVENTOR_API SoSpotLightManip : public SoSpotLight 00159 { 00160 SO_NODE_HEADER(SoSpotLightManip); 00161 00162 public: 00163 00165 SoSpotLightManip(); 00166 00172 SoDragger *getDragger(); 00173 00195 SbBool replaceNode( SoPath *p ); 00214 SbBool replaceManip(SoPath *p, SoSpotLight *newOne ) const; 00215 00216 SoEXTENDER public: 00217 00223 virtual void doAction( SoAction *action ); 00224 virtual void callback( SoCallbackAction *action ); 00225 virtual void GLRender( SoGLRenderAction *action ); 00226 virtual void getBoundingBox( SoGetBoundingBoxAction *action ); 00227 virtual void getMatrix(SoGetMatrixAction *action ); 00228 virtual void handleEvent( SoHandleEventAction *action ); 00229 virtual void pick( SoPickAction *action ); 00230 virtual void search( SoSearchAction *action ); 00231 00232 SoINTERNAL public: 00233 00234 static void initClass(); 00235 00236 virtual SoChildList *getChildren() const; 00237 00238 protected: 00239 00241 virtual void copyContents(const SoFieldContainer *fromFC, 00242 SbBool copyConnections); 00243 00244 static void transferFieldValues( const SoSpotLight *from, 00245 SoSpotLight *to); 00246 00247 SoFieldSensor *locationFieldSensor; 00248 SoFieldSensor *directionFieldSensor; 00249 SoFieldSensor *angleFieldSensor; 00250 SoFieldSensor *colorFieldSensor; 00251 static void fieldSensorCB(void *, SoSensor *); 00252 static void valueChangedCB(void *,SoDragger *); 00253 00254 void setDragger( SoDragger *newDragger ); 00255 00256 SoChildList *children; 00257 00258 virtual ~SoSpotLightManip(); 00259 00260 private: 00261 int getNumChildren() const { return (children->getLength()); } 00262 }; 00263 00264 #endif /* _SO_SPOT_LIGHT_MANIP_ */