Open Inventor Reference
SoJackDragger.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
27 * Mountain View, CA 94043, or:
28 *
29 * http://www.sgi.com
30 *
31 * For further information regarding this notice, see:
32 *
33 * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
34 *
35 */
36
37
38/*
39 * Copyright (C) 1990,91,92 Silicon Graphics, Inc.
40 *
41 _______________________________________________________________________
42 ______________ S I L I C O N G R A P H I C S I N C . ____________
43 |
44 | $Revision: 1.1.1.1 $
45 |
46 | Description:
47 | This file defines the jack dragger class, so named because
48 | with the default geometry, it looks like the children's toy.
49 | This dragger allows you to perform rotations,uniform scales
50 | and translations, all in one spiffy gadget.
51 |
52 | Translation is done with a dragPointDragger, rotation with a
53 | rotateSphericalDragger, and scaling with a scaleUniformDragger.
54 |
55 | NOTE TO DEVELOPERS:
56 | For info about the structure of SoJackDragger:
57 | [1] compile: /usr/share/src/Inventor/samples/ivNodeKitStructure
58 | [2] type: ivNodeKitStructure SoJackDragger.
59 | [3] The program prints a diagram of the scene graph and a table with
60 | information about each part.
61 |
62 | The following parts in this dragger are created at construction time.
63 | 'ResourceName' corresponds to the name of the default geometry for the
64 | part. The dragger's constructor gets the scene graph for 'ResourceName'
65 | by querying the global dictionary ( SoDB::getByName("ResourceName"); ).
66 |
67 | Resource Name: Part Name:
68 |
69 | jackScalerScaler - scaler.scaler
70 | jackScalerScalerActive - scaler.scalerActive
71 | jackScalerFeedback - scaler.feedback
72 | jackScalerFeedbackActive - scaler.feedbackActive
73 |
74 | jackRotatorRotator - rotator.rotator
75 | jackRotatorRotatorActive - rotator.rotatorActive
76 | jackRotatorFeedback - rotator.feedback
77 | jackRotatorFeedbackActive - rotator.feedbackActive
78 |
79 | jackTranslatorLineTranslator -
80 | - translator.xTranslator.translator
81 | - translator.yTranslator.translator
82 | - translator.zTranslator.translator
83 |
84 | jackTranslatorLineTranslatorActive -
85 | - translator.xTranslator.translatorActive
86 | - translator.yTranslator.translatorActive
87 | - translator.zTranslator.translatorActive
88 |
89 | jackTranslatorPlaneTranslator -
90 | - translator.yzTranslator.translator
91 | - translator.xzTranslator.translator
92 | - translator.xyTranslator.translator
93 |
94 | jackTranslatorPlaneTranslatorActive -
95 | - translator.yzTranslator.translatorActive
96 | - translator.xzTranslator.translatorActive
97 | - translator.xyTranslator.translatorActive
98 |
99 | jackTranslatorXFeedback - translator.xFeedback
100 | jackTranslatorYFeedback - translator.yFeedback
101 | jackTranslatorZFeedback - translator.zFeedback
102 |
103 | jackTranslatorXYFeedback - translator.xyFeedback
104 | jackTranslatorXZFeedback - translator.xzFeedback
105 | jackTranslatorYZFeedback - translator.yzFeedback
106 |
107 | Author(s): Paul Isaacs
108 |
109 ______________ S I L I C O N G R A P H I C S I N C . ____________
110 _______________________________________________________________________
111 */
112
113#ifndef _SO_JACK_DRAGGER_
114#define _SO_JACK_DRAGGER_
115
116#include <Inventor/SbLinear.h>
121
122class SbDict;
123class SoFieldSensor;
124
127
196
198{
200
202 SO_KIT_CATALOG_ENTRY_HEADER(surroundScale);
204 SO_KIT_CATALOG_ENTRY_HEADER(antiSquish);
205
208 SO_KIT_CATALOG_ENTRY_HEADER(translator);
209
210 public:
211
214
218
219 SoINTERNAL public:
220 static void initClass();
221
222 protected:
223
227 static void fieldSensorCB( void *, SoSensor * );
228 static void valueChangedCB( void *, SoDragger * );
229
230 static void invalidateSurroundScaleCB( void *, SoDragger * );
231
240 virtual bool setUpConnections( bool onOff, bool doItAlways = FALSE );
241
243
244
245 virtual ~SoJackDragger();
246
247 private:
248 static const unsigned char geomBuffer[];
249};
250
251#endif /* _SO_JACK_DRAGGER_ */
#define FALSE
Definition SbBasic.h:79
#define SoINTERNAL
Definition SbBasic.h:155
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
Definition SbSystem.h:77
#define SO_KIT_CATALOG_ENTRY_HEADER(partName)
This defines an SoSFNode field for the catalog part given.
Definition SoSubKit.h:155
#define SO_KIT_HEADER(className)
Definition SoSubKit.h:143
This is a dictionary mapping (size_t) integer keys to (void *) data pointers.
Definition SbDict.h:101
Base class for nodekits that move in response to click-drag-release mouse events.
Definition SoDragger.h:225
Sensor class that can be attached to Inventor fields.
Jack-shaped object you rotate, translate, or scale by dragging with the mouse.
virtual ~SoJackDragger()
SoFieldSensor * translFieldSensor
SoFieldSensor * rotFieldSensor
static void initClass()
initialize the class
SoSFRotation rotation
static void fieldSensorCB(void *, SoSensor *)
SoSFVec3f translation
virtual bool setUpConnections(bool onOff, bool doItAlways=FALSE)
detach/attach any sensors, callbacks, and/or field connections.
virtual void setDefaultOnNonWritingFields()
Called by the SoBaseKit::write() method.
static void invalidateSurroundScaleCB(void *, SoDragger *)
SoFieldSensor * scaleFieldSensor
SoJackDragger()
Constructor.
SoSFVec3f scaleFactor
static void valueChangedCB(void *, SoDragger *)
Field containing a rotation.
Field containing a three-dimensional vector.
Definition SoSFVec3f.h:79
Abstract base class for Inventor sensors.
Definition SoSensor.h:108