| http://www.sim.no/ http://www.coin3d.org/

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

SoTabPlaneDragger.h
1 #ifndef COIN_SOTABPLANEDRAGGER_H
2 #define COIN_SOTABPLANEDRAGGER_H
3
4 /**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25 \**************************************************************************/
26
27 #include <Inventor/draggers/SoDragger.h>
28 #include <Inventor/tools/SbLazyPimplPtr.h>
29 #include <Inventor/fields/SoSFVec3f.h>
30
31 class SoSensor;
32 class SoFieldSensor;
33 class SbLineProjector;
34 class SbPlaneProjector;
35 class SoTabPlaneDraggerP;
36
37 class COIN_DLL_API SoTabPlaneDragger : public SoDragger {
38 typedef SoDragger inherited;
39
40 SO_KIT_HEADER(SoTabPlaneDragger);
41 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleCoords);
42 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab0);
43 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab1);
44 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab2);
45 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab3);
46 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleCoords);
47 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab0);
48 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab1);
49 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab2);
50 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab3);
51 SO_KIT_CATALOG_ENTRY_HEADER(planeSwitch);
52 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabHints);
53 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabMaterial);
54 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabMaterialBinding);
55 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabNormal);
56 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabNormalBinding);
57 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabs);
58 SO_KIT_CATALOG_ENTRY_HEADER(translator);
59
60 public:
61 static void initClass(void);
62 SoTabPlaneDragger(void);
63
64 SoSFVec3f translation;
65 SoSFVec3f scaleFactor;
66
67 void adjustScaleTabSize(void);
68
69 protected:
70 virtual ~SoTabPlaneDragger(void);
71
72 virtual void GLRender(SoGLRenderAction * action);
73
74 virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE);
75 virtual void setDefaultOnNonWritingFields(void);
76
77 void reallyAdjustScaleTabSize(SoGLRenderAction * action);
78
79 void getXYScreenLengths(SbVec2f & lengths, const SbMatrix & localtoscreen,
80 const SbVec2s & winsize);
81
82 void dragStart(void);
83 void drag(void);
84 void dragFinish(void);
85
86 // Lots of public/protected methods and members were removed from
87 // this class as they clearly should have been private.
88 // Let us know if we've removed something that you need.
89 // pederb, 20000226
90
91 private:
92
93 // static methods moved from public to private
94 static void startCB(void * f, SoDragger * d);
95 static void motionCB(void * f, SoDragger * d);
96 static void finishCB(void * f, SoDragger * d);
97 static void metaKeyChangeCB(void * f, SoDragger * d);
98 static void fieldSensorCB(void * f, SoSensor * s);
99 static void valueChangedCB(void * f, SoDragger * d);
100
101 void createPrivateParts(void);
102 SoNode *getNodeFieldNode(const char *fieldname);
103
104 SoFieldSensor * scaleFieldSensor;
105 SoFieldSensor * translFieldSensor;
106 SbLineProjector *lineProj;
107 SbPlaneProjector *planeProj;
108 int whatkind;
109 int constraintState;
110 float prevsizex;
111 float prevsizey;
112 SbBool adjustTabs;
113 SbVec3f worldRestartPt;
114 SbVec3f scaleCenter;
115
116 private:
117 SbLazyPimplPtr<SoTabPlaneDraggerP> pimpl;
118
119 // NOT IMPLEMENTED:
120 SoTabPlaneDragger(const SoTabPlaneDragger & rhs);
121 SoTabPlaneDragger & operator = (const SoTabPlaneDragger & rhs);
122 }; // SoTabPlaneDragger
123
124 #endif // !COIN_SOTABPLANEDRAGGER_H

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.