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
SoSFVec3f
The SoSFVec3f class is a container for an SbVec3f vector.
Definition: SoSFVec3f.h:31
SbRotation
The SbRotation class represents a rotation in 3D space.
Definition: SbRotation.h:33
SoDragger::workFieldsIntoTransform
void workFieldsIntoTransform(SbMatrix &mtx)
Definition: SoDragger.cpp:1123
SoDragPointDragger::setUpConnections
virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways=0)
Definition: SoDragPointDragger.cpp:323
SoDragger::registerChildDragger
void registerChildDragger(SoDragger *child)
Definition: SoDragger.cpp:722
SoRotation
The SoRotation class specifies a rotation transformation.
Definition: SoRotation.h:31
SoDragPointDragger::~SoDragPointDragger
~SoDragPointDragger()
Definition: SoDragPointDragger.cpp:316
SoDragPointDragger::drag
void drag(void)
Definition: SoDragPointDragger.cpp:512
SbMatrix
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition: SbMatrix.h:37
SoTranslate1Dragger
The SoTranslate1Dragger class provides a mechanism for the end-user to translate along an axis.
Definition: SoTranslate1Dragger.h:35
SoBaseKit::getAnyPart
virtual SoNode * getAnyPart(const SbName &partname, SbBool makeifneeded, SbBool leafcheck=0, SbBool publiccheck=0)
Definition: SoBaseKit.cpp:1722
SoSensor
The SoSensor class is the abstract base class for all sensors.
Definition: SoSensor.h:34
SoDragPointDragger::startCB
static void startCB(void *f, SoDragger *d)
Definition: SoDragPointDragger.cpp:537
SoDragger::getActiveChildDragger
SoDragger * getActiveChildDragger(void) const
Definition: SoDragger.cpp:1734
SoDragger::getEvent
const SoEvent * getEvent(void) const
Definition: SoDragger.cpp:962
SoDragPointDragger::setJumpLimit
void setJumpLimit(const float limit)
Definition: SoDragPointDragger.cpp:438
SoDragPointDragger
The SoDragPointDragger class provides mechanisms for moving a point in 3D.
Definition: SoDragPointDragger.h:34
SoFieldSensor::getAttachedField
SoField * getAttachedField(void) const
Definition: SoFieldSensor.cpp:107
SoDragger::addOtherEventCallback
void addOtherEventCallback(SoDraggerCB *func, void *data=NULL)
Definition: SoDragger.cpp:702
SoSwitch
The SoSwitch class is a group node which selects one child subgraph for traversal.
Definition: SoSwitch.h:37
SoInteractionKit::setSwitchValue
static void setSwitchValue(SoNode *node, const int newVal)
Definition: SoInteractionKit.cpp:358
SoDelayQueueSensor::setPriority
void setPriority(uint32_t pri)
Definition: SoDelayQueueSensor.cpp:108
SoDragger
The SoDragger class is the base class for all draggers.
Definition: SoDragger.h:53
SoInteractionKit::readDefaultParts
static void readDefaultParts(const char *fileName, const char defaultBuffer[], int defBufSize)
Definition: SoInteractionKit.cpp:433
SoDragger::addFinishCallback
void addFinishCallback(SoDraggerCB *func, void *data=NULL)
Definition: SoDragger.cpp:611
SoFieldSensor::detach
void detach(void)
Definition: SoFieldSensor.cpp:92
SoInteractionKit::setUpConnections
virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways=0)
Definition: SoInteractionKit.cpp:648
SoDragPointDragger::fieldSensorCB
static void fieldSensorCB(void *f, SoSensor *s)
Definition: SoDragPointDragger.cpp:403
SoDragger::addValueChangedCallback
void addValueChangedCallback(SoDraggerCB *func, void *data=NULL)
Definition: SoDragger.cpp:634
SoDragger::setMotionMatrix
void setMotionMatrix(const SbMatrix &newmatrix)
Definition: SoDragger.cpp:905
SoRotation::rotation
SoSFRotation rotation
Definition: SoRotation.h:40
SoField::setDefault
void setDefault(SbBool def)
Definition: SoField.cpp:650
SoDragPointDragger::showNextDraggerSet
void showNextDraggerSet(void)
Definition: SoDragPointDragger.cpp:468
SoTranslate2Dragger
The SoTranslate2Dragger class provides a mechanism for the end-user to translate in a plane.
Definition: SoTranslate2Dragger.h:35
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
SoDragPointDragger::valueChangedCB
static void valueChangedCB(void *f, SoDragger *d)
Definition: SoDragPointDragger.cpp:413
SoDragPointDragger::finishCB
static void finishCB(void *f, SoDragger *d)
Definition: SoDragPointDragger.cpp:553
SoDragPointDragger::dragStart
void dragStart(void)
Definition: SoDragPointDragger.cpp:478
SoDragger::setDefaultOnNonWritingFields
virtual void setDefaultOnNonWritingFields(void)
Definition: SoDragger.cpp:1743
SoBaseKit::connectionsSetUp
SbBool connectionsSetUp
Definition: SoBaseKit.h:142
SoFieldSensor::attach
void attach(SoField *field)
Definition: SoFieldSensor.cpp:77
SoDragger::getMotionMatrix
const SbMatrix & getMotionMatrix(void)
Definition: SoDragger.cpp:688
SoFieldSensor
The SoFieldSensor class detects changes to a field.
Definition: SoFieldSensor.h:29
SoSeparator
The SoSeparator class is a state-preserving group node.
Definition: SoSeparator.h:34
SoDragger::unregisterChildDragger
void unregisterChildDragger(SoDragger *child)
Definition: SoDragger.cpp:735
SoDragPointDragger::dragFinish
void dragFinish(void)
Definition: SoDragPointDragger.cpp:522
SoDragPointDragger::metaKeyChangeCB
static void metaKeyChangeCB(void *f, SoDragger *d)
Definition: SoDragPointDragger.cpp:561
SoDragPointDragger::fieldSensor
SoFieldSensor * fieldSensor
Definition: SoDragPointDragger.h:104
SoBase::isOfType
SbBool isOfType(SoType type) const
Definition: SoBase.cpp:710
SoTranslation
The SoTranslation class is a node type for specifying geometry translations.
Definition: SoTranslation.h:31
SoDragger::addStartCallback
void addStartCallback(SoDraggerCB *func, void *data=NULL)
Definition: SoDragger.cpp:570
SoDragPointDragger::setDefaultOnNonWritingFields
virtual void setDefaultOnNonWritingFields(void)
Definition: SoDragPointDragger.cpp:383
SoDragPointDragger::getJumpLimit
float getJumpLimit(void) const
Definition: SoDragPointDragger.cpp:453
SoInteractionKit::fieldSensorCB
static void fieldSensorCB(void *, SoSensor *)
Definition: SoInteractionKit.cpp:725
SoDragPointDragger::motionCB
static void motionCB(void *f, SoDragger *d)
Definition: SoDragPointDragger.cpp:545
SoEvent
The SoEvent class is the base class for all Coin events.
Definition: SoEvent.h:34
SoInteractionKit::setAnyPartAsDefault
virtual SbBool setAnyPartAsDefault(const SbName &partname, SoNode *node, SbBool anypart=1, SbBool onlyifdefault=1)
Definition: SoInteractionKit.cpp:496
SoDragger::addMotionCallback
void addMotionCallback(SoDraggerCB *func, void *data=NULL)
Definition: SoDragger.cpp:591
SoDragger::initClass
static void initClass(void)
Definition: SoDragger.cpp:388
SoDragPointDragger::translation
SoSFVec3f translation
Definition: SoDragPointDragger.h:86
SoInteractionKit::setPartAsDefault
virtual SbBool setPartAsDefault(const SbName &partname, SoNode *node, SbBool onlyifdefault=1)
Definition: SoInteractionKit.cpp:271
SoDragPointDragger::SoDragPointDragger
SoDragPointDragger(void)
Definition: SoDragPointDragger.cpp:203

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

Generated on Mon Jul 27 2020 for Coin by Doxygen. 1.8.18