Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

# SoTrackballDragger.h

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