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) 1998-2007 by Systems in Motion. All rights reserved.
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 Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, 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/fields/SoSFVec3f.h>
29 
30 class SoSensor;
31 class SoFieldSensor;
32 class SbLineProjector;
33 class SbPlaneProjector;
34 
35 
36 class COIN_DLL_API SoTabPlaneDragger : public SoDragger {
37  typedef SoDragger inherited;
38 
39  SO_KIT_HEADER(SoTabPlaneDragger);
40 
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 
61 public:
62  static void initClass(void);
63  SoTabPlaneDragger(void);
64 
67 
68  void adjustScaleTabSize(void);
69 
70 protected:
71 
73 
74  virtual void GLRender(SoGLRenderAction * action);
75 
76  virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE);
77  virtual void setDefaultOnNonWritingFields(void);
78 
79  void reallyAdjustScaleTabSize(SoGLRenderAction * action);
80 
81  void getXYScreenLengths(SbVec2f & lengths, const SbMatrix & localtoscreen,
82  const SbVec2s & winsize);
83 
84  void dragStart(void);
85  void drag(void);
86  void dragFinish(void);
87 
88  // Lots of public/protected methods and members were removed from
89  // this class as they clearly should have been private.
90  // Let us know if we've removed something that you need.
91  // pederb, 20000226
92 
93 private:
94 
95  // static methods moved from public to private
96  static void startCB(void * f, SoDragger * d);
97  static void motionCB(void * f, SoDragger * d);
98  static void finishCB(void * f, SoDragger * d);
99  static void metaKeyChangeCB(void * f, SoDragger * d);
100  static void fieldSensorCB(void * f, SoSensor * s);
101  static void valueChangedCB(void * f, SoDragger * d);
102 
103  void createPrivateParts(void);
104  SoNode *getNodeFieldNode(const char *fieldname);
105 
106  SoFieldSensor * scaleFieldSensor;
107  SoFieldSensor * translFieldSensor;
108  SbLineProjector *lineProj;
109  SbPlaneProjector *planeProj;
110  int whatkind;
111  int constraintState;
112  float prevsizex;
113  float prevsizey;
114  SbBool adjustTabs;
115  SbVec3f worldRestartPt;
116  SbVec3f scaleCenter;
117 };
118 
119 #endif // !COIN_SOTABPLANEDRAGGER_H
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition: SbVec2f.h:36
static void fieldSensorCB(void *, SoSensor *)
Definition: SoInteractionKit.cpp:725
SoSFVec3f translation
Definition: SoTabPlaneDragger.h:65
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:36
The SoDragger class is the base class for all draggers.Draggers is a mechanism used for letting the e...
Definition: SoDragger.h:53
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:388
virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways=0)
Definition: SoInteractionKit.cpp:648
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
SoSFVec3f scaleFactor
Definition: SoTabPlaneDragger.h:66
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:505
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:37
The SoGLRenderAction class renders the scene graph with OpenGL calls.Applying this method at a root n...
Definition: SoGLRenderAction.h:39
virtual void setDefaultOnNonWritingFields(void)
Definition: SoDragger.cpp:1743

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Fri Feb 17 2017 for Coin by Doxygen. 1.8.13