Coin Logo http://www.sim.no/
http://www.coin3d.org/

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 
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 
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:
121  SoTabPlaneDragger & operator = (const SoTabPlaneDragger & rhs);
122 }; // SoTabPlaneDragger
123 
124 #endif // !COIN_SOTABPLANEDRAGGER_H
The SbVec2f class is a 2 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec2f.h:39
static void fieldSensorCB(void *, SoSensor *)
Definition: SoInteractionKit.cpp:742
SoSFVec3f translation
Definition: SoTabPlaneDragger.h:64
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
The SoInteractionKit class is a base class for draggers.This nodekit class makes it possible to set s...
Definition: SoInteractionKit.h:41
The SoTabPlaneDragger class is a dragger you can translate and scale within a plane.Here&#39;s how the dragger looks with its default geometry in the inactive state:
Definition: SoTabPlaneDragger.h:37
The SoDragger class is the base class for all draggers.Draggers is a mechanism used for letting the e...
Definition: SoDragger.h:55
The SoSensor class is the abstract base class for all sensors.Sensors is a mechanism in Coin for sche...
Definition: SoSensor.h:34
static void initClass(void)
Definition: SoDragger.cpp:399
The SbVec3f class is a 3 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec3f.h:40
SoSFVec3f scaleFactor
Definition: SoTabPlaneDragger.h:65
The SoFieldSensor class detects changes to a field.Attach a field to a sensor of this type to put it ...
Definition: SoFieldSensor.h:29
virtual void GLRender(SoGLRenderAction *action)
Definition: SoDragger.cpp:516
The SbMatrix class is a 4x4 dimensional representation of a matrix.SbMatrix is used by many other cla...
Definition: SbMatrix.h:37
The SbPlaneProjector class projects 2D points to 3D points in a plane.The 3D projection of the 2D coo...
Definition: SbPlaneProjector.h:31
The SoSFVec3f class is a container for an SbVec3f vector.This field is used where nodes...
Definition: SoSFVec3f.h:31
The SbLineProjector class projects 2D points to 3D points along a line.The 3D projection of the 2D co...
Definition: SbLineProjector.h:32
The SbVec2s class is a 2 dimensional vector with short integer coordinates.This vector class is used ...
Definition: SbVec2s.h:41
virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways=FALSE)
Definition: SoInteractionKit.cpp:665
The SoGLRenderAction class renders the scene graph with OpenGL calls.Applying this method at a root n...
Definition: SoGLRenderAction.h:41
virtual void setDefaultOnNonWritingFields(void)
Definition: SoDragger.cpp:1791

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

Generated for Coin by Doxygen 1.8.14.