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 00037 00038 00039 /* 00040 * Copyright (C) 1990,91 Silicon Graphics, Inc. 00041 * 00042 _______________________________________________________________________ 00043 ______________ S I L I C O N G R A P H I C S I N C . ____________ 00044 | 00045 | $Revision: 1.1.1.1 $ 00046 | 00047 | Description: 00048 | This is the include file for the SoDirectionalLightDragger. 00049 | 00050 | This is a composite dragger which allows independent rotation, 00051 | and translation for dragging a directional light. 00052 | When applied to a directional light, the translation will only serve 00053 | to move the dragger. This translation will have no effect on 00054 | the directional light being dragged. 00055 | 00056 | It is composed of an SoRotateSphericalDragger (for rotation), 00057 | and an SoDragPointDragger (for translation). 00058 | 00059 | NOTE TO DEVELOPERS: 00060 | For info about the structure of SoDirectionalLightDragger: 00061 | [1] compile: /usr/share/src/Inventor/samples/ivNodeKitStructure 00062 | [2] type: ivNodeKitStructure SoDirectionalLightDragger. 00063 | [3] The program prints a diagram of the scene graph and a table with 00064 | information about each part. 00065 | 00066 | The following parts in this dragger are created at construction time. 00067 | 'ResourceName' corresponds to the name of the default geometry for the 00068 | part. The dragger's constructor gets the scene graph for 'ResourceName' 00069 | by querying the global dictionary ( SoDB::getByName("ResourceName"); ). 00070 | 00071 | Resource Name: Part Name: 00072 | 00073 | directionalLightOverallMaterial - material 00074 | 00075 | directionalLightTranslatorLineTranslator - 00076 | - translator.xTranslator.translator 00077 | - translator.yTranslator.translator 00078 | - translator.zTranslator.translator 00079 | directionalLightTranslatorLineTranslatorActive - 00080 | - translator.xTranslator.translatorActive 00081 | - translator.yTranslator.translatorActive 00082 | - translator.zTranslator.translatorActive 00083 | 00084 | directionalLightTranslatorPlaneTranslator - 00085 | - translator.yzTranslator.translator 00086 | - translator.xzTranslator.translator 00087 | - translator.xyTranslator.translator 00088 | directionalLightTranslatorPlaneTranslatorActive - 00089 | - translator.yzTranslator.translatorActive 00090 | - translator.xzTranslator.translatorActive 00091 | - translator.xyTranslator.translatorActive 00092 | 00093 | directionalLightRotatorRotator - rotator.rotator 00094 | directionalLightRotatorRotatorActive - rotator.rotatorActive 00095 | directionalLightRotatorFeedback - rotator.feedback 00096 | directionalLightRotatorFeedbackActive - rotator.feedbackActive 00097 | 00098 | Author(s): Paul Isaacs, David Mott 00099 | 00100 ______________ S I L I C O N G R A P H I C S I N C . ____________ 00101 _______________________________________________________________________ 00102 */ 00103 00104 #ifndef _SO_DIRECTIONAL_LIGHT_DRAGGER_ 00105 #define _SO_DIRECTIONAL_LIGHT_DRAGGER_ 00106 00107 #include <Inventor/SbLinear.h> 00108 #include <Inventor/draggers/SoDragger.h> 00109 #include <Inventor/fields/SoSFVec3f.h> 00110 #include <Inventor/fields/SoSFRotation.h> 00111 #include <Inventor/sensors/SoSensor.h> 00112 00113 class SoFieldSensor; 00114 00115 00118 00202 00203 00204 class INVENTOR_API SoDirectionalLightDragger : public SoDragger { 00205 00206 SO_KIT_HEADER(SoDirectionalLightDragger); 00207 00211 SO_KIT_CATALOG_ENTRY_HEADER(material); 00212 00217 SO_KIT_CATALOG_ENTRY_HEADER(translatorSep); 00218 SO_KIT_CATALOG_ENTRY_HEADER(translatorRotInv); 00219 SO_KIT_CATALOG_ENTRY_HEADER(translator); 00220 SO_KIT_CATALOG_ENTRY_HEADER(rotator); 00221 00222 public: 00224 SoDirectionalLightDragger(); 00225 00226 SoSFRotation rotation; 00227 SoSFVec3f translation; 00228 00229 SoINTERNAL public: 00230 static void initClass(); 00231 00232 protected: 00233 00234 SoFieldSensor *translFieldSensor; 00235 SoFieldSensor *rotFieldSensor; 00236 static void fieldSensorCB( void *, SoSensor * ); 00237 static void valueChangedCB( void *, SoDragger * ); 00238 00247 virtual SbBool setUpConnections( SbBool onOff, SbBool doItAlways = FALSE ); 00248 00249 virtual void setDefaultOnNonWritingFields(); 00250 00251 ~SoDirectionalLightDragger(); 00252 00253 private: 00254 static const char geomBuffer[]; 00255 }; 00256 00257 #endif /* _SO_DIRECTIONAL_LIGHT_DRAGGER_ */