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 * Copyright (C) 1990,91,92 Silicon Graphics, Inc. 00040 * 00041 _______________________________________________________________________ 00042 ______________ S I L I C O N G R A P H I C S I N C . ____________ 00043 | 00044 | $Revision: 1.1.1.1 $ 00045 | 00046 | Description: 00047 | This file defines the transform box dragger class. 00048 | This dragger allows you to perform rotations,uniform scales 00049 | and translations, all in one tidy box. 00050 | 00051 | NOTE TO DEVELOPERS: 00052 | For info about the structure of SoTransformBoxDragger: 00053 | [1] compile: /usr/share/src/Inventor/samples/ivNodeKitStructure 00054 | [2] type: ivNodeKitStructure SoTransformBoxDragger. 00055 | [3] The program prints a diagram of the scene graph and a table with 00056 | information about each part. 00057 | 00058 | The following parts in this dragger are created at construction time. 00059 | 'ResourceName' corresponds to the name of the default geometry for the 00060 | part. The dragger's constructor gets the scene graph for 'ResourceName' 00061 | by querying the global dictionary ( SoDB::getByName("ResourceName"); ). 00062 | 00063 | Resource Name: Part Name: 00064 | 00065 | transformBoxScalerScaler - scaler.scaler 00066 | transformBoxScalerScalerActive - scaler.scalerActive 00067 | transformBoxScalerFeedback - scaler.feedback 00068 | transformBoxScalerFeedbackActive - scaler.feedbackActive 00069 | 00070 | transformBoxRotatorRotator - rotator1.rotator 00071 | transformBoxRotatorRotatorActive - rotator1.rotatorActive 00072 | transformBoxRotatorFeedback - rotator1.feedback 00073 | transformBoxRotatorFeedbackActive - rotator1.feedbackActive 00074 | (ditto for rotator2 and rotator3) 00075 | 00076 | transformBoxTranslatorTranslator - translator1.translator 00077 | transformBoxTranslatorTranslatorActive - translator1.translatorActive 00078 | transformBoxTranslatorXAxisFeedback - translator1.xAxisFeedback 00079 | transformBoxTranslatorYAxisFeedback - translator1.yAxisFeedback 00080 | (ditto for translator2 - translator6) 00081 | 00082 | Author(s): Paul Isaacs, Howard Look 00083 | 00084 ______________ S I L I C O N G R A P H I C S I N C . ____________ 00085 _______________________________________________________________________ 00086 */ 00087 00088 #ifndef _SO_TRANSFORM_BOX_DRAGGER_ 00089 #define _SO_TRANSFORM_BOX_DRAGGER_ 00090 00091 #include <Inventor/SbLinear.h> 00092 #include <Inventor/draggers/SoDragger.h> 00093 #include <Inventor/fields/SoSFVec3f.h> 00094 #include <Inventor/fields/SoSFRotation.h> 00095 #include <Inventor/sensors/SoSensor.h> 00096 00097 class SbDict; 00098 class SoFieldSensor; 00099 00102 00172 00173 00174 class INVENTOR_API SoTransformBoxDragger : public SoDragger 00175 { 00176 SO_KIT_HEADER(SoTransformBoxDragger); 00177 00179 SO_KIT_CATALOG_ENTRY_HEADER(surroundScale); 00181 SO_KIT_CATALOG_ENTRY_HEADER(antiSquish); 00182 00183 SO_KIT_CATALOG_ENTRY_HEADER(scaler); 00184 SO_KIT_CATALOG_ENTRY_HEADER(rotator1Sep); 00185 SO_KIT_CATALOG_ENTRY_HEADER(rotator1Rot); 00186 SO_KIT_CATALOG_ENTRY_HEADER(rotator1); 00187 SO_KIT_CATALOG_ENTRY_HEADER(rotator2Sep); 00188 SO_KIT_CATALOG_ENTRY_HEADER(rotator2Rot); 00189 SO_KIT_CATALOG_ENTRY_HEADER(rotator2); 00190 SO_KIT_CATALOG_ENTRY_HEADER(rotator3Sep); 00191 SO_KIT_CATALOG_ENTRY_HEADER(rotator3Rot); 00192 SO_KIT_CATALOG_ENTRY_HEADER(rotator3); 00193 SO_KIT_CATALOG_ENTRY_HEADER(translator1Sep); 00194 SO_KIT_CATALOG_ENTRY_HEADER(translator1Rot); 00195 SO_KIT_CATALOG_ENTRY_HEADER(translator1); 00196 SO_KIT_CATALOG_ENTRY_HEADER(translator2Sep); 00197 SO_KIT_CATALOG_ENTRY_HEADER(translator2Rot); 00198 SO_KIT_CATALOG_ENTRY_HEADER(translator2); 00199 SO_KIT_CATALOG_ENTRY_HEADER(translator3Sep); 00200 SO_KIT_CATALOG_ENTRY_HEADER(translator3Rot); 00201 SO_KIT_CATALOG_ENTRY_HEADER(translator3); 00202 SO_KIT_CATALOG_ENTRY_HEADER(translator4Sep); 00203 SO_KIT_CATALOG_ENTRY_HEADER(translator4Rot); 00204 SO_KIT_CATALOG_ENTRY_HEADER(translator4); 00205 SO_KIT_CATALOG_ENTRY_HEADER(translator5Sep); 00206 SO_KIT_CATALOG_ENTRY_HEADER(translator5Rot); 00207 SO_KIT_CATALOG_ENTRY_HEADER(translator5); 00208 SO_KIT_CATALOG_ENTRY_HEADER(translator6Sep); 00209 SO_KIT_CATALOG_ENTRY_HEADER(translator6Rot); 00210 SO_KIT_CATALOG_ENTRY_HEADER(translator6); 00211 00212 public: 00213 00215 SoTransformBoxDragger(); 00216 00217 SoSFRotation rotation; 00218 SoSFVec3f translation; 00219 SoSFVec3f scaleFactor; 00220 00221 SoINTERNAL public: 00222 static void initClass(); 00223 00224 protected: 00225 00226 SoFieldSensor *rotFieldSensor; 00227 SoFieldSensor *translFieldSensor; 00228 SoFieldSensor *scaleFieldSensor; 00229 static void fieldSensorCB( void *, SoSensor * ); 00230 static void valueChangedCB( void *, SoDragger * ); 00231 00232 static void invalidateSurroundScaleCB( void *, SoDragger * ); 00233 00242 virtual SbBool setUpConnections( SbBool onOff, SbBool doItAlways = FALSE ); 00243 00244 virtual void setDefaultOnNonWritingFields(); 00245 00246 virtual ~SoTransformBoxDragger(); 00247 00248 private: 00249 static const char geomBuffer[]; 00250 }; 00251 00252 #endif /* _SO_TRANSFORM_BOX_DRAGGER_ */