Open Inventor Reference
SoTranslate1Dragger.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 one dimensional translate dragger class.
48  | This is a simple dragger that allows an object to
49  | be translated in one dimension, along a given direction
50  |
51  | The mouse position is projected onto a line determined
52  | by the translation direction and the point that the mouse
53  | first hit. The amount moved along that line determines the
54  | amount of translation.
55  |
56  | NOTE TO DEVELOPERS:
57  | For info about the structure of SoTranslate1Dragger:
58  | [1] compile: /usr/share/src/Inventor/samples/ivNodeKitStructure
59  | [2] type: ivNodeKitStructure SoTranslate1Dragger.
60  | [3] The program prints a diagram of the scene graph and a table with
61  | information about each part.
62  |
63  | The following parts in this dragger are created at construction time.
64  | 'ResourceName' corresponds to the name of the default geometry for the
65  | part. The dragger's constructor gets the scene graph for 'ResourceName'
66  | by querying the global dictionary ( SoDB::getByName("ResourceName"); ).
67  |
68  | Resource Name: Part Name:
69  |
70  | translate1Translator - translator
71  | translate1TranslatorActive - translatorActive
72  | translate1Feedback - feedback
73  | translate1FeedbackActive - feedbackActive
74  |
75  | Author(s): Paul Isaacs, Howard Look
76  |
77  ______________ S I L I C O N G R A P H I C S I N C . ____________
78  _______________________________________________________________________
79  */
80 
81 #ifndef _SO_TRANSLATE_1_DRAGGER_
82 #define _SO_TRANSLATE_1_DRAGGER_
83 
84 #include <Inventor/SbLinear.h>
88 
89 class SbDict;
90 class SbLineProjector;
91 class SoFieldSensor;
92 
95 
151 
153 {
155 
156  SO_KIT_CATALOG_ENTRY_HEADER(translatorSwitch);
157  SO_KIT_CATALOG_ENTRY_HEADER(translator);
158  SO_KIT_CATALOG_ENTRY_HEADER(translatorActive);
159  SO_KIT_CATALOG_ENTRY_HEADER(feedbackSwitch);
160  SO_KIT_CATALOG_ENTRY_HEADER(feedback);
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();
187  void dragFinish();
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_TRANSLATE_1_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
Line 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.
Definition: SoFieldSensor.h:80
Field containing a three-dimensional vector.
Definition: SoSFVec3f.h:79
Abstract base class for Inventor sensors.
Definition: SoSensor.h:108
Object you can translate along a line by dragging With the mouse.
static void finishCB(void *, SoDragger *)
static void startCB(void *, SoDragger *)
SoTranslate1Dragger()
Constructor.
static void fieldSensorCB(void *, SoSensor *)
static void initClass()
initialize the class
virtual ~SoTranslate1Dragger()
static void motionCB(void *, SoDragger *)
virtual bool setUpConnections(bool onOff, bool doItAlways=FALSE)
detach/attach any sensors, callbacks, and/or field connections.
SoFieldSensor * fieldSensor
SbLineProjector * lineProj
projector for linear scaling
static void valueChangedCB(void *, SoDragger *)