Open Inventor Reference
SoScale2Dragger.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 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 amount moved in the plane determines the amount of scale.
56 |
57 | NOTE TO DEVELOPERS:
58 | For info about the structure of SoScale2Dragger:
59 | [1] compile: /usr/share/src/Inventor/samples/ivNodeKitStructure
60 | [2] type: ivNodeKitStructure SoScale2Dragger.
61 | [3] The program prints a diagram of the scene graph and a table with
62 | information about each part.
63 |
64 | The following parts in this dragger are created at construction time.
65 | 'ResourceName' corresponds to the name of the default geometry for the
66 | part. The dragger's constructor gets the scene graph for 'ResourceName'
67 | by querying the global dictionary ( SoDB::getByName("ResourceName"); ).
68 |
69 | Resource Name: Part Name:
70 |
71 | scale2Scaler - scaler
72 | scale2ScalerActive - scalerActive
73 | scale2Feedback - feedback
74 | scale2FeedbackActive - feedbackActive
75 |
76 | Author(s): Paul Isaacs, Howard Look
77 |
78 ______________ S I L I C O N G R A P H I C S I N C . ____________
79 _______________________________________________________________________
80 */
81
82#ifndef _SO_SCALE_2_DRAGGER_
83#define _SO_SCALE_2_DRAGGER_
84
85#include <Inventor/SbLinear.h>
89
90class SbDict;
92class SoFieldSensor;
93
96
151
153{
155
156 SO_KIT_CATALOG_ENTRY_HEADER(scalerSwitch);
158 SO_KIT_CATALOG_ENTRY_HEADER(scalerActive);
159 SO_KIT_CATALOG_ENTRY_HEADER(feedbackSwitch);
161 SO_KIT_CATALOG_ENTRY_HEADER(feedbackActive);
162
163 public:
164
167
169
170 SoINTERNAL public:
171 static void initClass();
172
173 protected:
174
176
177 static void startCB( void *, SoDragger * );
178 static void motionCB( void *, SoDragger * );
179 static void finishCB( void *, SoDragger * );
180
182 static void fieldSensorCB( void *, SoSensor * );
183 static void valueChangedCB( void *, SoDragger * );
184
185 void dragStart();
186 void drag();
188
195 virtual bool setUpConnections( bool onOff, bool doItAlways = FALSE );
196
198
199 private:
200 static const unsigned char geomBuffer[];
201};
202
203#endif /* _SO_SCALE_2_DRAGGER_ */
204
205
206
#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
Plane projector.
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.
Field containing a three-dimensional vector.
Definition SoSFVec3f.h:79
Object you can scale in two dimensions by dragging with the mouse.
virtual ~SoScale2Dragger()
static void finishCB(void *, SoDragger *)
static void initClass()
initialize the class
SbPlaneProjector * planeProj
projector for planar scaling
SoFieldSensor * fieldSensor
static void startCB(void *, SoDragger *)
SoScale2Dragger()
Constructor.
static void valueChangedCB(void *, SoDragger *)
static void motionCB(void *, SoDragger *)
static void fieldSensorCB(void *, SoSensor *)
virtual bool setUpConnections(bool onOff, bool doItAlways=FALSE)
detach/attach any sensors, callbacks, and/or field connections.
Abstract base class for Inventor sensors.
Definition SoSensor.h:108