Open Inventor Reference
MeVis/ThirdParty/Sources/Inventor/inventor/lib/interaction/include/Inventor/draggers/SoTabBoxDragger.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 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 SoTabBoxDragger:
00053  |     [1] compile: /usr/share/src/Inventor/samples/ivNodeKitStructure
00054  |     [2] type:    ivNodeKitStructure SoTabBoxDragger.
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  |  tabBoxBoxGeom                          - boxGeom
00066  |
00067  |  tabBoxTranslator                       - tabPlane1.translator
00068  |  tabBoxScaleTabMaterial                 - tabPlane1.scaleTabMaterial
00069  |  tabBoxScaleTabHints                    - tabPlane1.scaleTabHints
00070  |  (ditto for tabPlane2 - tabPlane6)
00071  |
00072  |   Author(s): Paul Isaacs, Howard Look
00073  |
00074  ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
00075  _______________________________________________________________________
00076  */
00077 
00078 #ifndef  _SO_TAB_BOX_DRAGGER_
00079 #define  _SO_TAB_BOX_DRAGGER_
00080 
00081 #include <Inventor/SbLinear.h>
00082 #include <Inventor/draggers/SoDragger.h>
00083 #include <Inventor/fields/SoSFVec3f.h>
00084 #include <Inventor/sensors/SoSensor.h>
00085 
00086 class SoFieldSensor;
00087 
00090 
00155 
00156 
00157 class INVENTOR_API SoTabBoxDragger : public SoDragger
00158 {
00159     SO_KIT_HEADER(SoTabBoxDragger);
00160 
00162     SO_KIT_CATALOG_ENTRY_HEADER(surroundScale);
00163 
00164     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane1Sep);
00165     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane1Xf);
00166     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane1);
00167     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane2Sep);
00168     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane2Xf);
00169     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane2);
00170     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane3Sep);
00171     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane3Xf);
00172     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane3);
00173     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane4Sep);
00174     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane4Xf);
00175     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane4);
00176     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane5Sep);
00177     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane5Xf);
00178     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane5);
00179     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane6Sep);
00180     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane6Xf);
00181     SO_KIT_CATALOG_ENTRY_HEADER(tabPlane6);
00182 
00183     SO_KIT_CATALOG_ENTRY_HEADER(boxGeom);
00184 
00185   public:
00186 
00188     SoTabBoxDragger();
00189 
00190     SoSFVec3f    translation;
00191     SoSFVec3f    scaleFactor;
00192 
00198     void    adjustScaleTabSize();
00199 
00200   SoINTERNAL public:
00201     static void initClass();  
00202 
00203   protected:
00204 
00205     SoFieldSensor *translFieldSensor;
00206     SoFieldSensor *scaleFieldSensor;
00207     static void   fieldSensorCB( void *, SoSensor * );
00208     static void valueChangedCB( void *, SoDragger * );
00209 
00210     static void invalidateSurroundScaleCB(  void *, SoDragger * );
00211     static void adjustScaleTabSizeCB(  void *, SoDragger * );
00212 
00221     virtual SbBool setUpConnections( SbBool onOff, SbBool doItAlways = FALSE );
00222 
00223     virtual void setDefaultOnNonWritingFields();
00224 
00225     virtual ~SoTabBoxDragger();
00226 
00227   private:
00228     static const char geomBuffer[];
00229 };    
00230 
00231 #endif  /* _SO_TAB_BOX_DRAGGER_ */