![]() |
http://www.sim.no/ http://www.coin3d.org/ |
00001 #ifndef COIN_SOTABPLANEDRAGGER_H 00002 #define COIN_SOTABPLANEDRAGGER_H 00003 00004 /**************************************************************************\ 00005 * 00006 * This file is part of the Coin 3D visualization library. 00007 * Copyright (C) by Kongsberg Oil & Gas Technologies. 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 Kongsberg Oil & Gas Technologies 00018 * about acquiring a Coin Professional Edition License. 00019 * 00020 * See http://www.coin3d.org/ for more information. 00021 * 00022 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY. 00023 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org 00024 * 00025 \**************************************************************************/ 00026 00027 #include <Inventor/draggers/SoDragger.h> 00028 #include <Inventor/tools/SbLazyPimplPtr.h> 00029 #include <Inventor/fields/SoSFVec3f.h> 00030 00031 class SoSensor; 00032 class SoFieldSensor; 00033 class SbLineProjector; 00034 class SbPlaneProjector; 00035 class SoTabPlaneDraggerP; 00036 00037 class COIN_DLL_API SoTabPlaneDragger : public SoDragger { 00038 typedef SoDragger inherited; 00039 00040 SO_KIT_HEADER(SoTabPlaneDragger); 00041 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleCoords); 00042 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab0); 00043 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab1); 00044 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab2); 00045 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab3); 00046 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleCoords); 00047 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab0); 00048 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab1); 00049 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab2); 00050 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab3); 00051 SO_KIT_CATALOG_ENTRY_HEADER(planeSwitch); 00052 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabHints); 00053 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabMaterial); 00054 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabMaterialBinding); 00055 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabNormal); 00056 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabNormalBinding); 00057 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabs); 00058 SO_KIT_CATALOG_ENTRY_HEADER(translator); 00059 00060 public: 00061 static void initClass(void); 00062 SoTabPlaneDragger(void); 00063 00064 SoSFVec3f translation; 00065 SoSFVec3f scaleFactor; 00066 00067 void adjustScaleTabSize(void); 00068 00069 protected: 00070 virtual ~SoTabPlaneDragger(void); 00071 00072 virtual void GLRender(SoGLRenderAction * action); 00073 00074 virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE); 00075 virtual void setDefaultOnNonWritingFields(void); 00076 00077 void reallyAdjustScaleTabSize(SoGLRenderAction * action); 00078 00079 void getXYScreenLengths(SbVec2f & lengths, const SbMatrix & localtoscreen, 00080 const SbVec2s & winsize); 00081 00082 void dragStart(void); 00083 void drag(void); 00084 void dragFinish(void); 00085 00086 // Lots of public/protected methods and members were removed from 00087 // this class as they clearly should have been private. 00088 // Let us know if we've removed something that you need. 00089 // pederb, 20000226 00090 00091 private: 00092 00093 // static methods moved from public to private 00094 static void startCB(void * f, SoDragger * d); 00095 static void motionCB(void * f, SoDragger * d); 00096 static void finishCB(void * f, SoDragger * d); 00097 static void metaKeyChangeCB(void * f, SoDragger * d); 00098 static void fieldSensorCB(void * f, SoSensor * s); 00099 static void valueChangedCB(void * f, SoDragger * d); 00100 00101 void createPrivateParts(void); 00102 SoNode *getNodeFieldNode(const char *fieldname); 00103 00104 SoFieldSensor * scaleFieldSensor; 00105 SoFieldSensor * translFieldSensor; 00106 SbLineProjector *lineProj; 00107 SbPlaneProjector *planeProj; 00108 int whatkind; 00109 int constraintState; 00110 float prevsizex; 00111 float prevsizey; 00112 SbBool adjustTabs; 00113 SbVec3f worldRestartPt; 00114 SbVec3f scaleCenter; 00115 00116 private: 00117 SbLazyPimplPtr<SoTabPlaneDraggerP> pimpl; 00118 00119 // NOT IMPLEMENTED: 00120 SoTabPlaneDragger(const SoTabPlaneDragger & rhs); 00121 SoTabPlaneDragger & operator = (const SoTabPlaneDragger & rhs); 00122 }; // SoTabPlaneDragger 00123 00124 #endif // !COIN_SOTABPLANEDRAGGER_H
Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.
Generated on Mon May 10 00:34:53 2010 for Coin by Doxygen 1.6.3.