| 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) 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 SoDragPointDraggerP;
34
35 class COIN_DLL_API SoDragPointDragger : public SoDragger {
36 typedef SoDragger inherited;
37
38 SO_KIT_HEADER(SoDragPointDragger);
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 public:
78 static void initClass(void);
79 SoDragPointDragger(void);
80
81 SoSFVec3f translation;
82
83 void setJumpLimit(const float limit);
84 float getJumpLimit(void) const;
85 void showNextDraggerSet(void);
86
87 protected:
88 virtual ~SoDragPointDragger(void);
89 virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE);
90 virtual void setDefaultOnNonWritingFields(void);
91
92 void dragStart(void);
93 void drag(void);
94 void dragFinish(void);
95
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 SoFieldSensor * fieldSensor;
104
105 private:
106 void registerDragger(SoDragger *dragger);
107 void unregisterDragger(const char *name);
108 void updateSwitchNodes();
109 int currAxis;
110 float jumpLimit;
111
112 private:
113 SbLazyPimplPtr<SoDragPointDraggerP> pimpl;
114
115 // NOT IMPLEMENTED:
116 SoDragPointDragger(const SoDragPointDragger & rhs);
117 SoDragPointDragger & operator = (const SoDragPointDragger & rhs);
118 }; // SoDragPointDragger
119
120 #endif // !COIN_SODRAGPOINTDRAGGER_H
SoInteractionKit::fieldSensorCB
static void fieldSensorCB(void *, SoSensor *)
Definition: SoInteractionKit.cpp:742
SoDragPointDragger::fieldSensor
SoFieldSensor * fieldSensor
Definition: SoDragPointDragger.h:103
SoDragPointDragger::translation
SoSFVec3f translation
Definition: SoDragPointDragger.h:81
SoDragger
The SoDragger class is the base class for all draggers.Draggers is a mechanism used for letting the e...
Definition: SoDragger.h:55
SoSensor
The SoSensor class is the abstract base class for all sensors.Sensors is a mechanism in Coin for sche...
Definition: SoSensor.h:34
SoDragger::initClass
static void initClass(void)
Definition: SoDragger.cpp:399
SoFieldSensor
The SoFieldSensor class detects changes to a field.Attach a field to a sensor of this type to put it ...
Definition: SoFieldSensor.h:29
SoSFVec3f
The SoSFVec3f class is a container for an SbVec3f vector.This field is used where nodes...
Definition: SoSFVec3f.h:31
SoInteractionKit::setUpConnections
virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways=FALSE)
Definition: SoInteractionKit.cpp:665
SoDragPointDragger
The SoDragPointDragger class provides mechanisms for moving a point in 3D.Here&#39;s how the dragger look...
Definition: SoDragPointDragger.h:35
SoDragger.h
SoDragger::setDefaultOnNonWritingFields
virtual void setDefaultOnNonWritingFields(void)
Definition: SoDragger.cpp:1791

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