Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SoTrackballDragger.h

00001 /**************************************************************************\
00002  *
00003  *  This file is part of the Coin 3D visualization library.
00004  *  Copyright (C) 1998-2002 by Systems in Motion. All rights reserved.
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public License
00008  *  version 2.1 as published by the Free Software Foundation. See the
00009  *  file LICENSE.LGPL at the root directory of the distribution for
00010  *  more details.
00011  *
00012  *  If you want to use Coin for applications not compatible with the
00013  *  LGPL, please contact SIM to acquire a Professional Edition license.
00014  *
00015  *  Systems in Motion, Prof Brochs gate 6, 7030 Trondheim, NORWAY
00016  *  http://www.sim.no support@sim.no Voice: +47 22114160 Fax: +47 22207097
00017  *
00018 \**************************************************************************/
00019 
00020 #ifndef COIN_SOTRACKBALLDRAGGER_H
00021 #define COIN_SOTRACKBALLDRAGGER_H
00022 
00023 #include <Inventor/draggers/SoDragger.h>
00024 #include <Inventor/fields/SoSFRotation.h>
00025 #include <Inventor/fields/SoSFVec3f.h>
00026 #include <Inventor/SbVec2f.h>
00027 #include <Inventor/SbTime.h>
00028 
00029 class SoSensor;
00030 class SoFieldSensor;
00031 class SbSphereProjector;
00032 class SbCylinderProjector;
00033 class SbLineProjector;
00034 class SoTimerSensor;
00035 
00036 class COIN_DLL_API SoTrackballDragger : public SoDragger {
00037   typedef SoDragger inherited;
00038 
00039   SO_KIT_HEADER(SoTrackballDragger);
00040 
00041   SO_KIT_CATALOG_ENTRY_HEADER(XRotator);
00042   SO_KIT_CATALOG_ENTRY_HEADER(XRotatorActive);
00043   SO_KIT_CATALOG_ENTRY_HEADER(XRotatorSwitch);
00044   SO_KIT_CATALOG_ENTRY_HEADER(YRotator);
00045   SO_KIT_CATALOG_ENTRY_HEADER(YRotatorActive);
00046   SO_KIT_CATALOG_ENTRY_HEADER(YRotatorSwitch);
00047   SO_KIT_CATALOG_ENTRY_HEADER(ZRotator);
00048   SO_KIT_CATALOG_ENTRY_HEADER(ZRotatorActive);
00049   SO_KIT_CATALOG_ENTRY_HEADER(ZRotatorSwitch);
00050   SO_KIT_CATALOG_ENTRY_HEADER(antiSquish);
00051   SO_KIT_CATALOG_ENTRY_HEADER(rotator);
00052   SO_KIT_CATALOG_ENTRY_HEADER(rotatorActive);
00053   SO_KIT_CATALOG_ENTRY_HEADER(rotatorSwitch);
00054   SO_KIT_CATALOG_ENTRY_HEADER(surroundScale);
00055   SO_KIT_CATALOG_ENTRY_HEADER(userAxis);
00056   SO_KIT_CATALOG_ENTRY_HEADER(userAxisActive);
00057   SO_KIT_CATALOG_ENTRY_HEADER(userAxisRotation);
00058   SO_KIT_CATALOG_ENTRY_HEADER(userAxisSwitch);
00059   SO_KIT_CATALOG_ENTRY_HEADER(userRotator);
00060   SO_KIT_CATALOG_ENTRY_HEADER(userRotatorActive);
00061   SO_KIT_CATALOG_ENTRY_HEADER(userRotatorSwitch);
00062 
00063 
00064 public:
00065   static void initClass(void);
00066   SoTrackballDragger(void);
00067 
00068   SoSFRotation rotation;
00069   SoSFVec3f scaleFactor;
00070 
00071   SbBool isAnimationEnabled(void);
00072   void setAnimationEnabled(SbBool newval);
00073 
00074 protected:
00075   ~SoTrackballDragger();
00076   virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE);
00077   virtual void setDefaultOnNonWritingFields(void);
00078 
00079   void dragStart(void);
00080   void drag(void);
00081   void dragFinish(void);
00082   void setAllPartsActive(SbBool onoroff);
00083 
00084   static void startCB(void * f, SoDragger * d);
00085   static void motionCB(void * f, SoDragger * d);
00086   static void finishCB(void * f, SoDragger * d);
00087   static void metaKeyChangeCB(void * f, SoDragger * d);
00088   static void fieldSensorCB(void * f, SoSensor * s);
00089   static void valueChangedCB(void * f, SoDragger * d);
00090 
00091   SoFieldSensor * rotFieldSensor;
00092   SoFieldSensor * scaleFieldSensor;
00093 
00094 private:
00095   SoNode * getNodeFieldNode(const char *fieldname);
00096   void updateUserAxisSwitches(const SbBool setactive = FALSE);
00097   static void timerSensorCB(void *, SoSensor *);
00098 
00099   class SoTrackballDraggerP * pimpl;
00100   friend class SoTrackballDraggerP;
00101 };
00102 
00103 #endif // !COIN_SOTRACKBALLDRAGGER_H

Generated at Tue Mar 5 03:31:18 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001