Open Inventor Reference
MeVis/ThirdParty/Sources/Inventor/inventor/lib/interaction/include/Inventor/draggers/SoJackDragger.h
Go to the documentation of this file.
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 jack dragger class, so named because
00048  |      with the default geometry, it looks like the children's toy.
00049  |      This dragger allows you to perform rotations,uniform scales
00050  |      and translations, all in one spiffy gadget.
00051  |
00052  |      Translation is done with a dragPointDragger, rotation with a 
00053  |      rotateSphericalDragger, and scaling with a scaleUniformDragger.
00054  |
00055  | NOTE TO DEVELOPERS:
00056  |     For info about the structure of SoJackDragger:
00057  |     [1] compile: /usr/share/src/Inventor/samples/ivNodeKitStructure
00058  |     [2] type:    ivNodeKitStructure SoJackDragger.
00059  |     [3] The program prints a diagram of the scene graph and a table with 
00060  |         information about each part.
00061  |
00062  |  The following parts in this dragger are created at construction time.
00063  |  'ResourceName' corresponds to the name of the default geometry for the
00064  |  part. The dragger's constructor gets the scene graph for 'ResourceName'
00065  |  by querying the global dictionary ( SoDB::getByName("ResourceName"); ).  
00066  |
00067  |  Resource Name:                      Part Name:
00068  |
00069  |   jackScalerScaler                 - scaler.scaler
00070  |   jackScalerScalerActive           - scaler.scalerActive
00071  |   jackScalerFeedback               - scaler.feedback
00072  |   jackScalerFeedbackActive         - scaler.feedbackActive
00073  |
00074  |   jackRotatorRotator               - rotator.rotator
00075  |   jackRotatorRotatorActive         - rotator.rotatorActive
00076  |   jackRotatorFeedback              - rotator.feedback
00077  |   jackRotatorFeedbackActive        - rotator.feedbackActive
00078  |
00079  |   jackTranslatorLineTranslator     - 
00080  |                                    - translator.xTranslator.translator
00081  |                                    - translator.yTranslator.translator
00082  |                                    - translator.zTranslator.translator
00083  |
00084  |   jackTranslatorLineTranslatorActive  - 
00085  |                                    - translator.xTranslator.translatorActive
00086  |                                    - translator.yTranslator.translatorActive
00087  |                                    - translator.zTranslator.translatorActive
00088  |
00089  |   jackTranslatorPlaneTranslator    - 
00090  |                                    - translator.yzTranslator.translator
00091  |                                    - translator.xzTranslator.translator
00092  |                                    - translator.xyTranslator.translator
00093  |
00094  |   jackTranslatorPlaneTranslatorActive  - 
00095  |                                    - translator.yzTranslator.translatorActive
00096  |                                    - translator.xzTranslator.translatorActive
00097  |                                    - translator.xyTranslator.translatorActive
00098  |
00099  |   jackTranslatorXFeedback          - translator.xFeedback
00100  |   jackTranslatorYFeedback          - translator.yFeedback
00101  |   jackTranslatorZFeedback          - translator.zFeedback
00102  |
00103  |   jackTranslatorXYFeedback         - translator.xyFeedback
00104  |   jackTranslatorXZFeedback         - translator.xzFeedback
00105  |   jackTranslatorYZFeedback         - translator.yzFeedback
00106  |
00107  |   Author(s): Paul Isaacs
00108  |
00109  ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
00110  _______________________________________________________________________
00111  */
00112 
00113 #ifndef  _SO_JACK_DRAGGER_
00114 #define  _SO_JACK_DRAGGER_
00115 
00116 #include <Inventor/SbLinear.h>
00117 #include <Inventor/draggers/SoDragger.h>
00118 #include <Inventor/fields/SoSFVec3f.h>
00119 #include <Inventor/fields/SoSFRotation.h>
00120 #include <Inventor/sensors/SoSensor.h>
00121 
00122 class SbDict;
00123 class SoFieldSensor;
00124 
00127 
00195 
00196 
00197 class INVENTOR_API SoJackDragger : public SoDragger
00198 {
00199     SO_KIT_HEADER(SoJackDragger);
00200 
00202     SO_KIT_CATALOG_ENTRY_HEADER(surroundScale);
00204     SO_KIT_CATALOG_ENTRY_HEADER(antiSquish);
00205 
00206     SO_KIT_CATALOG_ENTRY_HEADER(scaler);
00207     SO_KIT_CATALOG_ENTRY_HEADER(rotator);
00208     SO_KIT_CATALOG_ENTRY_HEADER(translator);
00209 
00210   public:
00211 
00213     SoJackDragger();
00214 
00215     SoSFRotation rotation;
00216     SoSFVec3f    translation;
00217     SoSFVec3f    scaleFactor;
00218 
00219   SoINTERNAL public:
00220     static void initClass();  
00221 
00222   protected:
00223 
00224     SoFieldSensor *rotFieldSensor;
00225     SoFieldSensor *translFieldSensor;
00226     SoFieldSensor *scaleFieldSensor;
00227     static void   fieldSensorCB( void *, SoSensor * );
00228     static void valueChangedCB( void *, SoDragger * );
00229 
00230     static void invalidateSurroundScaleCB(  void *, SoDragger * );
00231 
00240     virtual SbBool setUpConnections( SbBool onOff, SbBool doItAlways = FALSE );
00241 
00242     virtual void setDefaultOnNonWritingFields();
00243 
00244 
00245     virtual ~SoJackDragger();
00246 
00247   private:
00248     static const char geomBuffer[];
00249 };    
00250 
00251 #endif  /* _SO_JACK_DRAGGER_ */