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

# SoDragPointDragger.h

    00001 #ifndef COIN_SODRAGPOINTDRAGGER_H
    00002 #define COIN_SODRAGPOINTDRAGGER_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/SoSFVec3f.h>
    00029
    00030 class SoSensor;
    00031 class SoFieldSensor;
    00032
    00033
    00034 class COIN_DLL_API SoDragPointDragger : public SoDragger {
    00035   typedef SoDragger inherited;
    00036
    00037   SO_KIT_HEADER(SoDragPointDragger);
    00038
    00039   SO_KIT_CATALOG_ENTRY_HEADER(noRotSep);
    00040   SO_KIT_CATALOG_ENTRY_HEADER(planeFeedbackSep);
    00041   SO_KIT_CATALOG_ENTRY_HEADER(planeFeedbackSwitch);
    00042   SO_KIT_CATALOG_ENTRY_HEADER(planeFeedbackTranslation);
    00043   SO_KIT_CATALOG_ENTRY_HEADER(rotX);
    00044   SO_KIT_CATALOG_ENTRY_HEADER(rotXSep);
    00045   SO_KIT_CATALOG_ENTRY_HEADER(rotY);
    00046   SO_KIT_CATALOG_ENTRY_HEADER(rotYSep);
    00047   SO_KIT_CATALOG_ENTRY_HEADER(rotZ);
    00048   SO_KIT_CATALOG_ENTRY_HEADER(rotZSep);
    00049   SO_KIT_CATALOG_ENTRY_HEADER(xFeedback);
    00050   SO_KIT_CATALOG_ENTRY_HEADER(xFeedbackSep);
    00051   SO_KIT_CATALOG_ENTRY_HEADER(xFeedbackSwitch);
    00052   SO_KIT_CATALOG_ENTRY_HEADER(xFeedbackTranslation);
    00053   SO_KIT_CATALOG_ENTRY_HEADER(xTranslator);
    00054   SO_KIT_CATALOG_ENTRY_HEADER(xTranslatorSwitch);
    00055   SO_KIT_CATALOG_ENTRY_HEADER(xyFeedback);
    00056   SO_KIT_CATALOG_ENTRY_HEADER(xyTranslator);
    00057   SO_KIT_CATALOG_ENTRY_HEADER(xyTranslatorSwitch);
    00058   SO_KIT_CATALOG_ENTRY_HEADER(xzFeedback);
    00059   SO_KIT_CATALOG_ENTRY_HEADER(xzTranslator);
    00060   SO_KIT_CATALOG_ENTRY_HEADER(xzTranslatorSwitch);
    00061   SO_KIT_CATALOG_ENTRY_HEADER(yFeedback);
    00062   SO_KIT_CATALOG_ENTRY_HEADER(yFeedbackSep);
    00063   SO_KIT_CATALOG_ENTRY_HEADER(yFeedbackSwitch);
    00064   SO_KIT_CATALOG_ENTRY_HEADER(yFeedbackTranslation);
    00065   SO_KIT_CATALOG_ENTRY_HEADER(yTranslator);
    00066   SO_KIT_CATALOG_ENTRY_HEADER(yTranslatorSwitch);
    00067   SO_KIT_CATALOG_ENTRY_HEADER(yzFeedback);
    00068   SO_KIT_CATALOG_ENTRY_HEADER(yzTranslator);
    00069   SO_KIT_CATALOG_ENTRY_HEADER(yzTranslatorSwitch);
    00070   SO_KIT_CATALOG_ENTRY_HEADER(zFeedback);
    00071   SO_KIT_CATALOG_ENTRY_HEADER(zFeedbackSep);
    00072   SO_KIT_CATALOG_ENTRY_HEADER(zFeedbackSwitch);
    00073   SO_KIT_CATALOG_ENTRY_HEADER(zFeedbackTranslation);
    00074   SO_KIT_CATALOG_ENTRY_HEADER(zTranslator);
    00075   SO_KIT_CATALOG_ENTRY_HEADER(zTranslatorSwitch);
    00076
    00077
    00078 public:
    00079   static void initClass(void);
    00080   SoDragPointDragger(void);
    00081
    00082   void setJumpLimit(const float limit);
    00083   float getJumpLimit(void) const;
    00084   void showNextDraggerSet(void);
    00085
    00086   SoSFVec3f translation;
    00087
    00088 protected:
    00089   ~SoDragPointDragger();
    00090   virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE);
    00091   virtual void setDefaultOnNonWritingFields(void);
    00092
    00093   void dragStart(void);
    00094   void drag(void);
    00095   void dragFinish(void);
    00096
    00097   static void startCB(void * f, SoDragger * d);
    00098   static void motionCB(void * f, SoDragger * d);
    00099   static void finishCB(void * f, SoDragger * d);
    00100   static void metaKeyChangeCB(void * f, SoDragger * d);
    00101   static void fieldSensorCB(void * f, SoSensor * s);
    00102   static void valueChangedCB(void * f, SoDragger * d);
    00103
    00104   SoFieldSensor * fieldSensor;
    00105
    00106 private:
    00107   void registerDragger(SoDragger *dragger);
    00108   void unregisterDragger(const char *name);
    00109   void updateSwitchNodes();
    00110   int currAxis;
    00111   float jumpLimit;
    00112 };
    00113
    00114 #endif // !COIN_SODRAGPOINTDRAGGER_H