Open Inventor Reference
SoScale2UniformDragger.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 two dimensional uniform scale dragger class.
48  | This is a simple dragger that allows an object to
49  | be scaled about a given center in a plane (defined by the
50  | center and a rotation. The rotation is a rotation which is to
51  | be applied to the default plane to define a new plane).
52  | The default plane has a normal of (0,0,1), and primary directions
53  | of (1,0,0) and (0,1,0)
54  |
55  | The scaling occurs within the plane, but is a uniform scale in
56  | both directions within that plane.
57  |
58  | NOTE TO DEVELOPERS:
59  | For info about the structure of SoScale2UniformDragger:
60  | [1] compile: /usr/share/src/Inventor/samples/ivNodeKitStructure
61  | [2] type: ivNodeKitStructure SoScale2UniformDragger.
62  | [3] The program prints a diagram of the scene graph and a table with
63  | information about each part.
64  |
65  | The following parts in this dragger are created at construction time.
66  | 'ResourceName' corresponds to the name of the default geometry for the
67  | part. The dragger's constructor gets the scene graph for 'ResourceName'
68  | by querying the global dictionary ( SoDB::getByName("ResourceName"); ).
69  |
70  | Resource Name: Part Name:
71  |
72  | scale2UniformScaler - scaler
73  | scale2UniformScalerActive - scalerActive
74  | scale2UniformFeedback - feedback
75  | scale2UniformFeedbackActive - feedbackActive
76  |
77  | Author(s): Paul Isaacs, Howard Look
78  |
79  ______________ S I L I C O N G R A P H I C S I N C . ____________
80  _______________________________________________________________________
81  */
82 
83 #ifndef _SO_SCALE_2_UNIFORM_DRAGGER_
84 #define _SO_SCALE_2_UNIFORM_DRAGGER_
85 
86 #include <Inventor/SbLinear.h>
90 
91 class SbDict;
92 class SbLineProjector;
93 class SoFieldSensor;
94 
97 
148 
150 {
152 
153  SO_KIT_CATALOG_ENTRY_HEADER(scalerSwitch);
155  SO_KIT_CATALOG_ENTRY_HEADER(scalerActive);
156  SO_KIT_CATALOG_ENTRY_HEADER(feedbackSwitch);
157  SO_KIT_CATALOG_ENTRY_HEADER(feedback);
158  SO_KIT_CATALOG_ENTRY_HEADER(feedbackActive);
159 
160  public:
161 
164 
166 
167  SoINTERNAL public:
168  static void initClass();
169 
170  protected:
171 
174 
175  static void startCB( void *, SoDragger * );
176  static void motionCB( void *, SoDragger * );
177  static void finishCB( void *, SoDragger * );
178 
180  static void fieldSensorCB( void *, SoSensor * );
181  static void valueChangedCB( void *, SoDragger * );
182 
183  void dragStart();
184  void drag();
185  void dragFinish();
186 
193  virtual bool setUpConnections( bool onOff, bool doItAlways = FALSE );
194 
196 
197  private:
198  static const unsigned char geomBuffer[];
199 };
200 
201 #endif /* _SO_SCALE_2_UNIFORM_DRAGGER_ */
202 
203 
204 
#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
Line projector.
3D vector class.
Definition: SbLinear.h:120
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 three-dimensional vector.
Definition: SoSFVec3f.h:79
Object you can scale uniformly in two dimensions by dragging with the mouse.
static void initClass()
initialize the class
static void fieldSensorCB(void *, SoSensor *)
static void startCB(void *, SoDragger *)
SbVec3f closestPtOfZeroScale
used during interaction
SbLineProjector * lineProj
projector for scaling
static void finishCB(void *, SoDragger *)
virtual bool setUpConnections(bool onOff, bool doItAlways=FALSE)
detach/attach any sensors, callbacks, and/or field connections.
static void motionCB(void *, SoDragger *)
SoScale2UniformDragger()
Constructor.
static void valueChangedCB(void *, SoDragger *)
virtual ~SoScale2UniformDragger()
Abstract base class for Inventor sensors.
Definition: SoSensor.h:108