Open Inventor Reference
SoTransformBoxDragger.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 transform box dragger class.
48  | This dragger allows you to perform rotations,uniform scales
49  | and translations, all in one tidy box.
50  |
51  | NOTE TO DEVELOPERS:
52  | For info about the structure of SoTransformBoxDragger:
53  | [1] compile: /usr/share/src/Inventor/samples/ivNodeKitStructure
54  | [2] type: ivNodeKitStructure SoTransformBoxDragger.
55  | [3] The program prints a diagram of the scene graph and a table with
56  | information about each part.
57  |
58  | The following parts in this dragger are created at construction time.
59  | 'ResourceName' corresponds to the name of the default geometry for the
60  | part. The dragger's constructor gets the scene graph for 'ResourceName'
61  | by querying the global dictionary ( SoDB::getByName("ResourceName"); ).
62  |
63  | Resource Name: Part Name:
64  |
65  | transformBoxScalerScaler - scaler.scaler
66  | transformBoxScalerScalerActive - scaler.scalerActive
67  | transformBoxScalerFeedback - scaler.feedback
68  | transformBoxScalerFeedbackActive - scaler.feedbackActive
69  |
70  | transformBoxRotatorRotator - rotator1.rotator
71  | transformBoxRotatorRotatorActive - rotator1.rotatorActive
72  | transformBoxRotatorFeedback - rotator1.feedback
73  | transformBoxRotatorFeedbackActive - rotator1.feedbackActive
74  | (ditto for rotator2 and rotator3)
75  |
76  | transformBoxTranslatorTranslator - translator1.translator
77  | transformBoxTranslatorTranslatorActive - translator1.translatorActive
78  | transformBoxTranslatorXAxisFeedback - translator1.xAxisFeedback
79  | transformBoxTranslatorYAxisFeedback - translator1.yAxisFeedback
80  | (ditto for translator2 - translator6)
81  |
82  | Author(s): Paul Isaacs, Howard Look
83  |
84  ______________ S I L I C O N G R A P H I C S I N C . ____________
85  _______________________________________________________________________
86  */
87 
88 #ifndef _SO_TRANSFORM_BOX_DRAGGER_
89 #define _SO_TRANSFORM_BOX_DRAGGER_
90 
91 #include <Inventor/SbLinear.h>
96 
97 class SbDict;
98 class SoFieldSensor;
99 
102 
173 
175 {
177 
179  SO_KIT_CATALOG_ENTRY_HEADER(surroundScale);
181  SO_KIT_CATALOG_ENTRY_HEADER(antiSquish);
182 
184  SO_KIT_CATALOG_ENTRY_HEADER(rotator1Sep);
185  SO_KIT_CATALOG_ENTRY_HEADER(rotator1Rot);
186  SO_KIT_CATALOG_ENTRY_HEADER(rotator1);
187  SO_KIT_CATALOG_ENTRY_HEADER(rotator2Sep);
188  SO_KIT_CATALOG_ENTRY_HEADER(rotator2Rot);
189  SO_KIT_CATALOG_ENTRY_HEADER(rotator2);
190  SO_KIT_CATALOG_ENTRY_HEADER(rotator3Sep);
191  SO_KIT_CATALOG_ENTRY_HEADER(rotator3Rot);
192  SO_KIT_CATALOG_ENTRY_HEADER(rotator3);
193  SO_KIT_CATALOG_ENTRY_HEADER(translator1Sep);
194  SO_KIT_CATALOG_ENTRY_HEADER(translator1Rot);
195  SO_KIT_CATALOG_ENTRY_HEADER(translator1);
196  SO_KIT_CATALOG_ENTRY_HEADER(translator2Sep);
197  SO_KIT_CATALOG_ENTRY_HEADER(translator2Rot);
198  SO_KIT_CATALOG_ENTRY_HEADER(translator2);
199  SO_KIT_CATALOG_ENTRY_HEADER(translator3Sep);
200  SO_KIT_CATALOG_ENTRY_HEADER(translator3Rot);
201  SO_KIT_CATALOG_ENTRY_HEADER(translator3);
202  SO_KIT_CATALOG_ENTRY_HEADER(translator4Sep);
203  SO_KIT_CATALOG_ENTRY_HEADER(translator4Rot);
204  SO_KIT_CATALOG_ENTRY_HEADER(translator4);
205  SO_KIT_CATALOG_ENTRY_HEADER(translator5Sep);
206  SO_KIT_CATALOG_ENTRY_HEADER(translator5Rot);
207  SO_KIT_CATALOG_ENTRY_HEADER(translator5);
208  SO_KIT_CATALOG_ENTRY_HEADER(translator6Sep);
209  SO_KIT_CATALOG_ENTRY_HEADER(translator6Rot);
210  SO_KIT_CATALOG_ENTRY_HEADER(translator6);
211 
212  public:
213 
216 
220 
221  SoINTERNAL public:
222  static void initClass();
223 
224  protected:
225 
229  static void fieldSensorCB( void *, SoSensor * );
230  static void valueChangedCB( void *, SoDragger * );
231 
232  static void invalidateSurroundScaleCB( void *, SoDragger * );
233 
242  virtual bool setUpConnections( bool onOff, bool doItAlways = FALSE );
243 
245 
247 
248  private:
249  static const unsigned char geomBuffer[];
250 };
251 
252 #endif /* _SO_TRANSFORM_BOX_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:81
#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.
Definition: SoFieldSensor.h:80
Field containing a rotation.
Definition: SoSFRotation.h:84
Field containing a three-dimensional vector.
Definition: SoSFVec3f.h:79
Abstract base class for Inventor sensors.
Definition: SoSensor.h:108
Box-like object you scale, rotate, and translate by dragging with the mouse.
virtual void setDefaultOnNonWritingFields()
Called by the SoBaseKit::write() method.
SoFieldSensor * scaleFieldSensor
virtual bool setUpConnections(bool onOff, bool doItAlways=FALSE)
detach/attach callbacks to child draggers.
SoTransformBoxDragger()
Constructor.
static void initClass()
initialize the class
SoFieldSensor * translFieldSensor
static void fieldSensorCB(void *, SoSensor *)
static void valueChangedCB(void *, SoDragger *)
virtual ~SoTransformBoxDragger()
static void invalidateSurroundScaleCB(void *, SoDragger *)