Debian Codegraph @

lib/interaction/src/draggers/SoTrackballDragger.c++

raw symbols SCIP
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 * Copyright (C) 1990,91 Silicon Graphics, Inc.
39 *
40 _______________________________________________________________________
41 ______________ S I L I C O N G R A P H I C S I N C . ____________
42 |
43 | $Revision: 1.1.1.1 $
44 |
45 | Classes:
46 | SoTrackballDragger
47 |
48 | Author(s): Paul Isaacs, David Mott
49 |
50 ______________ S I L I C O N G R A P H I C S I N C . ____________
51 _______________________________________________________________________
52 */
53
54
55 #include <cstdio>
56
57 #include <Inventor/errors/SoDebugError.h>cxx . . $ `<file>/lib/database/include/Inventor/errors/SoDebugError.h`/
58 #include <Inventor/events/SoEvent.h>cxx . . $ `<file>/lib/database/include/Inventor/events/SoEvent.h`/
59 #include <Inventor/events/SoKeyboardEvent.h>cxx . . $ `<file>/lib/database/include/Inventor/events/SoKeyboardEvent.h`/
60 #include <Inventor/SoDB.h>cxx . . $ `<file>/lib/database/include/Inventor/SoDB.h`/
61 #include <Inventor/sensors/SoTimerSensor.h>cxx . . $ `<file>/lib/database/include/Inventor/sensors/SoTimerSensor.h`/
62 #include <Inventor/sensors/SoFieldSensor.h>cxx . . $ `<file>/lib/database/include/Inventor/sensors/SoFieldSensor.h`/
63 #include <Inventor/actions/SoHandleEventAction.h>cxx . . $ `<file>/lib/database/include/Inventor/actions/SoHandleEventAction.h`/
64 #include <Inventor/draggers/SoTrackballDragger.h>cxx . . $ `<file>/lib/interaction/include/Inventor/draggers/SoTrackballDragger.h`/
65 #include <Inventor/nodes/SoRotation.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoRotation.h`/
66 #include <Inventor/nodes/SoSwitch.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoSwitch.h`/
67 #include <Inventor/nodes/SoSeparator.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoSeparator.h`/
68 #include <Inventor/nodes/SoSurroundScale.h>cxx . . $ `<file>/lib/interaction/include/Inventor/nodes/SoSurroundScale.h`/
69 #include <Inventor/nodes/SoAntiSquish.h>cxx . . $ `<file>/lib/interaction/include/Inventor/nodes/SoAntiSquish.h`/
70 #include <Inventor/projectors/SbCylinderPlaneProjector.h>cxx . . $ `<file>/lib/database/include/Inventor/projectors/SbCylinderPlaneProjector.h`/
71 #include <Inventor/projectors/SbSphereSectionProjector.h>cxx . . $ `<file>/lib/database/include/Inventor/projectors/SbSphereSectionProjector.h`/
72 #include <Inventor/projectors/SbLineProjector.h>cxx . . $ `<file>/lib/database/include/Inventor/projectors/SbLineProjector.h`/
73
74 #include "geom/SoTrackballDraggerGeom.h"cxx . . $ `<file>/lib/interaction/src/draggers/geom/SoTrackballDraggerGeom.h`/
75
76
77 // Defines
78
79 #define FAST_ANIM_RATEcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:79:9`! (1/60.0) // animation frame rate
80 #define ANIM_ADJUSTMENTcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:80:9`! 0.05 // used to schedule timerSensor to take
81 // a little more or a little less time.
82
83 // size of the rotation buffer, which is used to animate the spinning ball.
84 #define ROT_BUFFER_SIZEcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:84:9`! 5
85
86 SO_KIT_SOURCEcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:194:9`!(SoTrackballDragger);
87
88 ////////////////////////////////////////////////////////////////////////
89 //
90 // Description:
91 // Constructor
92 //
93 SoTrackballDraggercxx . . $ SoTrackballDragger#::SoTrackballDraggercxx . . $ SoTrackballDragger#SoTrackballDragger(49f6e7a06ebc5aa8).()
94 //
95 ////////////////////////////////////////////////////////////////////////
96 {
97 SO_KIT_CONSTRUCTORcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:254:9`!(SoTrackballDragger);
98
99 isBuiltIncxx . . $ SoFieldContainer#isBuiltIn. = TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!;
100
101 // Don't create this by default. It's only really put into use
102 // if this dragger is put inside a manipulator.
103 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(surroundScale, SoSurroundScale,
104 TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!, topSeparator, geomSeparator,TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
105 // Create an anti-squish node by default.
106 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(antiSquish, SoAntiSquish,
107 FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!, topSeparator, geomSeparator,TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
108
109 // Put this stuff under the geomSeparator so it will draw more
110 // efficiently.
111 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(rotatorSwitch, SoSwitch, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
112 geomSeparator, ,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!);
113 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(rotator, SoSeparator, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
114 rotatorSwitch, ,TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
115 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(rotatorActive, SoSeparator, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
116 rotatorSwitch, ,TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
117
118 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(XRotatorSwitch, SoSwitch, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
119 geomSeparator, ,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!);
120 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(XRotator, SoSeparator, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
121 XRotatorSwitch, ,TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
122 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(XRotatorActive, SoSeparator, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
123 XRotatorSwitch, ,TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
124
125 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(YRotatorSwitch, SoSwitch, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
126 geomSeparator, ,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!);
127 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(YRotator, SoSeparator, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
128 YRotatorSwitch, ,TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
129 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(YRotatorActive, SoSeparator, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
130 YRotatorSwitch, ,TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
131
132 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(ZRotatorSwitch, SoSwitch, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
133 geomSeparator, ,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!);
134 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(ZRotator, SoSeparator, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
135 ZRotatorSwitch, ,TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
136 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(ZRotatorActive, SoSeparator, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
137 ZRotatorSwitch, ,TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
138
139 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(userAxisRotation, SoRotation, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
140 geomSeparator, ,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!);
141
142 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(userAxisSwitch, SoSwitch, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
143 geomSeparator, ,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!);
144 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(userAxis, SoSeparator, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
145 userAxisSwitch, ,TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
146 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(userAxisActive, SoSeparator, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
147 userAxisSwitch, ,TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
148
149 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(userRotatorSwitch, SoSwitch, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
150 geomSeparator, ,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!);
151 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(userRotator, SoSeparator, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
152 userRotatorSwitch, ,TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
153 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!(userRotatorActive, SoSeparator, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
154 userRotatorSwitch, ,TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
155
156 // read geometry for shared parts
157 if (SO_KIT_IS_FIRST_INSTANCEcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:258:9`!())
158 readDefaultPartscxx . . $ SoInteractionKit#readDefaultParts(5e891a9f77bb0eff).("trackballDragger.iv", geomBuffercxx . . $ SoTrackballDragger#geomBuffer., sizeof(geomBuffercxx . . $ SoTrackballDragger#geomBuffer.) );
159
160 SO_KIT_ADD_FIELDcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:261:9`!(rotation, (0.0, 0.0, 0.0, 1.0));
161 SO_KIT_ADD_FIELDcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:261:9`!(scaleFactor, (1.0, 1.0, 1.0));
162
163 SO_KIT_INIT_INSTANCEcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:546:9`!();
164
165 // Make the anti-squish node surround the biggest dimension
166 SoAntiSquishcxx . . $ SoAntiSquish# *as = SO_GET_ANY_PARTcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoBaseKit.h:424:9`!( this,"antiSquish", SoAntiSquish );
167 as->sizingcxx . . $ SoAntiSquish#sizing. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). SoAntiSquishcxx . . $ SoAntiSquish#::LONGEST_DIAGONALcxx . . $ SoAntiSquish#LONGEST_DIAGONAL.;
168
169 // create the parts...
170 setPartAsDefaultcxx . . $ SoInteractionKit#setPartAsDefault(91c97549ed5f0a6b).("rotator"cxx . . $ SbName#SbName(85c52e162fed56f9)., "trackballRotator"cxx . . $ SbName#SbName(85c52e162fed56f9).);
171 setPartAsDefaultcxx . . $ SoInteractionKit#setPartAsDefault(91c97549ed5f0a6b).("rotatorActive"cxx . . $ SbName#SbName(85c52e162fed56f9)., "trackballRotatorActive"cxx . . $ SbName#SbName(85c52e162fed56f9).);
172 setPartAsDefaultcxx . . $ SoInteractionKit#setPartAsDefault(91c97549ed5f0a6b).("XRotator"cxx . . $ SbName#SbName(85c52e162fed56f9)., "trackballXRotator"cxx . . $ SbName#SbName(85c52e162fed56f9).);
173 setPartAsDefaultcxx . . $ SoInteractionKit#setPartAsDefault(91c97549ed5f0a6b).("XRotatorActive"cxx . . $ SbName#SbName(85c52e162fed56f9)., "trackballXRotatorActive"cxx . . $ SbName#SbName(85c52e162fed56f9).);
174 setPartAsDefaultcxx . . $ SoInteractionKit#setPartAsDefault(91c97549ed5f0a6b).("YRotator"cxx . . $ SbName#SbName(85c52e162fed56f9)., "trackballYRotator"cxx . . $ SbName#SbName(85c52e162fed56f9).);
175 setPartAsDefaultcxx . . $ SoInteractionKit#setPartAsDefault(91c97549ed5f0a6b).("YRotatorActive"cxx . . $ SbName#SbName(85c52e162fed56f9)., "trackballYRotatorActive"cxx . . $ SbName#SbName(85c52e162fed56f9).);
176 setPartAsDefaultcxx . . $ SoInteractionKit#setPartAsDefault(91c97549ed5f0a6b).("ZRotator"cxx . . $ SbName#SbName(85c52e162fed56f9)., "trackballZRotator"cxx . . $ SbName#SbName(85c52e162fed56f9).);
177 setPartAsDefaultcxx . . $ SoInteractionKit#setPartAsDefault(91c97549ed5f0a6b).("ZRotatorActive"cxx . . $ SbName#SbName(85c52e162fed56f9)., "trackballZRotatorActive"cxx . . $ SbName#SbName(85c52e162fed56f9).);
178 setPartAsDefaultcxx . . $ SoInteractionKit#setPartAsDefault(91c97549ed5f0a6b).("userAxis"cxx . . $ SbName#SbName(85c52e162fed56f9)., "trackballUserAxis"cxx . . $ SbName#SbName(85c52e162fed56f9).);
179 setPartAsDefaultcxx . . $ SoInteractionKit#setPartAsDefault(91c97549ed5f0a6b).("userAxisActive"cxx . . $ SbName#SbName(85c52e162fed56f9)., "trackballUserAxisActive"cxx . . $ SbName#SbName(85c52e162fed56f9).);
180 setPartAsDefaultcxx . . $ SoInteractionKit#setPartAsDefault(91c97549ed5f0a6b).("userRotator"cxx . . $ SbName#SbName(85c52e162fed56f9)., "trackballUserRotator"cxx . . $ SbName#SbName(85c52e162fed56f9).);
181 setPartAsDefaultcxx . . $ SoInteractionKit#setPartAsDefault(91c97549ed5f0a6b).("userRotatorActive"cxx . . $ SbName#SbName(85c52e162fed56f9).,"trackballUserRotatorActive"cxx . . $ SbName#SbName(85c52e162fed56f9).);
182
183 // Set the switches of the ball and stripes to 0...
184 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( rotatorSwitchcxx . . $ SoTrackballDragger#rotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), 0 );
185 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( XRotatorSwitchcxx . . $ SoTrackballDragger#XRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), 0 );
186 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( YRotatorSwitchcxx . . $ SoTrackballDragger#YRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), 0 );
187 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( ZRotatorSwitchcxx . . $ SoTrackballDragger#ZRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), 0 );
188
189 //Turn off userAxis Completely (SO_SWITCH_NONE)
190 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( userAxisSwitchcxx . . $ SoTrackballDragger#userAxisSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), SO_SWITCH_NONEcxx . . $ `lib/database/include/Inventor/nodes/SoSwitch.h:75:9`! );
191 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( userRotatorSwitchcxx . . $ SoTrackballDragger#userRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), SO_SWITCH_NONEcxx . . $ `lib/database/include/Inventor/nodes/SoSwitch.h:75:9`! );
192
193 // Set the rotation of the userStuffRotation to an initial value.
194 SoRotationcxx . . $ SoRotation# *rN = SO_GET_ANY_PARTcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoBaseKit.h:424:9`!(this,"userAxisRotation", SoRotation);
195 rN->rotationcxx . . $ SoRotation#rotation..setValuecxx . . $ SoSFRotation#setValue(8b1048b3fc01a89c).( SbRotationcxx . . $ SbRotation#SbRotation(91fd4afec15735a5).( SbVec3fcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(0,1,0), 0.0 ) );
196
197 currentStatecxx . . $ SoTrackballDragger#currentState. = INACTIVEcxx . . $ SoTrackballDragger#INACTIVE.;
198
199 setHighlightscxx . . $ SoTrackballDragger#setHighlights(49f6e7a06ebc5aa8).();
200
201 // init the user axis to align with 'y'
202 userAxisVeccxx . . $ SoTrackballDragger#userAxisVec..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 0, 1, 0);
203
204 // queues used for animation
205 rotBuffercxx . . $ SoTrackballDragger#rotBuffer. = new SbRotationcxx . . $ SbRotation#SbRotation(49f6e7a06ebc5aa8).[ROT_BUFFER_SIZEcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:84:9`!];
206 timeBuffercxx . . $ SoTrackballDragger#timeBuffer. = new SbTimecxx . . $ SbTime#[ROT_BUFFER_SIZEcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:84:9`!];
207
208 // allocate animation sensor
209 spinSensorcxx . . $ SoTrackballDragger#spinSensor. = new SoTimerSensorcxx . . $ SoTimerSensor#SoTimerSensor(2e94453e53abe5a2).(&SoTrackballDraggercxx . . $ SoTrackballDragger#::spinSensorCBcxx . . $ SoTrackballDragger#spinSensorCB(c8d298b3e215c027)., this);
210
211 animationEnabledcxx . . $ SoTrackballDragger#animationEnabled. = TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!;
212 wasSpinningAtDragStartcxx . . $ SoTrackballDragger#wasSpinningAtDragStart. = FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!;
213
214 sphereProjcxx . . $ SoTrackballDragger#sphereProj. = new SbSphereSectionProjectorcxx . . $ SbSphereSectionProjector#( 0.85 );
215 stripeProjcxx . . $ SoTrackballDragger#stripeProj. = new SbCylinderPlaneProjectorcxx . . $ SbCylinderPlaneProjector#( 0.85 );
216
217 // add the callbacks to perform the dragging
218 addStartCallbackcxx . . $ SoDragger#addStartCallback(5d3f11b67c4aec04).( &SoTrackballDraggercxx . . $ SoTrackballDragger#::startCBcxx . . $ SoTrackballDragger#startCB(7027446dc0b7318f). );
219 addMotionCallbackcxx . . $ SoDragger#addMotionCallback(5d3f11b67c4aec04).( &SoTrackballDraggercxx . . $ SoTrackballDragger#::motionCBcxx . . $ SoTrackballDragger#motionCB(7027446dc0b7318f). );
220 addFinishCallbackcxx . . $ SoDragger#addFinishCallback(5d3f11b67c4aec04).( &SoTrackballDraggercxx . . $ SoTrackballDragger#::finishCBcxx . . $ SoTrackballDragger#finishCB(7027446dc0b7318f). );
221
222 // add the callback to update things each time a meta key changes.
223 addOtherEventCallbackcxx . . $ SoDragger#addOtherEventCallback(5d3f11b67c4aec04).( &SoTrackballDraggercxx . . $ SoTrackballDragger#::metaKeyChangeCBcxx . . $ SoTrackballDragger#metaKeyChangeCB(7027446dc0b7318f). );
224
225 // Update the rotation and scale fields when the motionMatrix is set.
226 addValueChangedCallbackcxx . . $ SoDragger#addValueChangedCallback(5d3f11b67c4aec04).( &SoTrackballDraggercxx . . $ SoTrackballDragger#::valueChangedCBcxx . . $ SoTrackballDragger#valueChangedCB(7027446dc0b7318f). );
227
228 // Updates the motionMatrix when the scaleFactor field is set.
229 rotFieldSensorcxx . . $ SoTrackballDragger#rotFieldSensor. = new SoFieldSensorcxx . . $ SoFieldSensor#(&SoTrackballDraggercxx . . $ SoTrackballDragger#::fieldSensorCBcxx . . $ SoTrackballDragger#fieldSensorCB(c8d298b3e215c027).,this);
230 rotFieldSensorcxx . . $ SoTrackballDragger#rotFieldSensor.->setPrioritycxx . . $ SoDelayQueueSensor#setPriority(cb2f890c2fdad230).( 0 );
231
232 // Updates the motionMatrix when the scaleFactor field is set.
233 scaleFieldSensorcxx . . $ SoTrackballDragger#scaleFieldSensor.
234 = new SoFieldSensorcxx . . $ SoFieldSensor#( &SoTrackballDraggercxx . . $ SoTrackballDragger#::fieldSensorCBcxx . . $ SoTrackballDragger#fieldSensorCB(c8d298b3e215c027)., this);
235 scaleFieldSensorcxx . . $ SoTrackballDragger#scaleFieldSensor.->setPrioritycxx . . $ SoDelayQueueSensor#setPriority(cb2f890c2fdad230).( 0 );
236
237 setUpConnectionscxx . . $ SoTrackballDragger#setUpConnections(9b79fb6aee4c0440).( TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`! );
238 }
239
240 ////////////////////////////////////////////////////////////////////////
241 //
242 // Description:
243 // Destructor.
244 //
245 // Use: public
246
247 SoTrackballDraggercxx . . $ SoTrackballDragger#::~cxx . . $ SoTrackballDragger#`~SoTrackballDragger`(49f6e7a06ebc5aa8).SoTrackballDraggercxx . . $ SoTrackballDragger#()
248 //
249 ////////////////////////////////////////////////////////////////////////
250 {
251 // deallocate queues
252 delete [ /*ROT_BUFFER_SIZE*/ ] rotBuffercxx . . $ SoTrackballDragger#rotBuffer.;
253 delete [ /*ROT_BUFFER_SIZE*/ ] timeBuffercxx . . $ SoTrackballDragger#timeBuffer.;
254
255 delete sphereProjcxx . . $ SoTrackballDragger#sphereProj.;
256 delete stripeProjcxx . . $ SoTrackballDragger#stripeProj.;
257
258 // delete sensors
259 if (spinSensorcxx . . $ SoTrackballDragger#spinSensor. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
260 delete spinSensorcxx . . $ SoTrackballDragger#spinSensor.;
261 if (rotFieldSensorcxx . . $ SoTrackballDragger#rotFieldSensor. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
262 delete rotFieldSensorcxx . . $ SoTrackballDragger#rotFieldSensor.;
263 if (scaleFieldSensorcxx . . $ SoTrackballDragger#scaleFieldSensor. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
264 delete scaleFieldSensorcxx . . $ SoTrackballDragger#scaleFieldSensor.;
265 }
266
267 // detach/attach any sensors, callbacks, and/or field connections.
268 // Called by: start/end of SoBaseKit::readInstance
269 // and on new copy by: start/end of SoBaseKit::copy.
270 // Classes that redefine must call setUpConnections(TRUE,TRUE)
271 // at end of constructor.
272 // Returns the state of the node when this was called.
273 SbBoolcxx . . $ SbBool#
274 SoTrackballDraggercxx . . $ SoTrackballDragger#::setUpConnectionscxx . . $ SoTrackballDragger#setUpConnections(9b79fb6aee4c0440).( SbBoolcxx . . $ SbBool# onOff, SbBoolcxx . . $ SbBool# doItAlways )
275 {
276 if ( !doItAlways && connectionsSetUpcxx . . $ SoBaseKit#connectionsSetUp. == onOff)
277 return onOff;
278
279 if ( onOff ) {
280
281 // We connect AFTER base class.
282 SoDraggercxx . . $ SoDragger#::setUpConnectionscxx . . $ SoInteractionKit#setUpConnections(9b79fb6aee4c0440).( onOff, FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
283
284 // Call the sensor CBs to make things are up-to-date.
285 fieldSensorCBcxx . . $ SoTrackballDragger#fieldSensorCB(c8d298b3e215c027).( this, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! );
286
287 // Figure out the userAxisVec (a protected variable) from the
288 // 'userAxisRotation' part.
289 SoRotationcxx . . $ SoRotation# *rN = (SoRotationcxx . . $ SoRotation# *) userAxisRotationcxx . . $ SoTrackballDragger#userAxisRotation..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).();
290 if (rN != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
291 SbRotationcxx . . $ SbRotation# uRot = rN->rotationcxx . . $ SoRotation#rotation..getValuecxx . . $ SoSFRotation#getValue(cd68af149be99fa7).();
292 uRot.multVeccxx . . $ SbRotation#multVec(f4e74898890c8c54).( SbVec3fcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(0,1,0), userAxisVeccxx . . $ SoTrackballDragger#userAxisVec. );
293
294 // decide whether or not to display the spinning wheel.
295 // only show it if does not line up with a major axis.
296 if ( ( fabs(userAxisVeccxx . . $ SoTrackballDragger#userAxisVec.[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0]) > 0.99 )
297 || ( fabs(userAxisVeccxx . . $ SoTrackballDragger#userAxisVec.[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1]) > 0.99 )
298 || ( fabs(userAxisVeccxx . . $ SoTrackballDragger#userAxisVec.[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).2]) > 0.99 ) ) {
299 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( userAxisSwitchcxx . . $ SoTrackballDragger#userAxisSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), SO_SWITCH_NONEcxx . . $ `lib/database/include/Inventor/nodes/SoSwitch.h:75:9`! );
300 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( userRotatorSwitchcxx . . $ SoTrackballDragger#userRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), SO_SWITCH_NONEcxx . . $ `lib/database/include/Inventor/nodes/SoSwitch.h:75:9`! );
301 }
302 else {
303 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( userAxisSwitchcxx . . $ SoTrackballDragger#userAxisSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), 1 );
304 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( userRotatorSwitchcxx . . $ SoTrackballDragger#userRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), 1 );
305 }
306 }
307
308 // Connect the field sensors
309 if (rotFieldSensorcxx . . $ SoTrackballDragger#rotFieldSensor.->getAttachedFieldcxx . . $ SoFieldSensor#getAttachedField(c4a4d937024b6702).() != &rotationcxx . . $ SoTrackballDragger#rotation.)
310 rotFieldSensorcxx . . $ SoTrackballDragger#rotFieldSensor.->attachcxx . . $ SoFieldSensor#attach(6a35cc9f7090653f).( &rotationcxx . . $ SoTrackballDragger#rotation. );
311 if (scaleFieldSensorcxx . . $ SoTrackballDragger#scaleFieldSensor.->getAttachedFieldcxx . . $ SoFieldSensor#getAttachedField(c4a4d937024b6702).() != &scaleFactorcxx . . $ SoTrackballDragger#scaleFactor.)
312 scaleFieldSensorcxx . . $ SoTrackballDragger#scaleFieldSensor.->attachcxx . . $ SoFieldSensor#attach(6a35cc9f7090653f).( &scaleFactorcxx . . $ SoTrackballDragger#scaleFactor. );
313 }
314 else {
315
316 // We disconnect BEFORE base class.
317
318 // Disconnect the field sensors.
319 if (rotFieldSensorcxx . . $ SoTrackballDragger#rotFieldSensor.->getAttachedFieldcxx . . $ SoFieldSensor#getAttachedField(c4a4d937024b6702).())
320 rotFieldSensorcxx . . $ SoTrackballDragger#rotFieldSensor.->detachcxx . . $ SoFieldSensor#detach(49f6e7a06ebc5aa8).();
321 if (scaleFieldSensorcxx . . $ SoTrackballDragger#scaleFieldSensor.->getAttachedFieldcxx . . $ SoFieldSensor#getAttachedField(c4a4d937024b6702).())
322 scaleFieldSensorcxx . . $ SoTrackballDragger#scaleFieldSensor.->detachcxx . . $ SoFieldSensor#detach(49f6e7a06ebc5aa8).();
323
324 SoDraggercxx . . $ SoDragger#::setUpConnectionscxx . . $ SoInteractionKit#setUpConnections(9b79fb6aee4c0440).( onOff, FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
325 }
326
327 return !(connectionsSetUpcxx . . $ SoBaseKit#connectionsSetUp. = onOff);
328 }
329
330 ////////////////////////////////////////////////////////////////////////
331 //
332 // Description:
333 // Destructor.
334 //
335 // Use: public
336 void
337 SoTrackballDraggercxx . . $ SoTrackballDragger#::setAnimationEnabledcxx . . $ SoTrackballDragger#setAnimationEnabled(d4f767463ce0a6b3).( SbBoolcxx . . $ SbBool# newVal )
338 //
339 ////////////////////////////////////////////////////////////////////////
340 {
341 animationEnabledcxx . . $ SoTrackballDragger#animationEnabled. = newVal;
342 if (animationEnabledcxx . . $ SoTrackballDragger#animationEnabled. == FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! )
343 resetSpinStuffcxx . . $ SoTrackballDragger#resetSpinStuff(49f6e7a06ebc5aa8).();
344 }
345
346 ////////////////////////////////////////////////////////////////////////
347 //
348 // Description:
349 // Sets the various switch nodes to highlight the correct parts
350 // of the trackball, depending on the state.
351 //
352 // Use: private
353 //
354 void
355 SoTrackballDraggercxx . . $ SoTrackballDragger#::setHighlightscxx . . $ SoTrackballDragger#setHighlights(49f6e7a06ebc5aa8).()
356 //
357 ////////////////////////////////////////////////////////////////////////
358 {
359 switch ( currentStatecxx . . $ SoTrackballDragger#currentState. ) {
360 case INACTIVEcxx . . $ SoTrackballDragger#INACTIVE.:
361 case SPINNINGcxx . . $ SoTrackballDragger#SPINNING.:
362 setAllPartsActivecxx . . $ SoTrackballDragger#setAllPartsActive(d4f767463ce0a6b3).( FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
363 break;
364 case FREE_ROTATEcxx . . $ SoTrackballDragger#FREE_ROTATE.:
365 case SCALEcxx . . $ SoTrackballDragger#SCALE.:
366 setAllPartsActivecxx . . $ SoTrackballDragger#setAllPartsActive(d4f767463ce0a6b3).( TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`! );
367 break;
368 case X_ROTATEcxx . . $ SoTrackballDragger#X_ROTATE.:
369 setAllPartsActivecxx . . $ SoTrackballDragger#setAllPartsActive(d4f767463ce0a6b3).( FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
370 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( XRotatorSwitchcxx . . $ SoTrackballDragger#XRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), 1 );
371 break;
372 case Y_ROTATEcxx . . $ SoTrackballDragger#Y_ROTATE.:
373 setAllPartsActivecxx . . $ SoTrackballDragger#setAllPartsActive(d4f767463ce0a6b3).( FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
374 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( YRotatorSwitchcxx . . $ SoTrackballDragger#YRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), 1 );
375 break;
376 case Z_ROTATEcxx . . $ SoTrackballDragger#Z_ROTATE.:
377 setAllPartsActivecxx . . $ SoTrackballDragger#setAllPartsActive(d4f767463ce0a6b3).( FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
378 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( ZRotatorSwitchcxx . . $ SoTrackballDragger#ZRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), 1 );
379 break;
380 case USER_AXIS_ROTATEcxx . . $ SoTrackballDragger#USER_AXIS_ROTATE.:
381 case USER_AXIS_ADJUSTcxx . . $ SoTrackballDragger#USER_AXIS_ADJUST.:
382 {
383 setAllPartsActivecxx . . $ SoTrackballDragger#setAllPartsActive(d4f767463ce0a6b3).( FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
384
385 SoSwitchcxx . . $ SoSwitch# *sw = (SoSwitchcxx . . $ SoSwitch# *) userAxisSwitchcxx . . $ SoTrackballDragger#userAxisSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).();
386 if ( sw && sw->whichChildcxx . . $ SoSwitch#whichChild..getValuecxx . . $ SoSFInt32#getValue(455f465bc33b4cdf).() != SO_SWITCH_NONEcxx . . $ `lib/database/include/Inventor/nodes/SoSwitch.h:75:9`! )
387 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( userAxisSwitchcxx . . $ SoTrackballDragger#userAxisSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), 1 );
388
389 sw = (SoSwitchcxx . . $ SoSwitch# *) userRotatorSwitchcxx . . $ SoTrackballDragger#userRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).();
390 if ( sw && sw->whichChildcxx . . $ SoSwitch#whichChild..getValuecxx . . $ SoSFInt32#getValue(455f465bc33b4cdf).() != SO_SWITCH_NONEcxx . . $ `lib/database/include/Inventor/nodes/SoSwitch.h:75:9`! )
391 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( userRotatorSwitchcxx . . $ SoTrackballDragger#userRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), 1 );
392 }
393 break;
394 }
395 }
396
397 ////////////////////////////////////////////////////////////////////////
398 //
399 // Description:
400 // Rotate the trackball and object based on mouse motion.
401 //
402 // Use: private
403 //
404 void
405 SoTrackballDraggercxx . . $ SoTrackballDragger#::dragStartcxx . . $ SoTrackballDragger#dragStart(49f6e7a06ebc5aa8).()
406 //
407 ////////////////////////////////////////////////////////////////////////
408 {
409 // register time for animation of continuous spinning
410 prevTimecxx . . $ SoTrackballDragger#prevTime. =cxx . . $ SbTime#`operator=`(73027bd0a2429d7a). getEventcxx . . $ SoDragger#getEvent(c30b8bbf6163e0e4).()->getTimecxx . . $ SoEvent#getTime(52a341c094338469).();
411
412 // We want to remember if we were spinning at drag start.
413 // If so, we will always call ha->setHandled() in dragFinish().
414 // This way, it won't be considered an item selection, which is usually
415 // the case when you click on an object without moving the mouse.
416 wasSpinningAtDragStartcxx . . $ SoTrackballDragger#wasSpinningAtDragStart. = (currentStatecxx . . $ SoTrackballDragger#currentState. == SPINNINGcxx . . $ SoTrackballDragger#SPINNING.);
417 resetSpinStuffcxx . . $ SoTrackballDragger#resetSpinStuff(49f6e7a06ebc5aa8).(); // check if spinning should be stopped
418
419 const SoPathcxx . . $ SoPath# *pickPath = getPickPathcxx . . $ SoDragger#getPickPath(d41edb2b63dda406).();
420
421 // Invalidate surroundScale if it exists.
422 SoSurroundScalecxx . . $ SoSurroundScale# *ss = SO_CHECK_PARTcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoBaseKit.h:422:9`!(this, "surroundScale", SoSurroundScale);
423 if (ss != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
424 ss->invalidatecxx . . $ SoSurroundScale#invalidate(49f6e7a06ebc5aa8).();
425
426 // Make a note of which modifier keys are down
427 ctlDowncxx . . $ SoTrackballDragger#ctlDown. = getEventcxx . . $ SoDragger#getEvent(c30b8bbf6163e0e4).()->wasCtrlDowncxx . . $ SoEvent#wasCtrlDown(455f465bc33b4cdf).();
428 shftDowncxx . . $ SoTrackballDragger#shftDown. = getEventcxx . . $ SoDragger#getEvent(c30b8bbf6163e0e4).()->wasShiftDowncxx . . $ SoEvent#wasShiftDown(455f465bc33b4cdf).();
429
430 // Determine the current state
431 if (ctlDowncxx . . $ SoTrackballDragger#ctlDown.)
432 currentStatecxx . . $ SoTrackballDragger#currentState. = SCALEcxx . . $ SoTrackballDragger#SCALE.;
433 else if (shftDowncxx . . $ SoTrackballDragger#shftDown.)
434 currentStatecxx . . $ SoTrackballDragger#currentState. = USER_AXIS_ADJUSTcxx . . $ SoTrackballDragger#USER_AXIS_ADJUST.;
435 else if (pickPath && pickPath->containsNodecxx . . $ SoPath#containsNode(25d228eba4c5059a).( XRotatorSwitchcxx . . $ SoTrackballDragger#XRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).() ) ||
436 getSurrogatePartPickedNamecxx . . $ SoDragger#getSurrogatePartPickedName(96f83ea34e3884f5).() ==cxx . . $ `operator==`(1deca42c6f82b65f). "XRotator" )
437 currentStatecxx . . $ SoTrackballDragger#currentState. = X_ROTATEcxx . . $ SoTrackballDragger#X_ROTATE.;
438 else if (pickPath && pickPath->containsNodecxx . . $ SoPath#containsNode(25d228eba4c5059a).( YRotatorSwitchcxx . . $ SoTrackballDragger#YRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).() ) ||
439 getSurrogatePartPickedNamecxx . . $ SoDragger#getSurrogatePartPickedName(96f83ea34e3884f5).() ==cxx . . $ `operator==`(1deca42c6f82b65f). "YRotator" )
440 currentStatecxx . . $ SoTrackballDragger#currentState. = Y_ROTATEcxx . . $ SoTrackballDragger#Y_ROTATE.;
441 else if (pickPath && pickPath->containsNodecxx . . $ SoPath#containsNode(25d228eba4c5059a).( ZRotatorSwitchcxx . . $ SoTrackballDragger#ZRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).() ) ||
442 getSurrogatePartPickedNamecxx . . $ SoDragger#getSurrogatePartPickedName(96f83ea34e3884f5).() ==cxx . . $ `operator==`(1deca42c6f82b65f). "ZRotator" )
443 currentStatecxx . . $ SoTrackballDragger#currentState. = Z_ROTATEcxx . . $ SoTrackballDragger#Z_ROTATE.;
444 else if (pickPath && pickPath->containsNodecxx . . $ SoPath#containsNode(25d228eba4c5059a).(userRotatorSwitchcxx . . $ SoTrackballDragger#userRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).()) ||
445 getSurrogatePartPickedNamecxx . . $ SoDragger#getSurrogatePartPickedName(96f83ea34e3884f5).() ==cxx . . $ `operator==`(1deca42c6f82b65f). "userRotator" )
446 currentStatecxx . . $ SoTrackballDragger#currentState. = USER_AXIS_ROTATEcxx . . $ SoTrackballDragger#USER_AXIS_ROTATE.;
447 else
448 currentStatecxx . . $ SoTrackballDragger#currentState. = FREE_ROTATEcxx . . $ SoTrackballDragger#FREE_ROTATE.;
449
450 // set the constrained axis, if appropriate
451 switch( currentStatecxx . . $ SoTrackballDragger#currentState. ) {
452 case X_ROTATEcxx . . $ SoTrackballDragger#X_ROTATE.:
453 constrainedAxiscxx . . $ SoTrackballDragger#constrainedAxis..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 1, 0, 0);
454 break;
455 case Y_ROTATEcxx . . $ SoTrackballDragger#Y_ROTATE.:
456 constrainedAxiscxx . . $ SoTrackballDragger#constrainedAxis..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 0, 1, 0);
457 break;
458 case Z_ROTATEcxx . . $ SoTrackballDragger#Z_ROTATE.:
459 constrainedAxiscxx . . $ SoTrackballDragger#constrainedAxis..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 0, 0, 1);
460 break;
461 case USER_AXIS_ROTATEcxx . . $ SoTrackballDragger#USER_AXIS_ROTATE.:
462 constrainedAxiscxx . . $ SoTrackballDragger#constrainedAxis. =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). userAxisVeccxx . . $ SoTrackballDragger#userAxisVec.;
463 break;
464 default:
465 break;
466 }
467
468 // Working space is space after "antiSquish"
469 SbMatrixcxx . . $ SbMatrix# workSpaceToLocalcxx . . $ SbMatrix#SbMatrix(49f6e7a06ebc5aa8)., localToWorkSpacecxx . . $ SbMatrix#SbMatrix(49f6e7a06ebc5aa8).;
470 getPartToLocalMatrixcxx . . $ SoDragger#getPartToLocalMatrix(311231c517bf1a8f).( "antiSquish"cxx . . $ SbName#SbName(85c52e162fed56f9)., workSpaceToLocal, localToWorkSpace);
471 SbMatrixcxx . . $ SbMatrix# worldSpaceToWork = getWorldToLocalMatrixcxx . . $ SoDragger#getWorldToLocalMatrix(2db31fc6bbb60646).();
472 worldSpaceToWork.multRightcxx . . $ SbMatrix#multRight(5bda0b2cfca989a9).( localToWorkSpace );
473 SbMatrixcxx . . $ SbMatrix# workSpaceToWorld = getLocalToWorldMatrixcxx . . $ SoDragger#getLocalToWorldMatrix(2db31fc6bbb60646).();
474 workSpaceToWorld.multLeftcxx . . $ SbMatrix#multLeft(5bda0b2cfca989a9).( workSpaceToLocal );
475
476 // Find the starting point in workspace.
477 SbVec3fcxx . . $ SbVec3f# startWorkSpaceHitPtcxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8).;
478 worldSpaceToWork.multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).(getWorldStartingPointcxx . . $ SoDragger#getWorldStartingPoint(42d43ea8522fe3bf).(),startWorkSpaceHitPt);
479
480
481 float rad;
482 SbVec3fcxx . . $ SbVec3f# zerocxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).( 0,0,0 );
483 SbLinecxx . . $ SbLine# theAxiscxx . . $ SbLine#SbLine(49f6e7a06ebc5aa8).;
484 rad = startWorkSpaceHitPt.lengthcxx . . $ SbVec3f#length(5036dfe8d4170af2).();
485
486
487 // Setup projector and get a starting value
488 switch( currentStatecxx . . $ SoTrackballDragger#currentState. ) {
489 case SCALEcxx . . $ SoTrackballDragger#SCALE.:
490 case USER_AXIS_ADJUSTcxx . . $ SoTrackballDragger#USER_AXIS_ADJUST.:
491 case FREE_ROTATEcxx . . $ SoTrackballDragger#FREE_ROTATE.:
492 {
493 SbVec3fcxx . . $ SbVec3f# sphCentercxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(0,0,0);
494 sphereProjcxx . . $ SoTrackballDragger#sphereProj.->setSpherecxx . . $ SbSphereProjector#setSphere(adb15edee7e1c745).( SbSpherecxx . . $ SbSphere#SbSphere(91fd4afec15735a5).( sphCenter, rad ));
495
496 SbViewVolumecxx . . $ SbViewVolume# viewVol = getViewVolumecxx . . $ SoDragger#getViewVolume(ee52a61c9e3934e6).();
497
498 sphereProjcxx . . $ SoTrackballDragger#sphereProj.->setViewVolumecxx . . $ SbProjector#setViewVolume(187982bfa537c808).(viewVol );
499 sphereProjcxx . . $ SoTrackballDragger#sphereProj.->setWorkingSpacecxx . . $ SbSphereProjector#setWorkingSpace(37d2f951b3ffd7a6).( workSpaceToWorld );
500
501 // If the hit point is on the near side of the center from where
502 // the eye is, then tell the projector to intersect front.
503 // Else, tell it to intersect back.
504 if (getFrontOnProjectorcxx . . $ SoDragger#getFrontOnProjector(f2ba4169cfff313c).() == USE_PICKcxx . . $ SoDragger#USE_PICK. )
505 sphereProjcxx . . $ SoTrackballDragger#sphereProj.->setFrontcxx . . $ SbSphereProjector#setFront(d4f767463ce0a6b3).( sphereProjcxx . . $ SoTrackballDragger#sphereProj.->isPointInFrontcxx . . $ SbSphereProjector#isPointInFront(66e1d16e2771ff3b).( startWorkSpaceHitPt ));
506 else if (getFrontOnProjectorcxx . . $ SoDragger#getFrontOnProjector(f2ba4169cfff313c).() == FRONTcxx . . $ SoDragger#FRONT. )
507 sphereProjcxx . . $ SoTrackballDragger#sphereProj.->setFrontcxx . . $ SbSphereProjector#setFront(d4f767463ce0a6b3).( TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`! );
508 else
509 sphereProjcxx . . $ SoTrackballDragger#sphereProj.->setFrontcxx . . $ SbSphereProjector#setFront(d4f767463ce0a6b3).( FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
510 // We need to project and save the starting world point,
511 // Since our rotate projectors might intersect to find a
512 // different point than we hit on the geometry itself.
513 SbVec3fcxx . . $ SbVec3f# ptOnProjectorcxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8)., worldSpacePtcxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8).;
514 ptOnProjector =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). sphereProjcxx . . $ SoTrackballDragger#sphereProj.->projectcxx . . $ SbSphereProjector#project(52e93d88cc4c3965).(getNormalizedLocaterPositioncxx . . $ SoDragger#getNormalizedLocaterPosition(e67d94fc922bbbd4).());
515 workSpaceToWorld.multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).(ptOnProjector,worldSpacePt);
516 setStartingPointcxx . . $ SoDragger#setStartingPoint(65a601b9d70571d6).(worldSpacePt);
517 }
518 break;
519 case X_ROTATEcxx . . $ SoTrackballDragger#X_ROTATE.:
520 case Y_ROTATEcxx . . $ SoTrackballDragger#Y_ROTATE.:
521 case Z_ROTATEcxx . . $ SoTrackballDragger#Z_ROTATE.:
522 case USER_AXIS_ROTATEcxx . . $ SoTrackballDragger#USER_AXIS_ROTATE.:
523 {
524 theAxis.setValuecxx . . $ SbLine#setValue(d696704770a33d8f).( zero, zero +cxx . . $ operator+(af63bf8d0639b76b). constrainedAxiscxx . . $ SoTrackballDragger#constrainedAxis. );
525 stripeProjcxx . . $ SoTrackballDragger#stripeProj.->setCylindercxx . . $ SbCylinderProjector#setCylinder(c58b45a4694d5726).( SbCylindercxx . . $ SbCylinder#SbCylinder(cdf826ac23993467).(theAxis, rad) );
526 stripeProjcxx . . $ SoTrackballDragger#stripeProj.->setViewVolumecxx . . $ SbProjector#setViewVolume(187982bfa537c808).(getViewVolumecxx . . $ SoDragger#getViewVolume(ee52a61c9e3934e6).());
527 stripeProjcxx . . $ SoTrackballDragger#stripeProj.->setWorkingSpacecxx . . $ SbCylinderProjector#setWorkingSpace(37d2f951b3ffd7a6).( workSpaceToWorld );
528
529 // If the hit point is on the near side of the center from where
530 // the eye is, then tell the projector to intersect front.
531 // Else, tell it to intersect back.
532 if (getFrontOnProjectorcxx . . $ SoDragger#getFrontOnProjector(f2ba4169cfff313c).() == USE_PICKcxx . . $ SoDragger#USE_PICK. )
533 stripeProjcxx . . $ SoTrackballDragger#stripeProj.->setFrontcxx . . $ SbCylinderProjector#setFront(d4f767463ce0a6b3).( stripeProjcxx . . $ SoTrackballDragger#stripeProj.->isPointInFrontcxx . . $ SbCylinderProjector#isPointInFront(66e1d16e2771ff3b).( startWorkSpaceHitPt));
534 else if (getFrontOnProjectorcxx . . $ SoDragger#getFrontOnProjector(f2ba4169cfff313c).() == FRONTcxx . . $ SoDragger#FRONT. )
535 stripeProjcxx . . $ SoTrackballDragger#stripeProj.->setFrontcxx . . $ SbCylinderProjector#setFront(d4f767463ce0a6b3).( TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`! );
536 else
537 stripeProjcxx . . $ SoTrackballDragger#stripeProj.->setFrontcxx . . $ SbCylinderProjector#setFront(d4f767463ce0a6b3).( FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
538
539 // We need to project and save the starting world point,
540 // Since our rotate projectors might intersect to find a
541 // different point than we hit on the geometry itself.
542 SbVec3fcxx . . $ SbVec3f# ptOnProjectorcxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8)., worldSpacePtcxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8).;
543 ptOnProjector =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). stripeProjcxx . . $ SoTrackballDragger#stripeProj.->projectcxx . . $ SbCylinderProjector#project(52e93d88cc4c3965).(getNormalizedLocaterPositioncxx . . $ SoDragger#getNormalizedLocaterPosition(e67d94fc922bbbd4).());
544 workSpaceToWorld.multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).(ptOnProjector,worldSpacePt);
545 setStartingPointcxx . . $ SoDragger#setStartingPoint(65a601b9d70571d6).(worldSpacePt);
546 }
547 break;
548 case INACTIVEcxx . . $ SoTrackballDragger#INACTIVE.:
549 case SPINNINGcxx . . $ SoTrackballDragger#SPINNING.:
550 break;
551 }
552
553 // Save for incremental rotations, needed by spherical projector.
554 prevWorldHitPtcxx . . $ SoTrackballDragger#prevWorldHitPt. =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). getWorldStartingPointcxx . . $ SoDragger#getWorldStartingPoint(42d43ea8522fe3bf).();
555 prevMotionMatrixcxx . . $ SoTrackballDragger#prevMotionMatrix. =cxx . . $ SbMatrix#`operator=`(5bda0b2cfca989a9). getStartMotionMatrixcxx . . $ SoDragger#getStartMotionMatrix(c49c36ee78b0a89e).();
556
557 if ( currentStatecxx . . $ SoTrackballDragger#currentState. == USER_AXIS_ADJUSTcxx . . $ SoTrackballDragger#USER_AXIS_ADJUST. )
558 userStripeDragcxx . . $ SoTrackballDragger#userStripeDrag(b126dc7c1de90089).();
559
560 setHighlightscxx . . $ SoTrackballDragger#setHighlights(49f6e7a06ebc5aa8).();
561 }
562
563
564 ////////////////////////////////////////////////////////////////////////
565 //
566 // Description:
567 // Drag the trackball based on mouse motion.
568 // This routine just ships the work to rotateDrag or
569 // scaleDrag.
570 //
571 // Use: private
572 //
573 void
574 SoTrackballDraggercxx . . $ SoTrackballDragger#::dragcxx . . $ SoTrackballDragger#drag(49f6e7a06ebc5aa8).()
575 //
576 ////////////////////////////////////////////////////////////////////////
577 {
578 switch( currentStatecxx . . $ SoTrackballDragger#currentState. ) {
579 case SCALEcxx . . $ SoTrackballDragger#SCALE.:
580 scaleDragcxx . . $ SoTrackballDragger#scaleDrag(b126dc7c1de90089).();
581 break;
582 case USER_AXIS_ADJUSTcxx . . $ SoTrackballDragger#USER_AXIS_ADJUST.:
583 userStripeDragcxx . . $ SoTrackballDragger#userStripeDrag(b126dc7c1de90089).();
584 break;
585 case FREE_ROTATEcxx . . $ SoTrackballDragger#FREE_ROTATE.:
586 case X_ROTATEcxx . . $ SoTrackballDragger#X_ROTATE.:
587 case Y_ROTATEcxx . . $ SoTrackballDragger#Y_ROTATE.:
588 case Z_ROTATEcxx . . $ SoTrackballDragger#Z_ROTATE.:
589 case USER_AXIS_ROTATEcxx . . $ SoTrackballDragger#USER_AXIS_ROTATE.:
590 rotateDragcxx . . $ SoTrackballDragger#rotateDrag(b126dc7c1de90089).();
591 break;
592 case INACTIVEcxx . . $ SoTrackballDragger#INACTIVE.:
593 case SPINNINGcxx . . $ SoTrackballDragger#SPINNING.:
594 break;
595 }
596 }
597
598 ////////////////////////////////////////////////////////////////////////
599 //
600 // Description:
601 // Rotate the trackball and object based on mouse motion.
602 //
603 // Use: private
604 //
605 SbBoolcxx . . $ SbBool#
606 SoTrackballDraggercxx . . $ SoTrackballDragger#::rotateDragcxx . . $ SoTrackballDragger#rotateDrag(b126dc7c1de90089).()
607 //
608 ////////////////////////////////////////////////////////////////////////
609 {
610 SbMatrixcxx . . $ SbMatrix# workSpaceToLocalcxx . . $ SbMatrix#SbMatrix(49f6e7a06ebc5aa8)., localToWorkSpacecxx . . $ SbMatrix#SbMatrix(49f6e7a06ebc5aa8).;
611 getPartToLocalMatrixcxx . . $ SoDragger#getPartToLocalMatrix(311231c517bf1a8f).( "antiSquish"cxx . . $ SbName#SbName(85c52e162fed56f9)., workSpaceToLocal, localToWorkSpace);
612 SbMatrixcxx . . $ SbMatrix# workSpaceToWorld = getLocalToWorldMatrixcxx . . $ SoDragger#getLocalToWorldMatrix(2db31fc6bbb60646).();
613 workSpaceToWorld.multLeftcxx . . $ SbMatrix#multLeft(5bda0b2cfca989a9).( workSpaceToLocal );
614 SbMatrixcxx . . $ SbMatrix# worldSpaceToWork = getWorldToLocalMatrixcxx . . $ SoDragger#getWorldToLocalMatrix(2db31fc6bbb60646).();
615 worldSpaceToWork.multRightcxx . . $ SbMatrix#multRight(5bda0b2cfca989a9).( localToWorkSpace );
616
617 // update the viewvolume and workspace on the projectors
618 sphereProjcxx . . $ SoTrackballDragger#sphereProj.->setViewVolumecxx . . $ SbProjector#setViewVolume(187982bfa537c808).(getViewVolumecxx . . $ SoDragger#getViewVolume(ee52a61c9e3934e6).());
619 stripeProjcxx . . $ SoTrackballDragger#stripeProj.->setViewVolumecxx . . $ SbProjector#setViewVolume(187982bfa537c808).(getViewVolumecxx . . $ SoDragger#getViewVolume(ee52a61c9e3934e6).());
620 sphereProjcxx . . $ SoTrackballDragger#sphereProj.->setWorkingSpacecxx . . $ SbSphereProjector#setWorkingSpace(37d2f951b3ffd7a6).( workSpaceToWorld );
621 stripeProjcxx . . $ SoTrackballDragger#stripeProj.->setWorkingSpacecxx . . $ SbCylinderProjector#setWorkingSpace(37d2f951b3ffd7a6).( workSpaceToWorld );
622
623 // Get newHitPt and prevHitPt in workspace.
624 SbVec3fcxx . . $ SbVec3f# prevHitPtcxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8).;
625 worldSpaceToWork.multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).(prevWorldHitPtcxx . . $ SoTrackballDragger#prevWorldHitPt., prevHitPt );
626 SbVec3fcxx . . $ SbVec3f# newHitPtcxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8).;
627 SbRotationcxx . . $ SbRotation# deltaRotcxx . . $ SbRotation#SbRotation(49f6e7a06ebc5aa8).;
628 if ( currentStatecxx . . $ SoTrackballDragger#currentState. == FREE_ROTATEcxx . . $ SoTrackballDragger#FREE_ROTATE. ) {
629 newHitPt =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). sphereProjcxx . . $ SoTrackballDragger#sphereProj.->projectcxx . . $ SbSphereProjector#project(52e93d88cc4c3965).(getNormalizedLocaterPositioncxx . . $ SoDragger#getNormalizedLocaterPosition(e67d94fc922bbbd4).());
630 deltaRot =cxx . . $ SbRotation#`operator=`(9cd62c86def1db72). sphereProjcxx . . $ SoTrackballDragger#sphereProj.->getRotationcxx . . $ SbSphereProjector#getRotation(64a7df9701b866d).(prevHitPt,newHitPt);
631 }
632 else {
633 newHitPt =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). stripeProjcxx . . $ SoTrackballDragger#stripeProj.->projectcxx . . $ SbCylinderProjector#project(52e93d88cc4c3965).(getNormalizedLocaterPositioncxx . . $ SoDragger#getNormalizedLocaterPosition(e67d94fc922bbbd4).());
634 deltaRot =cxx . . $ SbRotation#`operator=`(9cd62c86def1db72). stripeProjcxx . . $ SoTrackballDragger#stripeProj.->getRotationcxx . . $ SbCylinderProjector#getRotation(64a7df9701b866d).(prevHitPt,newHitPt);
635 }
636
637 // Append deltaRot to prevMotionMatrix, which we saved last time.
638 SbMatrixcxx . . $ SbMatrix# newMotionMatrix =
639 appendRotationcxx . . $ SoDragger#appendRotation(55735ba517c4d581).( prevMotionMatrixcxx . . $ SoTrackballDragger#prevMotionMatrix., deltaRot, SbVec3fcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(0,0,0),
640 &workSpaceToLocal );
641
642 // Save our incremental results.
643 workSpaceToWorld.multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).(newHitPt, prevWorldHitPtcxx . . $ SoTrackballDragger#prevWorldHitPt.);
644 prevMotionMatrixcxx . . $ SoTrackballDragger#prevMotionMatrix. =cxx . . $ SbMatrix#`operator=`(5bda0b2cfca989a9). newMotionMatrix;
645
646 setMotionMatrixcxx . . $ SoDragger#setMotionMatrix(37d2f951b3ffd7a6).( newMotionMatrix );
647
648 // save information for animation of continuous spining
649 prevTimecxx . . $ SoTrackballDragger#prevTime. =cxx . . $ SbTime#`operator=`(73027bd0a2429d7a). getEventcxx . . $ SoDragger#getEvent(c30b8bbf6163e0e4).()->getTimecxx . . $ SoEvent#getTime(52a341c094338469).();
650
651 // save increment of rotation for animation
652 lastIndexcxx . . $ SoTrackballDragger#lastIndex. = ((lastIndexcxx . . $ SoTrackballDragger#lastIndex.+1) % ROT_BUFFER_SIZEcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:84:9`!);
653 rotBuffercxx . . $ SoTrackballDragger#rotBuffer.[lastIndexcxx . . $ SoTrackballDragger#lastIndex.] =cxx . . $ SbRotation#`operator=`(9cd62c86def1db72). deltaRot;
654 timeBuffercxx . . $ SoTrackballDragger#timeBuffer.[lastIndexcxx . . $ SoTrackballDragger#lastIndex.] =cxx . . $ SbTime#`operator=`(73027bd0a2429d7a). prevTimecxx . . $ SoTrackballDragger#prevTime.;
655
656 // check if queue is full
657 // if so, through away oldest events from queue
658 if (((lastIndexcxx . . $ SoTrackballDragger#lastIndex.+1) % ROT_BUFFER_SIZEcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:84:9`!) == firstIndexcxx . . $ SoTrackballDragger#firstIndex.)
659 firstIndexcxx . . $ SoTrackballDragger#firstIndex. = ((firstIndexcxx . . $ SoTrackballDragger#firstIndex.+1) % ROT_BUFFER_SIZEcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:84:9`!);
660
661 return TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!;
662 }
663
664 ////////////////////////////////////////////////////////////////////////
665 //
666 // Description:
667 // Apply a uniform scale to the trackball, by finding the closest point
668 // on the line and seeing how much further (orcloser) from the
669 // center we are than last time.
670 //
671 // Use: private
672 //
673 SbBoolcxx . . $ SbBool#
674 SoTrackballDraggercxx . . $ SoTrackballDragger#::scaleDragcxx . . $ SoTrackballDragger#scaleDrag(b126dc7c1de90089).()
675 //
676 ////////////////////////////////////////////////////////////////////////
677 {
678 SbMatrixcxx . . $ SbMatrix# workSpaceToLocalcxx . . $ SbMatrix#SbMatrix(49f6e7a06ebc5aa8)., localToWorkSpacecxx . . $ SbMatrix#SbMatrix(49f6e7a06ebc5aa8).;
679 getPartToLocalMatrixcxx . . $ SoDragger#getPartToLocalMatrix(311231c517bf1a8f).( "antiSquish"cxx . . $ SbName#SbName(85c52e162fed56f9)., workSpaceToLocal, localToWorkSpace);
680 SbMatrixcxx . . $ SbMatrix# workSpaceToWorld = getLocalToWorldMatrixcxx . . $ SoDragger#getLocalToWorldMatrix(2db31fc6bbb60646).();
681 workSpaceToWorld.multLeftcxx . . $ SbMatrix#multLeft(5bda0b2cfca989a9).( workSpaceToLocal );
682 SbMatrixcxx . . $ SbMatrix# worldSpaceToWork = getWorldToLocalMatrixcxx . . $ SoDragger#getWorldToLocalMatrix(2db31fc6bbb60646).();
683 worldSpaceToWork.multRightcxx . . $ SbMatrix#multRight(5bda0b2cfca989a9).( localToWorkSpace );
684
685 SbVec3fcxx . . $ SbVec3f# startHitPtcxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8)., cntrcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).( 0,0,0 );
686 SbLineProjectorcxx . . $ SbLineProjector# lineProjcxx . . $ SbLineProjector#SbLineProjector(49f6e7a06ebc5aa8).;
687 worldSpaceToWork.multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).( getWorldStartingPointcxx . . $ SoDragger#getWorldStartingPoint(42d43ea8522fe3bf).(), startHitPt );
688
689 // make a projection line between the center and the initial hit point.
690 lineProj.setLinecxx . . $ SbLineProjector#setLine(40219236977e8d5e).( SbLinecxx . . $ SbLine#SbLine(d696704770a33d8f).( cntr, startHitPt ));
691 lineProj.setViewVolumecxx . . $ SbProjector#setViewVolume(187982bfa537c808).(getViewVolumecxx . . $ SoDragger#getViewVolume(ee52a61c9e3934e6).());
692 lineProj.setWorkingSpacecxx . . $ SbProjector#setWorkingSpace(37d2f951b3ffd7a6).( workSpaceToWorld );
693
694 SbVec3fcxx . . $ SbVec3f# newHitPtcxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8).;
695 // lineProj has the line we are locked to in expanding and contracting
696 // the trackball. Find the point from lineProj closest to the mouseLine
697 newHitPt =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). lineProj.projectcxx . . $ SbLineProjector#project(52e93d88cc4c3965).(getNormalizedLocaterPositioncxx . . $ SoDragger#getNormalizedLocaterPosition(e67d94fc922bbbd4).());
698
699 SbVec3fcxx . . $ SbVec3f# oldRadVec = startHitPt -cxx . . $ operator-(af63bf8d0639b76b). cntr;
700 SbVec3fcxx . . $ SbVec3f# newRadVec = newHitPt -cxx . . $ operator-(af63bf8d0639b76b). cntr;
701
702 // [1] Find the distance from the old and new projected points to origin
703 float oldRad = oldRadVec.lengthcxx . . $ SbVec3f#length(5036dfe8d4170af2).();
704 float newRad = newRadVec.lengthcxx . . $ SbVec3f#length(5036dfe8d4170af2).();
705
706 // [2] Check if we've flipped to the other side of the origin.
707 if (startHitPt.dotcxx . . $ SbVec3f#dot(adcfb95606509c95).(newHitPt) < 0.0)
708 newRad *= -1.0;
709
710 // [3] Change in scale is ratio of newRad to oldRad
711 #define TINYcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:711:9`! .0001
712 float delta = (fabs(oldRad) < TINYcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:711:9`! || fabs(newRad) < TINYcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:711:9`!)
713 ? 1.0 : newRad / oldRad;
714 #undef TINYcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:711:9`!
715
716 // constrain the scaling to be greater than getMinScale()
717 if (delta < getMinScalecxx . . $ SoDragger#getMinScale(9b8c9e39889c762c).())
718 delta = getMinScalecxx . . $ SoDragger#getMinScale(9b8c9e39889c762c).();
719
720 // Set the scaling (to be done relative to scale in startMotionMatrix).
721 SbVec3fcxx . . $ SbVec3f# sclcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).( delta, delta, delta );
722
723 // Save our incremental results.
724 workSpaceToWorld.multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).(newHitPt, prevWorldHitPtcxx . . $ SoTrackballDragger#prevWorldHitPt.);
725
726 // Append this to the startMotionMatrix, which we saved at the beginning
727 // of the drag, to find the current motion matrix.
728 setMotionMatrixcxx . . $ SoDragger#setMotionMatrix(37d2f951b3ffd7a6).( appendScalecxx . . $ SoDragger#appendScale(582101c4f33c2642).( getStartMotionMatrixcxx . . $ SoDragger#getStartMotionMatrix(c49c36ee78b0a89e).(), scl,SbVec3fcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(0,0,0),
729 &workSpaceToLocal));
730
731 return TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!;
732 }
733
734 ////////////////////////////////////////////////////////////////////////
735 //
736 // Description:
737 // Select a new user-selected axis for constrained rotation.
738 // When the user selects this special axis, an axis and a wheel
739 // are displayed. Once selected and displayed, the user can
740 // pick the wheel and use it to spin the trackball about this
741 // axis.
742 //
743 // Use: private
744 //
745 SbBoolcxx . . $ SbBool#
746 SoTrackballDraggercxx . . $ SoTrackballDragger#::userStripeDragcxx . . $ SoTrackballDragger#userStripeDrag(b126dc7c1de90089).()
747 //
748 ////////////////////////////////////////////////////////////////////////
749 {
750 SbMatrixcxx . . $ SbMatrix# workSpaceToLocalcxx . . $ SbMatrix#SbMatrix(49f6e7a06ebc5aa8)., localToWorkSpacecxx . . $ SbMatrix#SbMatrix(49f6e7a06ebc5aa8).;
751 getPartToLocalMatrixcxx . . $ SoDragger#getPartToLocalMatrix(311231c517bf1a8f).( "antiSquish"cxx . . $ SbName#SbName(85c52e162fed56f9)., workSpaceToLocal, localToWorkSpace);
752 SbMatrixcxx . . $ SbMatrix# workSpaceToWorld = getLocalToWorldMatrixcxx . . $ SoDragger#getLocalToWorldMatrix(2db31fc6bbb60646).();
753 workSpaceToWorld.multLeftcxx . . $ SbMatrix#multLeft(5bda0b2cfca989a9).( workSpaceToLocal );
754 SbMatrixcxx . . $ SbMatrix# worldSpaceToWork = getWorldToLocalMatrixcxx . . $ SoDragger#getWorldToLocalMatrix(2db31fc6bbb60646).();
755 worldSpaceToWork.multRightcxx . . $ SbMatrix#multRight(5bda0b2cfca989a9).( localToWorkSpace );
756
757 SbVec3fcxx . . $ SbVec3f# newHitPtcxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8).;
758
759 // get the newHitPt
760 // temporarily make the tolerance = 1.0, since we want all possible sphere
761 // intersections. This makes for a nicer interface of axis picking
762 ((SbSphereSectionProjectorcxx . . $ SbSphereSectionProjector# *)sphereProjcxx . . $ SoTrackballDragger#sphereProj.)->setTolerancecxx . . $ SbSphereSectionProjector#setTolerance(9364e6e7bff7660).( 1.0 );
763 newHitPt =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). sphereProjcxx . . $ SoTrackballDragger#sphereProj.->projectcxx . . $ SbSphereProjector#project(52e93d88cc4c3965).(getNormalizedLocaterPositioncxx . . $ SoDragger#getNormalizedLocaterPosition(e67d94fc922bbbd4).());
764 ((SbSphereSectionProjectorcxx . . $ SbSphereSectionProjector# *)sphereProjcxx . . $ SoTrackballDragger#sphereProj.)->setTolerancecxx . . $ SbSphereSectionProjector#setTolerance(9364e6e7bff7660).( 0.85 );
765
766 // find the new axis
767 userAxisVeccxx . . $ SoTrackballDragger#userAxisVec. =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). newHitPt;
768 userAxisVeccxx . . $ SoTrackballDragger#userAxisVec..normalizecxx . . $ SbVec3f#normalize(9b8c9e39889c762c).();
769
770 SbRotationcxx . . $ SbRotation# plcmntRotcxx . . $ SbRotation#SbRotation(d696704770a33d8f).(SbVec3fcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(0,1,0), userAxisVeccxx . . $ SoTrackballDragger#userAxisVec.);
771 ((SoRotationcxx . . $ SoRotation# *)userAxisRotationcxx . . $ SoTrackballDragger#userAxisRotation..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).())->rotationcxx . . $ SoRotation#rotation..setValuecxx . . $ SoSFRotation#setValue(8b1048b3fc01a89c).( plcmntRot );
772
773 // decide whether or not to display the spinning wheel.
774 // only show it if does not line up with a major axis.
775 if ( ( fabs(userAxisVeccxx . . $ SoTrackballDragger#userAxisVec.[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0]) > 0.99 )
776 || ( fabs(userAxisVeccxx . . $ SoTrackballDragger#userAxisVec.[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1]) > 0.99 )
777 || ( fabs(userAxisVeccxx . . $ SoTrackballDragger#userAxisVec.[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).2]) > 0.99 ) ) {
778 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( userAxisSwitchcxx . . $ SoTrackballDragger#userAxisSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), SO_SWITCH_NONEcxx . . $ `lib/database/include/Inventor/nodes/SoSwitch.h:75:9`! );
779 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( userRotatorSwitchcxx . . $ SoTrackballDragger#userRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), SO_SWITCH_NONEcxx . . $ `lib/database/include/Inventor/nodes/SoSwitch.h:75:9`! );
780 }
781 else {
782 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( userAxisSwitchcxx . . $ SoTrackballDragger#userAxisSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), 1 );
783 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( userRotatorSwitchcxx . . $ SoTrackballDragger#userRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), 1 );
784 }
785
786 // save intersection for later
787 workSpaceToWorld.multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).( newHitPt, prevWorldHitPtcxx . . $ SoTrackballDragger#prevWorldHitPt. );
788
789 return TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!;
790 }
791
792 ////////////////////////////////////////////////////////////////////////
793 //
794 // Description:
795 // Called when the mouse-button is released.
796 // Prepares the spinSensor to continue spinning...
797 //
798 // Use: private
799 //
800 void
801 SoTrackballDraggercxx . . $ SoTrackballDragger#::dragFinishcxx . . $ SoTrackballDragger#dragFinish(49f6e7a06ebc5aa8).()
802 //
803 ////////////////////////////////////////////////////////////////////////
804 {
805 // Invalidate surroundScale if it exists.
806 SoSurroundScalecxx . . $ SoSurroundScale# *ss = SO_CHECK_PARTcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoBaseKit.h:422:9`!(this, "surroundScale", SoSurroundScale);
807 if (ss != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
808 ss->invalidatecxx . . $ SoSurroundScale#invalidate(49f6e7a06ebc5aa8).();
809
810 switch ( currentStatecxx . . $ SoTrackballDragger#currentState. ) {
811 case FREE_ROTATEcxx . . $ SoTrackballDragger#FREE_ROTATE.:
812 case X_ROTATEcxx . . $ SoTrackballDragger#X_ROTATE.:
813 case Y_ROTATEcxx . . $ SoTrackballDragger#Y_ROTATE.:
814 case Z_ROTATEcxx . . $ SoTrackballDragger#Z_ROTATE.:
815 case USER_AXIS_ROTATEcxx . . $ SoTrackballDragger#USER_AXIS_ROTATE.:
816 // check if we need to continue spinning
817 if ( isAnimationEnabledcxx . . $ SoTrackballDragger#isAnimationEnabled(b126dc7c1de90089).()
818 && (getEventcxx . . $ SoDragger#getEvent(c30b8bbf6163e0e4).()->getTimecxx . . $ SoEvent#getTime(52a341c094338469).() -cxx . . $ operator-(22f32cf074e3d57c). prevTimecxx . . $ SoTrackballDragger#prevTime.) ==cxx . . $ SbTime#`operator==`(64f90dbbb710e095). SbTimecxx . . $ SbTime#::zerocxx . . $ SbTime#zero(a7df0c55874e8fee).()) {
819 // button came up during motion
820
821 spinTimecxx . . $ SoTrackballDragger#spinTime..setToTimeOfDaycxx . . $ SbTime#setToTimeOfDay(49f6e7a06ebc5aa8).();
822 scheduleRatecxx . . $ SoTrackballDragger#scheduleRate. =cxx . . $ SbTime#`operator=`(73027bd0a2429d7a). FAST_ANIM_RATEcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:79:9`!;
823 currentStatecxx . . $ SoTrackballDragger#currentState. = SPINNINGcxx . . $ SoTrackballDragger#SPINNING.;
824 computeAveragecxx . . $ SoTrackballDragger#computeAverage. = TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!;
825 spinSensorcxx . . $ SoTrackballDragger#spinSensor.->setIntervalcxx . . $ SoTimerSensor#setInterval(cf18edd44c50d8bf).(scheduleRatecxx . . $ SoTrackballDragger#scheduleRate.);
826 spinSensorcxx . . $ SoTrackballDragger#spinSensor.->schedulecxx . . $ SoTimerSensor#schedule(49f6e7a06ebc5aa8).();
827 }
828 else
829 currentStatecxx . . $ SoTrackballDragger#currentState. = INACTIVEcxx . . $ SoTrackballDragger#INACTIVE.;
830 break;
831 default:
832 currentStatecxx . . $ SoTrackballDragger#currentState. = INACTIVEcxx . . $ SoTrackballDragger#INACTIVE.;
833 break;
834 }
835
836 setHighlightscxx . . $ SoTrackballDragger#setHighlights(49f6e7a06ebc5aa8).();
837
838 if (wasSpinningAtDragStartcxx . . $ SoTrackballDragger#wasSpinningAtDragStart.)
839 getHandleEventActioncxx . . $ SoDragger#getHandleEventAction(259d39329627b7cc).()->setHandledcxx . . $ SoHandleEventAction#setHandled(49f6e7a06ebc5aa8).();
840 }
841
842 ////////////////////////////////////////////////////////////////////////
843 //
844 // Description:
845 // Resets all variables for turning off the spinSensor
846 //
847 // Use: private
848
849 void
850 SoTrackballDraggercxx . . $ SoTrackballDragger#::resetSpinStuffcxx . . $ SoTrackballDragger#resetSpinStuff(49f6e7a06ebc5aa8).()
851 //
852 ////////////////////////////////////////////////////////////////////////
853 {
854 if ( currentStatecxx . . $ SoTrackballDragger#currentState. == SPINNINGcxx . . $ SoTrackballDragger#SPINNING. ) {
855 currentStatecxx . . $ SoTrackballDragger#currentState. = INACTIVEcxx . . $ SoTrackballDragger#INACTIVE.;
856 spinSensorcxx . . $ SoTrackballDragger#spinSensor.->unschedulecxx . . $ SoTimerSensor#unschedule(49f6e7a06ebc5aa8).();
857 renderCachingcxx . . $ SoInteractionKit#renderCaching. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). AUTOcxx . . $ SoInteractionKit#AUTO.;
858 }
859
860 // reset animation queue for spinning
861 firstIndexcxx . . $ SoTrackballDragger#firstIndex. = 0;
862 lastIndexcxx . . $ SoTrackballDragger#lastIndex. = -1;
863 }
864
865 ////////////////////////////////////////////////////////////////////////
866 //
867 // Description:
868 // Routine which animates the ball spinning (called by sensor).
869 //
870 // Use: private
871
872 void
873 SoTrackballDraggercxx . . $ SoTrackballDragger#::spinAnimatecxx . . $ SoTrackballDragger#spinAnimate(49f6e7a06ebc5aa8).()
874 //
875 ////////////////////////////////////////////////////////////////////////
876 {
877 // get the time difference
878 SbTimecxx . . $ SbTime# time = SbTimecxx . . $ SbTime#::getTimeOfDaycxx . . $ SbTime#getTimeOfDay(a7df0c55874e8fee).();
879 SbTimecxx . . $ SbTime# timeDiff = time -cxx . . $ operator-(22f32cf074e3d57c). spinTimecxx . . $ SoTrackballDragger#spinTime.;
880 spinTimecxx . . $ SoTrackballDragger#spinTime. =cxx . . $ SbTime#`operator=`(73027bd0a2429d7a). time; // save current time
881 double sec = timeDiff.getValuecxx . . $ SbTime#getValue(21b6c25e127938e2).();
882 float angle;
883
884 // check if average rotation needs to be computed
885 if (computeAveragecxx . . $ SoTrackballDragger#computeAverage.) {
886
887 // get number of samples
888 int num = (((lastIndexcxx . . $ SoTrackballDragger#lastIndex. - firstIndexcxx . . $ SoTrackballDragger#firstIndex.) + 1 +
889 ROT_BUFFER_SIZEcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:84:9`!) % ROT_BUFFER_SIZEcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:84:9`!);
890
891 // check for not enough samples
892 if (num < 2) {
893 resetSpinStuffcxx . . $ SoTrackballDragger#resetSpinStuff(49f6e7a06ebc5aa8).();
894 return;
895 }
896
897 // get average axis of rotation
898 // ??? right now only take one sample for axis
899 rotBuffercxx . . $ SoTrackballDragger#rotBuffer.[firstIndexcxx . . $ SoTrackballDragger#firstIndex.].getValuecxx . . $ SbRotation#getValue(6c5f31d1454285f0).(averageAxiscxx . . $ SoTrackballDragger#averageAxis., angle);
900
901 // get angular velocity
902 SbVec3fcxx . . $ SbVec3f# axiscxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8).;
903 angleVelocitycxx . . $ SoTrackballDragger#angleVelocity. = 0;
904 for (int i=0; i<num; i++) {
905 int n = (firstIndexcxx . . $ SoTrackballDragger#firstIndex. + i) % ROT_BUFFER_SIZEcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:84:9`!;
906 rotBuffercxx . . $ SoTrackballDragger#rotBuffer.[n].getValuecxx . . $ SbRotation#getValue(6c5f31d1454285f0).(axis, angle);
907 angleVelocitycxx . . $ SoTrackballDragger#angleVelocity. += angle;
908 }
909 SbTimecxx . . $ SbTime# deltaTime = timeBuffercxx . . $ SoTrackballDragger#timeBuffer.[lastIndexcxx . . $ SoTrackballDragger#lastIndex.] -cxx . . $ operator-(22f32cf074e3d57c). timeBuffercxx . . $ SoTrackballDragger#timeBuffer.[firstIndexcxx . . $ SoTrackballDragger#firstIndex.];
910
911 #ifdef DEBUG
912 // check for negative number
913 if (deltaTime.getValue() <= 0.0)
914 SoDebugError::post("SoTrackballDragger::spinAnimate",
915 "Zero or negative Dt %f", deltaTime.getValue());
916 #endif
917
918 angleVelocitycxx . . $ SoTrackballDragger#angleVelocity. /= deltaTime.getValuecxx . . $ SbTime#getValue(21b6c25e127938e2).();
919
920 computeAveragecxx . . $ SoTrackballDragger#computeAverage. = FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!;
921 }
922
923 // calculate the change in rotation
924 angle = angleVelocitycxx . . $ SoTrackballDragger#angleVelocity. * sec;
925
926 // append the incremental rotation after the current rotation
927 SbRotationcxx . . $ SbRotation# rotIncrementcxx . . $ SbRotation#SbRotation(91fd4afec15735a5).(averageAxiscxx . . $ SoTrackballDragger#averageAxis., angle);
928
929 // recalculate trackball placement
930 // 1 -- convert local motion into matrix
931 SbMatrixcxx . . $ SbMatrix# tmcxx . . $ SbMatrix#SbMatrix(49f6e7a06ebc5aa8).;
932 tm.setRotatecxx . . $ SbMatrix#setRotate(8b1048b3fc01a89c).( rotIncrement );
933 // 2 -- transform matrix across antisquish node.
934 transformMatrixToLocalSpacecxx . . $ SoDragger#transformMatrixToLocalSpace(ef179d3ab902fee7).( tm, tm, "antiSquish"cxx . . $ SbName#SbName(85c52e162fed56f9).);
935 // 3 -- append matrix to motion
936 SbMatrixcxx . . $ SbMatrix# newMotion = getMotionMatrixcxx . . $ SoDragger#getMotionMatrix(c49c36ee78b0a89e).();
937 setMotionMatrixcxx . . $ SoDragger#setMotionMatrix(37d2f951b3ffd7a6).( newMotion.multLeftcxx . . $ SbMatrix#multLeft(5bda0b2cfca989a9).( tm ) );
938
939 if ( timeDiff >cxx . . $ SbTime#`operator>`(64f90dbbb710e095). ( scheduleRatecxx . . $ SoTrackballDragger#scheduleRate. *cxx . . $ `operator*`(cecddbd5cf7aebfb). ( 1 + ANIM_ADJUSTMENTcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:80:9`!) ))
940 // If things are taking significantly longer than expected,
941 // increase the amount of time between calls.
942 scheduleRatecxx . . $ SoTrackballDragger#scheduleRate. *=cxx . . $ SbTime#`operator*=`(f4c10ee817c9a4f5). ( 1 + ANIM_ADJUSTMENTcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:80:9`! );
943 else if ( timeDiff <cxx . . $ SbTime#`operator<`(64f90dbbb710e095). ( scheduleRatecxx . . $ SoTrackballDragger#scheduleRate. *cxx . . $ `operator*`(cecddbd5cf7aebfb). ( 1 + (ANIM_ADJUSTMENTcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:80:9`!/2.0)) )) {
944 // otherwise, if things are going quickly, reduce the time.
945 // See which is smaller, scaling down the rate (newRate1)
946 // or a binary-search hop down to the FAST_ANIM_RATE
947 SbTimecxx . . $ SbTime# newRate1 = scheduleRatecxx . . $ SoTrackballDragger#scheduleRate. *cxx . . $ `operator*`(cecddbd5cf7aebfb). ( 1 - ANIM_ADJUSTMENTcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:80:9`! );
948 SbTimecxx . . $ SbTime# newRate2 = scheduleRatecxx . . $ SoTrackballDragger#scheduleRate. -cxx . . $ operator-(22f32cf074e3d57c). 0.5 *cxx . . $ `operator*`(5db6cdbaee009d0e). (scheduleRatecxx . . $ SoTrackballDragger#scheduleRate. -cxx . . $ operator-(22f32cf074e3d57c). FAST_ANIM_RATEcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:79:9`!);
949 scheduleRatecxx . . $ SoTrackballDragger#scheduleRate. =cxx . . $ SbTime#`operator=`(73027bd0a2429d7a). ( newRate1 <cxx . . $ SbTime#`operator<`(64f90dbbb710e095). newRate2 ) ? newRate1 : newRate2;
950 }
951
952 // Make sure we don't go below the fastest rate
953 if ( scheduleRatecxx . . $ SoTrackballDragger#scheduleRate. <cxx . . $ SbTime#`operator<`(64f90dbbb710e095). FAST_ANIM_RATEcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:79:9`! )
954 scheduleRatecxx . . $ SoTrackballDragger#scheduleRate. =cxx . . $ SbTime#`operator=`(73027bd0a2429d7a). FAST_ANIM_RATEcxx . . $ `lib/interaction/src/draggers/SoTrackballDragger.c++:79:9`!;
955
956 // reschedule at the new rate, starting at THIS time + one increment
957 // We don't need to unschedule first -- it's done automatically!
958 spinSensorcxx . . $ SoTrackballDragger#spinSensor.->setIntervalcxx . . $ SoTimerSensor#setInterval(cf18edd44c50d8bf).(scheduleRatecxx . . $ SoTrackballDragger#scheduleRate.);
959 spinSensorcxx . . $ SoTrackballDragger#spinSensor.->setBaseTimecxx . . $ SoTimerSensor#setBaseTime(cf18edd44c50d8bf).(spinTimecxx . . $ SoTrackballDragger#spinTime. +cxx . . $ operator+(22f32cf074e3d57c). scheduleRatecxx . . $ SoTrackballDragger#scheduleRate.);
960 spinSensorcxx . . $ SoTrackballDragger#spinSensor.->schedulecxx . . $ SoTimerSensor#schedule(49f6e7a06ebc5aa8).();
961 }
962
963 //
964 ////////////////////////////////////////////////////////////////////////
965 // static callbacks stubs
966 ////////////////////////////////////////////////////////////////////////
967 //
968
969 void
970 SoTrackballDraggercxx . . $ SoTrackballDragger#::spinSensorCBcxx . . $ SoTrackballDragger#spinSensorCB(c8d298b3e215c027).(void *v, SoSensorcxx . . $ SoSensor# *)
971 {
972 SoTrackballDraggercxx . . $ SoTrackballDragger# *m = (SoTrackballDraggercxx . . $ SoTrackballDragger# *) v;
973
974 m->renderCachingcxx . . $ SoInteractionKit#renderCaching. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). OFFcxx . . $ SoInteractionKit#OFF.;
975 m->spinAnimatecxx . . $ SoTrackballDragger#spinAnimate(49f6e7a06ebc5aa8).();
976 }
977
978 ////////////////////////////////////////////////////////////////////////
979 //
980 // Use: protected
981 //
982 void
983 SoTrackballDraggercxx . . $ SoTrackballDragger#::setAllPartsActivecxx . . $ SoTrackballDragger#setAllPartsActive(d4f767463ce0a6b3).( SbBoolcxx . . $ SbBool# onOrOff )
984 //
985 ////////////////////////////////////////////////////////////////////////
986 {
987 int sVal = (onOrOff == TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!) ? 1 : 0;
988
989 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( rotatorSwitchcxx . . $ SoTrackballDragger#rotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), sVal );
990 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( XRotatorSwitchcxx . . $ SoTrackballDragger#XRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), sVal );
991 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( YRotatorSwitchcxx . . $ SoTrackballDragger#YRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), sVal );
992 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( ZRotatorSwitchcxx . . $ SoTrackballDragger#ZRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), sVal );
993
994 SoSwitchcxx . . $ SoSwitch# *sw = (SoSwitchcxx . . $ SoSwitch# *) userAxisSwitchcxx . . $ SoTrackballDragger#userAxisSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).();
995 if ( sw && sw->whichChildcxx . . $ SoSwitch#whichChild..getValuecxx . . $ SoSFInt32#getValue(455f465bc33b4cdf).() != SO_SWITCH_NONEcxx . . $ `lib/database/include/Inventor/nodes/SoSwitch.h:75:9`! )
996 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( userAxisSwitchcxx . . $ SoTrackballDragger#userAxisSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), sVal );
997
998 sw = (SoSwitchcxx . . $ SoSwitch# *) userRotatorSwitchcxx . . $ SoTrackballDragger#userRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).();
999 if ( sw && sw->whichChildcxx . . $ SoSwitch#whichChild..getValuecxx . . $ SoSFInt32#getValue(455f465bc33b4cdf).() != SO_SWITCH_NONEcxx . . $ `lib/database/include/Inventor/nodes/SoSwitch.h:75:9`! )
1000 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( userRotatorSwitchcxx . . $ SoTrackballDragger#userRotatorSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).(), sVal );
1001 }
1002
1003 //
1004 ////////////////////////////////////////////////////////////////////////
1005 // keypress/release callback function
1006 //
1007 // This assures that the proper changes to the highlights,
1008 // currentState, and projectors are made
1009 //
1010 // It is called every time a meta key is pressed or released
1011 //
1012 ////////////////////////////////////////////////////////////////////////
1013 //
1014
1015 void
1016 SoTrackballDraggercxx . . $ SoTrackballDragger#::metaKeyChangeCBcxx . . $ SoTrackballDragger#metaKeyChangeCB(7027446dc0b7318f).( void *, SoDraggercxx . . $ SoDragger# *inDragger)
1017 {
1018 SoTrackballDraggercxx . . $ SoTrackballDragger# *tb = (SoTrackballDraggercxx . . $ SoTrackballDragger# *) inDragger;
1019
1020 SoHandleEventActioncxx . . $ SoHandleEventAction# *ha = tb->getHandleEventActioncxx . . $ SoDragger#getHandleEventAction(259d39329627b7cc).();
1021
1022 //[1] Only do this if we are grabbing
1023 if ( ha->getGrabbercxx . . $ SoHandleEventAction#getGrabber(b794963b450d51b3).() != tb )
1024 return;
1025
1026 //[2] We only want key press or release events.
1027 const SoEventcxx . . $ SoEvent# *event = tb->getEventcxx . . $ SoDragger#getEvent(c30b8bbf6163e0e4).();
1028 if ( !SO_KEY_PRESS_EVENTcxx . . $ `lib/database/include/Inventor/events/SoKeyboardEvent.h:65:9`!(event, ANY) && !SO_KEY_RELEASE_EVENTcxx . . $ `lib/database/include/Inventor/events/SoKeyboardEvent.h:68:9`!(event, ANY))
1029 return;
1030
1031 //[3] Is the key constrain or modify?
1032 const SoKeyboardEventcxx . . $ SoKeyboardEvent# *ke = (const SoKeyboardEventcxx . . $ SoKeyboardEvent# *) event;
1033 SoKeyboardEventcxx . . $ SoKeyboardEvent#::Keycxx . . $ SoKeyboardEvent#Key# key = ke->getKeycxx . . $ SoKeyboardEvent#getKey(4f90a17ab6d7b294).();
1034 if ( key == SoKeyboardEventcxx . . $ SoKeyboardEvent#::LEFT_SHIFTcxx . . $ SoKeyboardEvent#LEFT_SHIFT. ||
1035 key == SoKeyboardEventcxx . . $ SoKeyboardEvent#::RIGHT_SHIFTcxx . . $ SoKeyboardEvent#RIGHT_SHIFT. ||
1036 key == SoKeyboardEventcxx . . $ SoKeyboardEvent#::LEFT_CONTROLcxx . . $ SoKeyboardEvent#LEFT_CONTROL. ||
1037 key == SoKeyboardEventcxx . . $ SoKeyboardEvent#::RIGHT_CONTROLcxx . . $ SoKeyboardEvent#RIGHT_CONTROL. ) {
1038
1039 // We want to end the old gesture and start a new one.
1040
1041 // [A] Release the grabber. This ends the gesture and calls all
1042 // finishCallbacks (on parent dragger, too, if we're registered)
1043 ha->releaseGrabbercxx . . $ SoHandleEventAction#releaseGrabber(49f6e7a06ebc5aa8).();
1044
1045 // [B] Set the starting point to be our saved prevWorldHitPt
1046 tb->setStartingPointcxx . . $ SoDragger#setStartingPoint(65a601b9d70571d6).( tb->prevWorldHitPtcxx . . $ SoTrackballDragger#prevWorldHitPt. );
1047
1048 // [C] Become the grabber again. This begins a new gesture and calls all
1049 // startCallbacks (parent dragger, too). Info like viewVolume,
1050 // viewportRegion, handleEventAction, and tempPathToThis
1051 // is still valid.
1052 ha->setGrabbercxx . . $ SoHandleEventAction#setGrabber(da6c7544ccee32bd).(tb);
1053
1054 // [D] set handled
1055 ha->setHandledcxx . . $ SoHandleEventAction#setHandled(49f6e7a06ebc5aa8).();
1056 }
1057 }
1058
1059 ////////////////////////////////////////////////////////////////////
1060 // Stubs for callbacks
1061 ////////////////////////////////////////////////////////////////////
1062 void
1063 SoTrackballDraggercxx . . $ SoTrackballDragger#::startCBcxx . . $ SoTrackballDragger#startCB(7027446dc0b7318f).( void *, SoDraggercxx . . $ SoDragger# *inDragger )
1064 {
1065 SoTrackballDraggercxx . . $ SoTrackballDragger# *tb = (SoTrackballDraggercxx . . $ SoTrackballDragger# *) inDragger;
1066 tb->dragStartcxx . . $ SoTrackballDragger#dragStart(49f6e7a06ebc5aa8).();
1067 }
1068
1069 void
1070 SoTrackballDraggercxx . . $ SoTrackballDragger#::motionCBcxx . . $ SoTrackballDragger#motionCB(7027446dc0b7318f).( void *, SoDraggercxx . . $ SoDragger# *inDragger )
1071 {
1072 SoTrackballDraggercxx . . $ SoTrackballDragger# *tb = (SoTrackballDraggercxx . . $ SoTrackballDragger# *) inDragger;
1073 tb->dragcxx . . $ SoTrackballDragger#drag(49f6e7a06ebc5aa8).();
1074 }
1075
1076 void
1077 SoTrackballDraggercxx . . $ SoTrackballDragger#::finishCBcxx . . $ SoTrackballDragger#finishCB(7027446dc0b7318f).( void *, SoDraggercxx . . $ SoDragger# *inDragger )
1078 {
1079 SoTrackballDraggercxx . . $ SoTrackballDragger# *tb = (SoTrackballDraggercxx . . $ SoTrackballDragger# *) inDragger;
1080 tb->dragFinishcxx . . $ SoTrackballDragger#dragFinish(49f6e7a06ebc5aa8).();
1081 }
1082
1083 void
1084 SoTrackballDraggercxx . . $ SoTrackballDragger#::valueChangedCBcxx . . $ SoTrackballDragger#valueChangedCB(7027446dc0b7318f).( void *, SoDraggercxx . . $ SoDragger# *inDragger )
1085 {
1086 SoTrackballDraggercxx . . $ SoTrackballDragger# *m = (SoTrackballDraggercxx . . $ SoTrackballDragger# *) inDragger;
1087 SbMatrixcxx . . $ SbMatrix# motMat = m->getMotionMatrixcxx . . $ SoDragger#getMotionMatrix(c49c36ee78b0a89e).();
1088
1089 SbVec3fcxx . . $ SbVec3f# transcxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8)., scalecxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8).;
1090 SbRotationcxx . . $ SbRotation# rotcxx . . $ SbRotation#SbRotation(49f6e7a06ebc5aa8)., scaleOrientcxx . . $ SbRotation#SbRotation(49f6e7a06ebc5aa8).;
1091 getTransformFastcxx . . $ SoDragger#getTransformFast(87c9df4114162fa2).( motMat, trans, rot, scale, scaleOrient);
1092
1093 // Disconnect the field sensors
1094 m->rotFieldSensorcxx . . $ SoTrackballDragger#rotFieldSensor.->detachcxx . . $ SoFieldSensor#detach(49f6e7a06ebc5aa8).();
1095 m->scaleFieldSensorcxx . . $ SoTrackballDragger#scaleFieldSensor.->detachcxx . . $ SoFieldSensor#detach(49f6e7a06ebc5aa8).();
1096
1097 if ( m->rotationcxx . . $ SoTrackballDragger#rotation..getValuecxx . . $ SoSFRotation#getValue(cd68af149be99fa7).() !=cxx . . $ `operator!=`(63a2304dedfd8e48). rot )
1098 m->rotationcxx . . $ SoTrackballDragger#rotation. =cxx . . $ SoSFRotation#`operator=`(a110af7e76887ee8). rot;
1099 if ( m->scaleFactorcxx . . $ SoTrackballDragger#scaleFactor..getValuecxx . . $ SoSFVec3f#getValue(b5c384c15c94bb12).() !=cxx . . $ `operator!=`(648f52454fd9f27). scale )
1100 m->scaleFactorcxx . . $ SoTrackballDragger#scaleFactor. =cxx . . $ SoSFVec3f#`operator=`(861f7885f8980b32). scale;
1101
1102 // Reconnect the field sensors
1103 m->rotFieldSensorcxx . . $ SoTrackballDragger#rotFieldSensor.->attachcxx . . $ SoFieldSensor#attach(6a35cc9f7090653f).( &(m->rotationcxx . . $ SoTrackballDragger#rotation.) );
1104 m->scaleFieldSensorcxx . . $ SoTrackballDragger#scaleFieldSensor.->attachcxx . . $ SoFieldSensor#attach(6a35cc9f7090653f).( &(m->scaleFactorcxx . . $ SoTrackballDragger#scaleFactor.) );
1105 }
1106
1107 void
1108 SoTrackballDraggercxx . . $ SoTrackballDragger#::fieldSensorCBcxx . . $ SoTrackballDragger#fieldSensorCB(c8d298b3e215c027).( void *inDragger, SoSensorcxx . . $ SoSensor# * )
1109 {
1110 SoTrackballDraggercxx . . $ SoTrackballDragger# *dragger = (SoTrackballDraggercxx . . $ SoTrackballDragger# *) inDragger;
1111
1112 SbMatrixcxx . . $ SbMatrix# motMat = dragger->getMotionMatrixcxx . . $ SoDragger#getMotionMatrix(c49c36ee78b0a89e).();
1113 dragger->workFieldsIntoTransformcxx . . $ SoDragger#workFieldsIntoTransform(ab60305a37435a6f).( motMat );
1114
1115 dragger->setMotionMatrixcxx . . $ SoDragger#setMotionMatrix(37d2f951b3ffd7a6).( motMat );
1116 }
1117
1118 void
1119 SoTrackballDraggercxx . . $ SoTrackballDragger#::setDefaultOnNonWritingFieldscxx . . $ SoTrackballDragger#setDefaultOnNonWritingFields(49f6e7a06ebc5aa8).()
1120 {
1121 // These nodes may change after construction, but we still
1122 // don't want to write them out.
1123 surroundScalecxx . . $ SoTrackballDragger#surroundScale..setDefaultcxx . . $ SoField#setDefault(d4f767463ce0a6b3).(TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
1124 antiSquishcxx . . $ SoTrackballDragger#antiSquish..setDefaultcxx . . $ SoField#setDefault(d4f767463ce0a6b3).(TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
1125
1126 // If the userAxis is not being displayed, then do not write
1127 // out the userAxisRotation node.
1128 SoSwitchcxx . . $ SoSwitch# *sw = (SoSwitchcxx . . $ SoSwitch# *) userAxisSwitchcxx . . $ SoTrackballDragger#userAxisSwitch..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).();
1129 if ( sw == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! || sw->whichChildcxx . . $ SoSwitch#whichChild..getValuecxx . . $ SoSFInt32#getValue(455f465bc33b4cdf).() == SO_SWITCH_NONEcxx . . $ `lib/database/include/Inventor/nodes/SoSwitch.h:75:9`! ) {
1130 userAxisRotationcxx . . $ SoTrackballDragger#userAxisRotation..setDefaultcxx . . $ SoField#setDefault(d4f767463ce0a6b3).(TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
1131 }
1132
1133 // Call the base class...
1134 SoDraggercxx . . $ SoDragger#::setDefaultOnNonWritingFieldscxx . . $ SoDragger#setDefaultOnNonWritingFields(49f6e7a06ebc5aa8).();
1135 }