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

SoDragPointDragger.h
1 #ifndef COIN_SODRAGPOINTDRAGGER_H
2 #define COIN_SODRAGPOINTDRAGGER_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 
33 
34 class COIN_DLL_API SoDragPointDragger : public SoDragger {
35  typedef SoDragger inherited;
36 
37  SO_KIT_HEADER(SoDragPointDragger);
38 
39  SO_KIT_CATALOG_ENTRY_HEADER(noRotSep);
40  SO_KIT_CATALOG_ENTRY_HEADER(planeFeedbackSep);
41  SO_KIT_CATALOG_ENTRY_HEADER(planeFeedbackSwitch);
42  SO_KIT_CATALOG_ENTRY_HEADER(planeFeedbackTranslation);
43  SO_KIT_CATALOG_ENTRY_HEADER(rotX);
44  SO_KIT_CATALOG_ENTRY_HEADER(rotXSep);
45  SO_KIT_CATALOG_ENTRY_HEADER(rotY);
46  SO_KIT_CATALOG_ENTRY_HEADER(rotYSep);
47  SO_KIT_CATALOG_ENTRY_HEADER(rotZ);
48  SO_KIT_CATALOG_ENTRY_HEADER(rotZSep);
49  SO_KIT_CATALOG_ENTRY_HEADER(xFeedback);
50  SO_KIT_CATALOG_ENTRY_HEADER(xFeedbackSep);
51  SO_KIT_CATALOG_ENTRY_HEADER(xFeedbackSwitch);
52  SO_KIT_CATALOG_ENTRY_HEADER(xFeedbackTranslation);
53  SO_KIT_CATALOG_ENTRY_HEADER(xTranslator);
54  SO_KIT_CATALOG_ENTRY_HEADER(xTranslatorSwitch);
55  SO_KIT_CATALOG_ENTRY_HEADER(xyFeedback);
56  SO_KIT_CATALOG_ENTRY_HEADER(xyTranslator);
57  SO_KIT_CATALOG_ENTRY_HEADER(xyTranslatorSwitch);
58  SO_KIT_CATALOG_ENTRY_HEADER(xzFeedback);
59  SO_KIT_CATALOG_ENTRY_HEADER(xzTranslator);
60  SO_KIT_CATALOG_ENTRY_HEADER(xzTranslatorSwitch);
61  SO_KIT_CATALOG_ENTRY_HEADER(yFeedback);
62  SO_KIT_CATALOG_ENTRY_HEADER(yFeedbackSep);
63  SO_KIT_CATALOG_ENTRY_HEADER(yFeedbackSwitch);
64  SO_KIT_CATALOG_ENTRY_HEADER(yFeedbackTranslation);
65  SO_KIT_CATALOG_ENTRY_HEADER(yTranslator);
66  SO_KIT_CATALOG_ENTRY_HEADER(yTranslatorSwitch);
67  SO_KIT_CATALOG_ENTRY_HEADER(yzFeedback);
68  SO_KIT_CATALOG_ENTRY_HEADER(yzTranslator);
69  SO_KIT_CATALOG_ENTRY_HEADER(yzTranslatorSwitch);
70  SO_KIT_CATALOG_ENTRY_HEADER(zFeedback);
71  SO_KIT_CATALOG_ENTRY_HEADER(zFeedbackSep);
72  SO_KIT_CATALOG_ENTRY_HEADER(zFeedbackSwitch);
73  SO_KIT_CATALOG_ENTRY_HEADER(zFeedbackTranslation);
74  SO_KIT_CATALOG_ENTRY_HEADER(zTranslator);
75  SO_KIT_CATALOG_ENTRY_HEADER(zTranslatorSwitch);
76 
77 
78 public:
79  static void initClass(void);
80  SoDragPointDragger(void);
81 
82  void setJumpLimit(const float limit);
83  float getJumpLimit(void) const;
84  void showNextDraggerSet(void);
85 
87 
88 protected:
90  virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE);
91  virtual void setDefaultOnNonWritingFields(void);
92 
93  void dragStart(void);
94  void drag(void);
95  void dragFinish(void);
96 
97  static void startCB(void * f, SoDragger * d);
98  static void motionCB(void * f, SoDragger * d);
99  static void finishCB(void * f, SoDragger * d);
100  static void metaKeyChangeCB(void * f, SoDragger * d);
101  static void fieldSensorCB(void * f, SoSensor * s);
102  static void valueChangedCB(void * f, SoDragger * d);
103 
105 
106 private:
107  void registerDragger(SoDragger *dragger);
108  void unregisterDragger(const char *name);
109  void updateSwitchNodes();
110  int currAxis;
111  float jumpLimit;
112 };
113 
114 #endif // !COIN_SODRAGPOINTDRAGGER_H
static void fieldSensorCB(void *, SoSensor *)
Definition: SoInteractionKit.cpp:725
SoFieldSensor * fieldSensor
Definition: SoDragPointDragger.h:104
SoSFVec3f translation
Definition: SoDragPointDragger.h:86
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 SoFieldSensor class detects changes to a field.Attach a field to a sensor of this type to put it ...
Definition: SoFieldSensor.h:29
The SoSFVec3f class is a container for an SbVec3f vector.This field is used where nodes...
Definition: SoSFVec3f.h:31
The SoDragPointDragger class provides mechanisms for moving a point in 3D.Here&#39;s how the dragger look...
Definition: SoDragPointDragger.h:34
virtual void setDefaultOnNonWritingFields(void)
Definition: SoDragger.cpp:1743

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

Generated on Fri Jul 20 2018 for Coin by Doxygen. 1.8.14