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

SoTrackballDragger.h
1 #ifndef COIN_SOTRACKBALLDRAGGER_H
2 #define COIN_SOTRACKBALLDRAGGER_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/SoSFRotation.h>
29 #include <Inventor/fields/SoSFVec3f.h>
30 #include <Inventor/SbVec2f.h>
31 #include <Inventor/SbTime.h>
32 
33 class SoSensor;
34 class SoFieldSensor;
35 class SbSphereProjector;
37 class SbLineProjector;
38 class SoTimerSensor;
39 
40 class COIN_DLL_API SoTrackballDragger : public SoDragger {
41  typedef SoDragger inherited;
42 
43  SO_KIT_HEADER(SoTrackballDragger);
44 
45  SO_KIT_CATALOG_ENTRY_HEADER(XRotator);
46  SO_KIT_CATALOG_ENTRY_HEADER(XRotatorActive);
47  SO_KIT_CATALOG_ENTRY_HEADER(XRotatorSwitch);
48  SO_KIT_CATALOG_ENTRY_HEADER(YRotator);
49  SO_KIT_CATALOG_ENTRY_HEADER(YRotatorActive);
50  SO_KIT_CATALOG_ENTRY_HEADER(YRotatorSwitch);
51  SO_KIT_CATALOG_ENTRY_HEADER(ZRotator);
52  SO_KIT_CATALOG_ENTRY_HEADER(ZRotatorActive);
53  SO_KIT_CATALOG_ENTRY_HEADER(ZRotatorSwitch);
54  SO_KIT_CATALOG_ENTRY_HEADER(antiSquish);
55  SO_KIT_CATALOG_ENTRY_HEADER(rotator);
56  SO_KIT_CATALOG_ENTRY_HEADER(rotatorActive);
57  SO_KIT_CATALOG_ENTRY_HEADER(rotatorSwitch);
58  SO_KIT_CATALOG_ENTRY_HEADER(surroundScale);
59  SO_KIT_CATALOG_ENTRY_HEADER(userAxis);
60  SO_KIT_CATALOG_ENTRY_HEADER(userAxisActive);
61  SO_KIT_CATALOG_ENTRY_HEADER(userAxisRotation);
62  SO_KIT_CATALOG_ENTRY_HEADER(userAxisSwitch);
63  SO_KIT_CATALOG_ENTRY_HEADER(userRotator);
64  SO_KIT_CATALOG_ENTRY_HEADER(userRotatorActive);
65  SO_KIT_CATALOG_ENTRY_HEADER(userRotatorSwitch);
66 
67 
68 public:
69  static void initClass(void);
70  SoTrackballDragger(void);
71 
74 
75  SbBool isAnimationEnabled(void);
76  void setAnimationEnabled(SbBool newval);
77 
78 protected:
80  virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE);
81  virtual void setDefaultOnNonWritingFields(void);
82 
83  void dragStart(void);
84  void drag(void);
85  void dragFinish(void);
86  void setAllPartsActive(SbBool onoroff);
87 
88  static void startCB(void * f, SoDragger * d);
89  static void motionCB(void * f, SoDragger * d);
90  static void finishCB(void * f, SoDragger * d);
91  static void metaKeyChangeCB(void * f, SoDragger * d);
92  static void fieldSensorCB(void * f, SoSensor * s);
93  static void valueChangedCB(void * f, SoDragger * d);
94 
97 
98 private:
99  SoNode * getNodeFieldNode(const char *fieldname);
100  void updateUserAxisSwitches(const SbBool setactive = FALSE);
101  static void timerSensorCB(void *, SoSensor *);
102 
103  class SoTrackballDraggerP * pimpl;
104  friend class SoTrackballDraggerP;
105 };
106 
107 #endif // !COIN_SOTRACKBALLDRAGGER_H
SoTrackballDragger::drag
void drag(void)
Definition: SoTrackballDragger.cpp:607
SoSFVec3f
The SoSFVec3f class is a container for an SbVec3f vector.
Definition: SoSFVec3f.h:31
SoDB::getGlobalField
static SoField * getGlobalField(const SbName &name)
Definition: SoDB.cpp:1297
SbRotation::getValue
const float * getValue(void) const
Definition: SbRotation.cpp:179
SbRotation
The SbRotation class represents a rotation in 3D space.
Definition: SbRotation.h:33
SoDragger::workFieldsIntoTransform
void workFieldsIntoTransform(SbMatrix &mtx)
Definition: SoDragger.cpp:1123
SoTrackballDragger::~SoTrackballDragger
~SoTrackballDragger()
Definition: SoTrackballDragger.cpp:341
SoRotation
The SoRotation class specifies a rotation transformation.
Definition: SoRotation.h:31
SoTrackballDragger::setAllPartsActive
void setAllPartsActive(SbBool onoroff)
Definition: SoTrackballDragger.cpp:756
SoTrackballDragger::dragStart
void dragStart(void)
Definition: SoTrackballDragger.cpp:478
SoFieldContainer::getField
virtual SoField * getField(const SbName &name) const
Definition: SoFieldContainer.cpp:364
SoTrackballDragger::scaleFactor
SoSFVec3f scaleFactor
Definition: SoTrackballDragger.h:73
SbVec2f
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition: SbVec2f.h:36
SbRotation::identity
static SbRotation identity(void)
Definition: SbRotation.cpp:674
SoTrackballDragger
The SoTrackballDragger provides the end-user with rotation and scaling interaction possibilities.
Definition: SoTrackballDragger.h:40
SbMatrix
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition: SbMatrix.h:37
SoSFRotation
The SoSFRotation class is a container for an SbRotation.
Definition: SoSFRotation.h:31
SbCylinderPlaneProjector
The SbCylinderPlaneProjector class projects 2D points to a half-cylinder and a plane.
Definition: SbCylinderPlaneProjector.h:29
SoBaseKit::getAnyPart
virtual SoNode * getAnyPart(const SbName &partname, SbBool makeifneeded, SbBool leafcheck=0, SbBool publiccheck=0)
Definition: SoBaseKit.cpp:1722
SbSphereProjector
The SbSphereProjector class is the abstract base class for mapping to spherical surfaces.
Definition: SbSphereProjector.h:31
SoSensor
The SoSensor class is the abstract base class for all sensors.
Definition: SoSensor.h:34
SoBaseKit::getPart
virtual SoNode * getPart(const SbName &partname, SbBool makeifneeded)
Definition: SoBaseKit.cpp:699
SoTrackballDragger::scaleFieldSensor
SoFieldSensor * scaleFieldSensor
Definition: SoTrackballDragger.h:96
SoDragger::getFrontOnProjector
ProjectorFrontSetting getFrontOnProjector(void) const
Definition: SoDragger.cpp:1165
SoDragger::getEvent
const SoEvent * getEvent(void) const
Definition: SoDragger.cpp:962
SbMatrix::multVecMatrix
void multVecMatrix(const SbVec3f &src, SbVec3f &dst) const
Definition: SbMatrix.cpp:1357
SoTrackballDragger::dragFinish
void dragFinish(void)
Definition: SoTrackballDragger.cpp:686
SoFieldSensor::getAttachedField
SoField * getAttachedField(void) const
Definition: SoFieldSensor.cpp:107
SbCylinder
The SbCylinder class is a representation of a cylinder.
Definition: SbCylinder.h:32
SoDragger::addOtherEventCallback
void addOtherEventCallback(SoDraggerCB *func, void *data=NULL)
Definition: SoDragger.cpp:702
SbMatrix::multLeft
SbMatrix & multLeft(const SbMatrix &m)
Definition: SbMatrix.cpp:1280
SoDebugError::postWarning
static void postWarning(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:324
SoSurroundScale
The SoSurroundScale class is used to automatically scale geometry to surround other geometry.
Definition: SoSurroundScale.h:34
SoTrackballDragger::setUpConnections
virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways=0)
Definition: SoTrackballDragger.cpp:355
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
SoSwitch::whichChild
SoSFInt32 whichChild
Definition: SoSwitch.h:47
SoTrackballDragger::motionCB
static void motionCB(void *f, SoDragger *d)
Definition: SoTrackballDragger.cpp:780
SoDelayQueueSensor::setPriority
void setPriority(uint32_t pri)
Definition: SoDelayQueueSensor.cpp:108
SbMatrix::multRight
SbMatrix & multRight(const SbMatrix &m)
Definition: SbMatrix.cpp:1240
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::FRONT
@ FRONT
Definition: SoDragger.h:63
SoDragger::addFinishCallback
void addFinishCallback(SoDraggerCB *func, void *data=NULL)
Definition: SoDragger.cpp:611
SoFieldSensor::detach
void detach(void)
Definition: SoFieldSensor.cpp:92
SbSpherePlaneProjector
The SbSpherePlaneProjector class projects 2D points to a half-sphere and a plane.
Definition: SbSpherePlaneProjector.h:29
SoInteractionKit::setUpConnections
virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways=0)
Definition: SoInteractionKit.cpp:648
SbVec3f::length
float length(void) const
Definition: SbVec3f.cpp:356
SoDragger::appendRotation
static SbMatrix appendRotation(const SbMatrix &mtx, const SbRotation &rot, const SbVec3f &rotcenter, const SbMatrix *conversion=NULL)
Definition: SoDragger.cpp:1388
SoTrackballDragger::finishCB
static void finishCB(void *f, SoDragger *d)
Definition: SoTrackballDragger.cpp:788
SoDragger::USE_PICK
@ USE_PICK
Definition: SoDragger.h:63
SoSurroundScale::invalidate
void invalidate(void)
Definition: SoSurroundScale.cpp:270
SoDragger::getViewVolume
const SbViewVolume & getViewVolume(void)
Definition: SoDragger.cpp:1032
SoDragger::addValueChangedCallback
void addValueChangedCallback(SoDraggerCB *func, void *data=NULL)
Definition: SoDragger.cpp:634
SoDragger::setMotionMatrix
void setMotionMatrix(const SbMatrix &newmatrix)
Definition: SoDragger.cpp:905
SoPath::findNode
int findNode(const SoNode *const node) const
Definition: SoPath.cpp:587
SoField
The SoField class is the top-level abstract base class for fields.
Definition: SoField.h:38
SoPath
The SoPath class is a container class for traversal path descriptions.
Definition: SoPath.h:43
SoRotation::rotation
SoSFRotation rotation
Definition: SoRotation.h:40
SoTrackballDragger::valueChangedCB
static void valueChangedCB(void *f, SoDragger *d)
Definition: SoTrackballDragger.cpp:414
SoField::setDefault
void setDefault(SbBool def)
Definition: SoField.cpp:650
SoTrackballDragger::fieldSensorCB
static void fieldSensorCB(void *f, SoSensor *s)
Definition: SoTrackballDragger.cpp:404
SoTrackballDragger::SoTrackballDragger
SoTrackballDragger(void)
Definition: SoTrackballDragger.cpp:253
SbSphere
The SbSphere class is a representation of a sphere.
Definition: SbSphere.h:33
SoAntiSquish::sizing
SoSFEnum sizing
Definition: SoAntiSquish.h:47
SoTrackballDragger::rotation
SoSFRotation rotation
Definition: SoTrackballDragger.h:72
SbMatrix::getTransform
void getTransform(SbVec3f &t, SbRotation &r, SbVec3f &s, SbRotation &so) const
Definition: SbMatrix.cpp:997
SbVec3f::setValue
SbVec3f & setValue(const float v[3])
Definition: SbVec3f.cpp:461
SoTimerSensor
The SoTimerSensor class is a sensor which will trigger at given intervals.
Definition: SoTimerSensor.h:29
SoDragger::appendScale
static SbMatrix appendScale(const SbMatrix &mtx, const SbVec3f &scale, const SbVec3f &scalecenter, const SbMatrix *conversion=NULL)
Definition: SoDragger.cpp:1271
SoDragger::saveStartParameters
virtual void saveStartParameters(void)
Definition: SoDragger.cpp:944
SoTrackballDragger::startCB
static void startCB(void *f, SoDragger *d)
Definition: SoTrackballDragger.cpp:772
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
SbTime::getValue
double getValue(void) const
Definition: SbTime.cpp:259
SbVec3f::dot
float dot(const SbVec3f &v) const
Definition: SbVec3f.cpp:282
SoDragger::setDefaultOnNonWritingFields
virtual void setDefaultOnNonWritingFields(void)
Definition: SoDragger.cpp:1743
SoBaseKit::connectionsSetUp
SbBool connectionsSetUp
Definition: SoBaseKit.h:142
SoTrackballDragger::setAnimationEnabled
void setAnimationEnabled(SbBool newval)
Definition: SoTrackballDragger.cpp:454
SoFieldSensor::attach
void attach(SoField *field)
Definition: SoFieldSensor.cpp:77
SoSFTime
The SoSFTime class is a container for an SbTime value.
Definition: SoSFTime.h:31
SoDragger::getMotionMatrix
const SbMatrix & getMotionMatrix(void)
Definition: SoDragger.cpp:688
SbRotation::multVec
void multVec(const SbVec3f &src, SbVec3f &dst) const
Definition: SbRotation.cpp:593
SoFieldSensor
The SoFieldSensor class detects changes to a field.
Definition: SoFieldSensor.h:29
SoInteractionKit
The SoInteractionKit class is a base class for draggers.
Definition: SoInteractionKit.h:41
SoSFNode
The SoSFNode class is a container for a single node.
Definition: SoSFNode.h:38
SbLine
The SbLine class represents a line in 3D space.
Definition: SbLine.h:32
SoSeparator
The SoSeparator class is a state-preserving group node.
Definition: SoSeparator.h:34
SbVec3f::normalize
float normalize(void)
Definition: SbVec3f.cpp:436
SoDragger::getNormalizedLocaterPosition
SbVec2f getNormalizedLocaterPosition(void)
Definition: SoDragger.cpp:1408
SoDragger::setStartingPoint
void setStartingPoint(const SoPickedPoint *newpoint)
Definition: SoDragger.cpp:1014
SoDragger::getPickPath
const SoPath * getPickPath(void) const
Definition: SoDragger.cpp:953
SoAntiSquish
The SoAntiSquish class is used to reset to uniform scaling.
Definition: SoAntiSquish.h:33
SbTime
The SbTime class instances represents time values.
Definition: SbTime.h:41
SoDragger::getStartMotionMatrix
const SbMatrix & getStartMotionMatrix(void)
Definition: SoDragger.cpp:930
SoTrackballDragger::setDefaultOnNonWritingFields
virtual void setDefaultOnNonWritingFields(void)
Definition: SoTrackballDragger.cpp:385
SbCylinderProjector
The SbCylinderProjector class is the abstract base class for mapping to cylindrical surfaces.
Definition: SbCylinderProjector.h:30
SoBaseKit
The SoBaseKit class is the toplevel superclass for nodekits.
Definition: SoBaseKit.h:57
SoTrackballDragger::rotFieldSensor
SoFieldSensor * rotFieldSensor
Definition: SoTrackballDragger.h:95
SoNode
The SoNode class is the base class for nodes used in scene graphs.
Definition: SoNode.h:47
SoDragger::addStartCallback
void addStartCallback(SoDraggerCB *func, void *data=NULL)
Definition: SoDragger.cpp:570
SbTime::getTimeOfDay
static SbTime getTimeOfDay(void)
Definition: SbTime.cpp:139
SoField::isOfType
SbBool isOfType(const SoType type) const
Definition: SoField.cpp:690
SoInteractionKit::fieldSensorCB
static void fieldSensorCB(void *, SoSensor *)
Definition: SoInteractionKit.cpp:725
SoEvent
The SoEvent class is the base class for all Coin events.
Definition: SoEvent.h:34
SoDragger::addMotionCallback
void addMotionCallback(SoDraggerCB *func, void *data=NULL)
Definition: SoDragger.cpp:591
SoTrackballDragger::isAnimationEnabled
SbBool isAnimationEnabled(void)
Definition: SoTrackballDragger.cpp:442
SoTrackballDragger::metaKeyChangeCB
static void metaKeyChangeCB(void *f, SoDragger *d)
Definition: SoTrackballDragger.cpp:796
SoDragger::initClass
static void initClass(void)
Definition: SoDragger.cpp:388
SbLineProjector
The SbLineProjector class projects 2D points to 3D points along a line.
Definition: SbLineProjector.h:32
SoDragger::getWorldStartingPoint
SbVec3f getWorldStartingPoint(void)
Definition: SoDragger.cpp:816
SoInteractionKit::setPartAsDefault
virtual SbBool setPartAsDefault(const SbName &partname, SoNode *node, SbBool onlyifdefault=1)
Definition: SoInteractionKit.cpp:271
SoDragger::BACK
@ BACK
Definition: SoDragger.h:63

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

Generated on Wed Jul 24 2019 for Coin by Doxygen. 1.8.17