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

SoTabPlaneDragger.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_SOTABPLANEDRAGGER_H
00021 #define COIN_SOTABPLANEDRAGGER_H
00022 
00023 #include <Inventor/draggers/SoDragger.h>
00024 #include <Inventor/fields/SoSFVec3f.h>
00025 
00026 class SoSensor;
00027 class SoFieldSensor;
00028 class SbLineProjector;
00029 class SbPlaneProjector;
00030 
00031 
00032 class COIN_DLL_API SoTabPlaneDragger : public SoDragger {
00033   typedef SoDragger inherited;
00034 
00035   SO_KIT_HEADER(SoTabPlaneDragger);
00036 
00037   SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleCoords);
00038   SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab0);
00039   SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab1);
00040   SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab2);
00041   SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab3);
00042   SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleCoords);
00043   SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab0);
00044   SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab1);
00045   SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab2);
00046   SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab3);
00047   SO_KIT_CATALOG_ENTRY_HEADER(planeSwitch);
00048   SO_KIT_CATALOG_ENTRY_HEADER(scaleTabHints);
00049   SO_KIT_CATALOG_ENTRY_HEADER(scaleTabMaterial);
00050   SO_KIT_CATALOG_ENTRY_HEADER(scaleTabMaterialBinding);
00051   SO_KIT_CATALOG_ENTRY_HEADER(scaleTabNormal);
00052   SO_KIT_CATALOG_ENTRY_HEADER(scaleTabNormalBinding);
00053   SO_KIT_CATALOG_ENTRY_HEADER(scaleTabs);
00054   SO_KIT_CATALOG_ENTRY_HEADER(translator);
00055 
00056 
00057 public:
00058   static void initClass(void);
00059   SoTabPlaneDragger(void);
00060 
00061   SoSFVec3f translation;
00062   SoSFVec3f scaleFactor;
00063 
00064   void adjustScaleTabSize(void);
00065 
00066 protected:
00067 
00068   ~SoTabPlaneDragger();
00069 
00070   virtual void GLRender(SoGLRenderAction * action);
00071 
00072   virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE);
00073   virtual void setDefaultOnNonWritingFields(void);
00074 
00075   void reallyAdjustScaleTabSize(SoGLRenderAction * action);
00076 
00077   void getXYScreenLengths(SbVec2f & lengths, const SbMatrix & localtoscreen,
00078                            const SbVec2s & winsize);
00079 
00080   void dragStart(void);
00081   void drag(void);
00082   void dragFinish(void);
00083 
00084   // Lots of public/protected methods and members were removed from
00085   // this class as they clearly should have been private.
00086   // Let us know if we've removed something that you need.
00087   // pederb, 20000226
00088 
00089 private:
00090 
00091   // static methods moved from public to private
00092   static void startCB(void * f, SoDragger * d);
00093   static void motionCB(void * f, SoDragger * d);
00094   static void finishCB(void * f, SoDragger * d);
00095   static void metaKeyChangeCB(void * f, SoDragger * d);
00096   static void fieldSensorCB(void * f, SoSensor * s);
00097   static void valueChangedCB(void * f, SoDragger * d);
00098 
00099   void createPrivateParts(void);
00100   SoNode *getNodeFieldNode(const char *fieldname);
00101 
00102   SoFieldSensor * scaleFieldSensor;
00103   SoFieldSensor * translFieldSensor;
00104   SbLineProjector *lineProj;
00105   SbPlaneProjector *planeProj;
00106   int whatkind;
00107   int constraintState;
00108   float prevsizex;
00109   float prevsizey;
00110   SbBool adjustTabs;
00111   SbVec3f worldRestartPt;
00112   SbVec3f scaleCenter;
00113 };
00114 
00115 #endif // !COIN_SOTABPLANEDRAGGER_H

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