Debian Codegraph @

lib/interaction/src/draggers/SoTabPlaneDragger.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) 1992 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.2 $
44 |
45 | Classes:
46 | SoTabPlaneDragger
47 |
48 | Author(s): Paul Isaacs, Howard Look
49 |
50 ______________ S I L I C O N G R A P H I C S I N C . ____________
51 _______________________________________________________________________
52 */
53
54 #include <Inventor/SbLinear.h>cxx . . $ `<file>/lib/database/include/Inventor/SbLinear.h`/
55 #include <Inventor/SoDB.h>cxx . . $ `<file>/lib/database/include/Inventor/SoDB.h`/
56 #include <Inventor/SoPath.h>cxx . . $ `<file>/lib/database/include/Inventor/SoPath.h`/
57 #include <Inventor/SoPickedPoint.h>cxx . . $ `<file>/lib/database/include/Inventor/SoPickedPoint.h`/
58
59 #include <Inventor/events/SoEvent.h>cxx . . $ `<file>/lib/database/include/Inventor/events/SoEvent.h`/
60 #include <Inventor/events/SoKeyboardEvent.h>cxx . . $ `<file>/lib/database/include/Inventor/events/SoKeyboardEvent.h`/
61 #include <Inventor/sensors/SoFieldSensor.h>cxx . . $ `<file>/lib/database/include/Inventor/sensors/SoFieldSensor.h`/
62
63 #include <Inventor/actions/SoGLRenderAction.h>cxx . . $ `<file>/lib/database/include/Inventor/actions/SoGLRenderAction.h`/
64 #include <Inventor/actions/SoHandleEventAction.h>cxx . . $ `<file>/lib/database/include/Inventor/actions/SoHandleEventAction.h`/
65
66 #include <Inventor/elements/SoCacheElement.h>cxx . . $ `<file>/lib/database/include/Inventor/elements/SoCacheElement.h`/
67 #include <Inventor/elements/SoProjectionMatrixElement.h>cxx . . $ `<file>/lib/database/include/Inventor/elements/SoProjectionMatrixElement.h`/
68 #include <Inventor/elements/SoViewingMatrixElement.h>cxx . . $ `<file>/lib/database/include/Inventor/elements/SoViewingMatrixElement.h`/
69 #include <Inventor/elements/SoViewportRegionElement.h>cxx . . $ `<file>/lib/database/include/Inventor/elements/SoViewportRegionElement.h`/
70
71 #include <Inventor/nodes/SoCoordinate3.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoCoordinate3.h`/
72 #include <Inventor/nodes/SoIndexedFaceSet.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoIndexedFaceSet.h`/
73 #include <Inventor/nodes/SoMaterial.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoMaterial.h`/
74 #include <Inventor/nodes/SoMaterialBinding.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoMaterialBinding.h`/
75 #include <Inventor/nodes/SoNormalBinding.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoNormalBinding.h`/
76 #include <Inventor/nodes/SoNormal.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoNormal.h`/
77 #include <Inventor/nodes/SoSeparator.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoSeparator.h`/
78 #include <Inventor/nodes/SoShapeHints.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoShapeHints.h`/
79 #include <Inventor/nodes/SoSwitch.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoSwitch.h`/
80 #include <Inventor/nodes/SoTransform.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoTransform.h`/
81
82 #include <Inventor/draggers/SoTabPlaneDragger.h>cxx . . $ `<file>/lib/interaction/include/Inventor/draggers/SoTabPlaneDragger.h`/
83
84 #include "geom/SoTabPlaneDraggerGeom.h"cxx . . $ `<file>/lib/interaction/src/draggers/geom/SoTabPlaneDraggerGeom.h`/
85
86 #ifndef __sgi
87 #define _ABScxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:87:9`!(x) ((x) < 0 ? -(x) : (x))
88 #endif // !__sgi
89
90
91 SO_KIT_SOURCEcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:194:9`!(SoTabPlaneDragger);
92
93 ////////////////////////////////////////////////////////////////////////
94 //
95 // Description:
96 // Constructors. Each constructor calls constructorSub(), which
97 // does work that is common to each.
98 //
99 // Use: public
100 //
101 ////////////////////////////////////////////////////////////////////////
102
103 // Default constructor.
104 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#SoTabPlaneDragger(49f6e7a06ebc5aa8).()
105 {
106 SO_KIT_CONSTRUCTORcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:254:9`!(SoTabPlaneDragger);
107
108 isBuiltIncxx . . $ SoFieldContainer#isBuiltIn. = TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!;
109
110 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( planeSwitch, SoSwitch, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
111 geomSeparator, , FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
112 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( translator, SoSeparator, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
113 planeSwitch, , TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`! );
114 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( scaleTabs, SoSeparator, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
115 planeSwitch, , FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
116 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( scaleTabMaterial, SoMaterial, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
117 scaleTabs, , TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`! );
118 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( scaleTabHints, SoShapeHints, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
119 scaleTabs, , TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`! );
120 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( scaleTabMaterialBinding, SoMaterialBinding, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
121 scaleTabs, , FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
122 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( scaleTabNormalBinding, SoNormalBinding, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
123 scaleTabs, , FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
124 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( scaleTabNormal, SoNormal, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
125 scaleTabs, , FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
126 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( edgeScaleCoords, SoCoordinate3, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
127 scaleTabs, , FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
128 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( edgeScaleTab0, SoIndexedFaceSet, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
129 scaleTabs, , FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
130 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( edgeScaleTab1, SoIndexedFaceSet, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
131 scaleTabs, , FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
132 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( edgeScaleTab2, SoIndexedFaceSet, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
133 scaleTabs, , FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
134 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( edgeScaleTab3, SoIndexedFaceSet, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
135 scaleTabs, , FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
136 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( cornerScaleCoords, SoCoordinate3, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
137 scaleTabs, , FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
138 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( cornerScaleTab0, SoIndexedFaceSet, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
139 scaleTabs, , FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
140 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( cornerScaleTab1, SoIndexedFaceSet, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
141 scaleTabs, , FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
142 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( cornerScaleTab2, SoIndexedFaceSet, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
143 scaleTabs, , FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
144 SO_KIT_ADD_CATALOG_ENTRYcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:333:9`!( cornerScaleTab3, SoIndexedFaceSet, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!,
145 scaleTabs, , FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
146
147 if (SO_KIT_IS_FIRST_INSTANCEcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:258:9`!())
148 readDefaultPartscxx . . $ SoInteractionKit#readDefaultParts(5e891a9f77bb0eff).("tabPlaneDragger.iv", geomBuffercxx . . $ SoTabPlaneDragger#geomBuffer., sizeof(geomBuffercxx . . $ SoTabPlaneDragger#geomBuffer.));
149
150 SO_KIT_ADD_FIELDcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:261:9`!(translation, (0.0, 0.0, 0.0));
151 SO_KIT_ADD_FIELDcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:261:9`!(scaleFactor, (1.0, 1.0, 1.0));
152
153 SO_KIT_INIT_INSTANCEcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoSubKit.h:546:9`!();
154
155 // Create All the parts...
156
157 setPartAsDefaultcxx . . $ SoInteractionKit#setPartAsDefault(91c97549ed5f0a6b).("translator"cxx . . $ SbName#SbName(85c52e162fed56f9)., "tabPlaneTranslator"cxx . . $ SbName#SbName(85c52e162fed56f9).);
158 setPartAsDefaultcxx . . $ SoInteractionKit#setPartAsDefault(91c97549ed5f0a6b).("scaleTabMaterial"cxx . . $ SbName#SbName(85c52e162fed56f9).,
159 "tabPlaneScaleTabMaterial"cxx . . $ SbName#SbName(85c52e162fed56f9).);
160 setPartAsDefaultcxx . . $ SoInteractionKit#setPartAsDefault(91c97549ed5f0a6b).("scaleTabHints"cxx . . $ SbName#SbName(85c52e162fed56f9)., "tabPlaneScaleTabHints"cxx . . $ SbName#SbName(85c52e162fed56f9).);
161
162 // Initialize the materialBinding part
163 SoMaterialBindingcxx . . $ SoMaterialBinding# *mb = new SoMaterialBindingcxx . . $ SoMaterialBinding#;
164 mb->valuecxx . . $ SoMaterialBinding#value. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). SoMaterialBindingcxx . . $ SoMaterialBinding#::OVERALLcxx . . $ SoMaterialBinding#OVERALL.;
165 setAnyPartAsDefaultcxx . . $ SoInteractionKit#setAnyPartAsDefault(bc3f6e8612baeae6).("scaleTabMaterialBinding"cxx . . $ SbName#SbName(85c52e162fed56f9)., mb );
166
167 // Initialize the normalBinding part
168 SoNormalBindingcxx . . $ SoNormalBinding# *nb = new SoNormalBindingcxx . . $ SoNormalBinding#;
169 nb->valuecxx . . $ SoNormalBinding#value. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). SoNormalBindingcxx . . $ SoNormalBinding#::OVERALLcxx . . $ SoNormalBinding#OVERALL.;
170 setAnyPartAsDefaultcxx . . $ SoInteractionKit#setAnyPartAsDefault(bc3f6e8612baeae6).("scaleTabNormalBinding"cxx . . $ SbName#SbName(85c52e162fed56f9)., nb );
171
172 // Initialize the normal part
173 SoNormalcxx . . $ SoNormal# *nrm = new SoNormalcxx . . $ SoNormal#;
174 nrm->vectorcxx . . $ SoNormal#vector. =cxx . . $ SoMFVec3f#`operator=`(861f7885f8980b32). SbVec3fcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).( 0, 0, 1);
175 setAnyPartAsDefaultcxx . . $ SoInteractionKit#setAnyPartAsDefault(bc3f6e8612baeae6).("scaleTabNormal"cxx . . $ SbName#SbName(85c52e162fed56f9)., nrm );
176
177 // Initialize the coordinate nodes.
178 SbVec3fcxx . . $ SbVec3f# *pts;
179 SoCoordinate3cxx . . $ SoCoordinate3# *crdn;
180
181 crdn = SO_GET_ANY_PARTcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoBaseKit.h:424:9`!(this,"edgeScaleCoords", SoCoordinate3);
182 crdn->pointcxx . . $ SoCoordinate3#point..setNumcxx . . $ SoMField#setNum(d4f767463ce0a6b3).(16);
183 pts = crdn->pointcxx . . $ SoCoordinate3#point..startEditingcxx . . $ SoMFVec3f#startEditing(d7218d170b8c46e1).();
184 pts[0].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -.1, .9, .002);
185 pts[1].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( .1, .9, .002);
186 pts[2].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( .1, 1, .002);
187 pts[3].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -.1, 1, .002);
188 pts[4].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -.1, -1, .002);
189 pts[5].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( .1, -1, .002);
190 pts[6].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( .1, -.9, .002);
191 pts[7].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -.1, -.9, .002);
192 pts[8].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( .9, -.1, .002);
193 pts[9].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 1, -.1, .002);
194 pts[10].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 1, .1, .002);
195 pts[11].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( .9, .1, .002);
196 pts[12].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(-1, -.1, .002);
197 pts[13].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -.9, -.1, .002);
198 pts[14].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -.9, .1, .002);
199 pts[15].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(-1, .1, .002);
200 crdn->pointcxx . . $ SoCoordinate3#point..finishEditingcxx . . $ SoMFVec3f#finishEditing(49f6e7a06ebc5aa8).();
201
202 crdn = SO_GET_ANY_PARTcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoBaseKit.h:424:9`!(this,"cornerScaleCoords", SoCoordinate3);
203 crdn->pointcxx . . $ SoCoordinate3#point..setNumcxx . . $ SoMField#setNum(d4f767463ce0a6b3).(16);
204 pts = crdn->pointcxx . . $ SoCoordinate3#point..startEditingcxx . . $ SoMFVec3f#startEditing(d7218d170b8c46e1).();
205 pts[0].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( .9, .9, .002);
206 pts[1].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 1, .9, .002);
207 pts[2].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 1, 1, .002);
208 pts[3].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( .9, 1, .002);
209 pts[4].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( .9, -1, .002);
210 pts[5].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 1, -1, .002);
211 pts[6].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 1, -.9, .002);
212 pts[7].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( .9, -.9, .002);
213 pts[8].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -1, -1, .002);
214 pts[9].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -.9, -1, .002);
215 pts[10].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -.9, -.9, .002);
216 pts[11].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -1, -.9, .002);
217 pts[12].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -1, .9, .002);
218 pts[13].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -.9, .9, .002);
219 pts[14].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -.9, 1, .002);
220 pts[15].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -1, 1, .002);
221 crdn->pointcxx . . $ SoCoordinate3#point..finishEditingcxx . . $ SoMFVec3f#finishEditing(49f6e7a06ebc5aa8).();
222
223 // Initialize the indexed face set nodes
224 int32_t *inds;
225 SoIndexedFaceSetcxx . . $ SoIndexedFaceSet# *fsn;
226
227 fsn = new SoIndexedFaceSetcxx . . $ SoIndexedFaceSet#;
228 fsn->coordIndexcxx . . $ SoIndexedShape#coordIndex..setNumcxx . . $ SoMField#setNum(d4f767463ce0a6b3).(5);
229 inds = fsn->coordIndexcxx . . $ SoIndexedShape#coordIndex..startEditingcxx . . $ SoMFInt32#startEditing(a7741f82f5fc3640).();
230 inds[0] = 0;
231 inds[1] = 1;
232 inds[2] = 2;
233 inds[3] = 3;
234 inds[4] = -1;
235 fsn->coordIndexcxx . . $ SoIndexedShape#coordIndex..finishEditingcxx . . $ SoMFInt32#finishEditing(49f6e7a06ebc5aa8).();
236 setAnyPartAsDefaultcxx . . $ SoInteractionKit#setAnyPartAsDefault(bc3f6e8612baeae6).("edgeScaleTab0"cxx . . $ SbName#SbName(85c52e162fed56f9)., fsn );
237 setAnyPartAsDefaultcxx . . $ SoInteractionKit#setAnyPartAsDefault(bc3f6e8612baeae6).("cornerScaleTab0"cxx . . $ SbName#SbName(85c52e162fed56f9)., fsn->copycxx . . $ SoNode#copy(fd675789997d09c2).() );
238
239 fsn = new SoIndexedFaceSetcxx . . $ SoIndexedFaceSet#;
240 fsn->coordIndexcxx . . $ SoIndexedShape#coordIndex..setNumcxx . . $ SoMField#setNum(d4f767463ce0a6b3).(5);
241 inds = fsn->coordIndexcxx . . $ SoIndexedShape#coordIndex..startEditingcxx . . $ SoMFInt32#startEditing(a7741f82f5fc3640).();
242 inds[0] = 4;
243 inds[1] = 5;
244 inds[2] = 6;
245 inds[3] = 7;
246 inds[4] = -1;
247 fsn->coordIndexcxx . . $ SoIndexedShape#coordIndex..finishEditingcxx . . $ SoMFInt32#finishEditing(49f6e7a06ebc5aa8).();
248 setAnyPartAsDefaultcxx . . $ SoInteractionKit#setAnyPartAsDefault(bc3f6e8612baeae6).("edgeScaleTab1"cxx . . $ SbName#SbName(85c52e162fed56f9)., fsn );
249 setAnyPartAsDefaultcxx . . $ SoInteractionKit#setAnyPartAsDefault(bc3f6e8612baeae6).("cornerScaleTab1"cxx . . $ SbName#SbName(85c52e162fed56f9)., fsn->copycxx . . $ SoNode#copy(fd675789997d09c2).() );
250
251 fsn = new SoIndexedFaceSetcxx . . $ SoIndexedFaceSet#;
252 fsn->coordIndexcxx . . $ SoIndexedShape#coordIndex..setNumcxx . . $ SoMField#setNum(d4f767463ce0a6b3).(5);
253 inds = fsn->coordIndexcxx . . $ SoIndexedShape#coordIndex..startEditingcxx . . $ SoMFInt32#startEditing(a7741f82f5fc3640).();
254 inds[0] = 8;
255 inds[1] = 9;
256 inds[2] = 10;
257 inds[3] = 11;
258 inds[4] = -1;
259 fsn->coordIndexcxx . . $ SoIndexedShape#coordIndex..finishEditingcxx . . $ SoMFInt32#finishEditing(49f6e7a06ebc5aa8).();
260 setAnyPartAsDefaultcxx . . $ SoInteractionKit#setAnyPartAsDefault(bc3f6e8612baeae6).("edgeScaleTab2"cxx . . $ SbName#SbName(85c52e162fed56f9)., fsn );
261 setAnyPartAsDefaultcxx . . $ SoInteractionKit#setAnyPartAsDefault(bc3f6e8612baeae6).("cornerScaleTab2"cxx . . $ SbName#SbName(85c52e162fed56f9)., fsn->copycxx . . $ SoNode#copy(fd675789997d09c2).() );
262
263 fsn = new SoIndexedFaceSetcxx . . $ SoIndexedFaceSet#;
264 fsn->coordIndexcxx . . $ SoIndexedShape#coordIndex..setNumcxx . . $ SoMField#setNum(d4f767463ce0a6b3).(5);
265 inds = fsn->coordIndexcxx . . $ SoIndexedShape#coordIndex..startEditingcxx . . $ SoMFInt32#startEditing(a7741f82f5fc3640).();
266 inds[0] = 12;
267 inds[1] = 13;
268 inds[2] = 14;
269 inds[3] = 15;
270 inds[4] = -1;
271 fsn->coordIndexcxx . . $ SoIndexedShape#coordIndex..finishEditingcxx . . $ SoMFInt32#finishEditing(49f6e7a06ebc5aa8).();
272 setAnyPartAsDefaultcxx . . $ SoInteractionKit#setAnyPartAsDefault(bc3f6e8612baeae6).("edgeScaleTab3"cxx . . $ SbName#SbName(85c52e162fed56f9)., fsn );
273 setAnyPartAsDefaultcxx . . $ SoInteractionKit#setAnyPartAsDefault(bc3f6e8612baeae6).("cornerScaleTab3"cxx . . $ SbName#SbName(85c52e162fed56f9)., fsn->copycxx . . $ SoNode#copy(fd675789997d09c2).() );
274
275
276 // Set the switch to display everything under it...
277 SoSwitchcxx . . $ SoSwitch# *sw = SO_GET_ANY_PARTcxx . . $ `lib/nodekits/include/Inventor/nodekits/SoBaseKit.h:424:9`!(this,"planeSwitch",SoSwitch);
278 setSwitchValuecxx . . $ SoInteractionKit#setSwitchValue(de18c6a3dadfdca6).( sw, SO_SWITCH_ALLcxx . . $ `lib/database/include/Inventor/nodes/SoSwitch.h:77:9`!);
279
280 // Create the projectors
281 lineProjcxx . . $ SoTabPlaneDragger#lineProj. = new SbLineProjectorcxx . . $ SbLineProjector#();
282 planeProjcxx . . $ SoTabPlaneDragger#planeProj. = new SbPlaneProjectorcxx . . $ SbPlaneProjector#();
283
284 // add the callbacks to perform the dragging
285 addStartCallbackcxx . . $ SoDragger#addStartCallback(5d3f11b67c4aec04).( &SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::startCBcxx . . $ SoTabPlaneDragger#startCB(7027446dc0b7318f). );
286 addMotionCallbackcxx . . $ SoDragger#addMotionCallback(5d3f11b67c4aec04).( &SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::motionCBcxx . . $ SoTabPlaneDragger#motionCB(7027446dc0b7318f). );
287 addFinishCallbackcxx . . $ SoDragger#addFinishCallback(5d3f11b67c4aec04).( &SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::finishCBcxx . . $ SoTabPlaneDragger#finishCB(7027446dc0b7318f). );
288
289 // add the callback to update things each time a meta key changes.
290 addOtherEventCallbackcxx . . $ SoDragger#addOtherEventCallback(5d3f11b67c4aec04).( &SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::metaKeyChangeCBcxx . . $ SoTabPlaneDragger#metaKeyChangeCB(7027446dc0b7318f). );
291
292 // Updates the translation and scale fields when the motionMatrix is set.
293 addValueChangedCallbackcxx . . $ SoDragger#addValueChangedCallback(5d3f11b67c4aec04).( &SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::valueChangedCBcxx . . $ SoTabPlaneDragger#valueChangedCB(7027446dc0b7318f). );
294
295 // Updates the motionMatrix when the translationFactor field is set.
296 translFieldSensorcxx . . $ SoTabPlaneDragger#translFieldSensor.
297 = new SoFieldSensorcxx . . $ SoFieldSensor#( &SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::fieldSensorCBcxx . . $ SoTabPlaneDragger#fieldSensorCB(c8d298b3e215c027)., this);
298 translFieldSensorcxx . . $ SoTabPlaneDragger#translFieldSensor.->setPrioritycxx . . $ SoDelayQueueSensor#setPriority(cb2f890c2fdad230).( 0 );
299
300 // Updates the motionMatrix when the scaleFactor field is set.
301 scaleFieldSensorcxx . . $ SoTabPlaneDragger#scaleFieldSensor.
302 = new SoFieldSensorcxx . . $ SoFieldSensor#( &SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::fieldSensorCBcxx . . $ SoTabPlaneDragger#fieldSensorCB(c8d298b3e215c027)., this);
303 scaleFieldSensorcxx . . $ SoTabPlaneDragger#scaleFieldSensor.->setPrioritycxx . . $ SoDelayQueueSensor#setPriority(cb2f890c2fdad230).( 0 );
304
305 currentStatecxx . . $ SoTabPlaneDragger#currentState. = INACTIVEcxx . . $ SoTabPlaneDragger#INACTIVE.;
306 restartStatecxx . . $ SoTabPlaneDragger#restartState. = INACTIVEcxx . . $ SoTabPlaneDragger#INACTIVE.;
307 adjustScaleTabSizecxx . . $ SoTabPlaneDragger#adjustScaleTabSize(49f6e7a06ebc5aa8).();
308
309 setUpConnectionscxx . . $ SoTabPlaneDragger#setUpConnections(9b79fb6aee4c0440).( TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`! );
310 }
311
312 ////////////////////////////////////////////////////////////////////////
313 //
314 // Description:
315 // Destructor
316 //
317 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::~cxx . . $ SoTabPlaneDragger#`~SoTabPlaneDragger`(49f6e7a06ebc5aa8).SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#()
318 //
319 ////////////////////////////////////////////////////////////////////////
320 {
321 delete lineProjcxx . . $ SoTabPlaneDragger#lineProj.;
322 delete planeProjcxx . . $ SoTabPlaneDragger#planeProj.;
323
324 if (translFieldSensorcxx . . $ SoTabPlaneDragger#translFieldSensor.)
325 delete translFieldSensorcxx . . $ SoTabPlaneDragger#translFieldSensor.;
326 if (scaleFieldSensorcxx . . $ SoTabPlaneDragger#scaleFieldSensor.)
327 delete scaleFieldSensorcxx . . $ SoTabPlaneDragger#scaleFieldSensor.;
328 }
329
330 // detach/attach any sensors, callbacks, and/or field connections.
331 // Called by: start/end of SoBaseKit::readInstance
332 // and on new copy by: start/end of SoBaseKit::copy.
333 // Classes that redefine must call setUpConnections(TRUE,TRUE)
334 // at end of constructor.
335 // Returns the state of the node when this was called.
336 SbBoolcxx . . $ SbBool#
337 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::setUpConnectionscxx . . $ SoTabPlaneDragger#setUpConnections(9b79fb6aee4c0440).( SbBoolcxx . . $ SbBool# onOff, SbBoolcxx . . $ SbBool# doItAlways )
338 {
339 if ( !doItAlways && connectionsSetUpcxx . . $ SoBaseKit#connectionsSetUp. == onOff)
340 return onOff;
341
342 if ( onOff ) {
343
344 // We connect AFTER base class.
345 SoDraggercxx . . $ SoDragger#::setUpConnectionscxx . . $ SoInteractionKit#setUpConnections(9b79fb6aee4c0440).( onOff, FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
346
347 // Call the sensor CBs to make things are up-to-date.
348 fieldSensorCBcxx . . $ SoTabPlaneDragger#fieldSensorCB(c8d298b3e215c027).( this, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! );
349
350 // Connect the field sensors
351 if (translFieldSensorcxx . . $ SoTabPlaneDragger#translFieldSensor.->getAttachedFieldcxx . . $ SoFieldSensor#getAttachedField(c4a4d937024b6702).() != &translationcxx . . $ SoTabPlaneDragger#translation.)
352 translFieldSensorcxx . . $ SoTabPlaneDragger#translFieldSensor.->attachcxx . . $ SoFieldSensor#attach(6a35cc9f7090653f).( &translationcxx . . $ SoTabPlaneDragger#translation. );
353 if (scaleFieldSensorcxx . . $ SoTabPlaneDragger#scaleFieldSensor.->getAttachedFieldcxx . . $ SoFieldSensor#getAttachedField(c4a4d937024b6702).() != &scaleFactorcxx . . $ SoTabPlaneDragger#scaleFactor.)
354 scaleFieldSensorcxx . . $ SoTabPlaneDragger#scaleFieldSensor.->attachcxx . . $ SoFieldSensor#attach(6a35cc9f7090653f).( &scaleFactorcxx . . $ SoTabPlaneDragger#scaleFactor. );
355 }
356 else {
357
358 // We disconnect BEFORE base class.
359
360 // Disconnect the field sensors.
361 if (translFieldSensorcxx . . $ SoTabPlaneDragger#translFieldSensor.->getAttachedFieldcxx . . $ SoFieldSensor#getAttachedField(c4a4d937024b6702).())
362 translFieldSensorcxx . . $ SoTabPlaneDragger#translFieldSensor.->detachcxx . . $ SoFieldSensor#detach(49f6e7a06ebc5aa8).();
363 if (scaleFieldSensorcxx . . $ SoTabPlaneDragger#scaleFieldSensor.->getAttachedFieldcxx . . $ SoFieldSensor#getAttachedField(c4a4d937024b6702).())
364 scaleFieldSensorcxx . . $ SoTabPlaneDragger#scaleFieldSensor.->detachcxx . . $ SoFieldSensor#detach(49f6e7a06ebc5aa8).();
365
366 SoDraggercxx . . $ SoDragger#::setUpConnectionscxx . . $ SoInteractionKit#setUpConnections(9b79fb6aee4c0440).( onOff, FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! );
367 }
368
369 return !(connectionsSetUpcxx . . $ SoBaseKit#connectionsSetUp. = onOff);
370 }
371
372 ////////////////////////////////////////////////////////////////////////
373 //
374 // Description:
375 // Move the tabPlaneDragger based on mouse motion.
376 //
377 // Use: private
378 //
379 void
380 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::dragStartcxx . . $ SoTabPlaneDragger#dragStart(49f6e7a06ebc5aa8).()
381 //
382 ////////////////////////////////////////////////////////////////////////
383 {
384 const SoPathcxx . . $ SoPath# *pickPath = getPickPathcxx . . $ SoDragger#getPickPath(d41edb2b63dda406).();
385
386 currentStatecxx . . $ SoTabPlaneDragger#currentState. = INACTIVEcxx . . $ SoTabPlaneDragger#INACTIVE.;
387 shftDowncxx . . $ SoTabPlaneDragger#shftDown. = getEventcxx . . $ SoDragger#getEvent(c30b8bbf6163e0e4).()->wasShiftDowncxx . . $ SoEvent#wasShiftDown(455f465bc33b4cdf).();
388
389 if (restartStatecxx . . $ SoTabPlaneDragger#restartState. != INACTIVEcxx . . $ SoTabPlaneDragger#INACTIVE. ) {
390 currentStatecxx . . $ SoTabPlaneDragger#currentState. = restartStatecxx . . $ SoTabPlaneDragger#restartState.;
391 }
392 else if (pickPath && pickPath->containsNodecxx . . $ SoPath#containsNode(25d228eba4c5059a).(translatorcxx . . $ SoTabPlaneDragger#translator..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).()) ||
393 getSurrogatePartPickedNamecxx . . $ SoDragger#getSurrogatePartPickedName(96f83ea34e3884f5).() ==cxx . . $ `operator==`(1deca42c6f82b65f). "translator" ) {
394 currentStatecxx . . $ SoTabPlaneDragger#currentState. = TRANSLATINGcxx . . $ SoTabPlaneDragger#TRANSLATING.;
395 }
396 else if ( pickPath && pickPath->containsNodecxx . . $ SoPath#containsNode(25d228eba4c5059a).( scaleTabscxx . . $ SoTabPlaneDragger#scaleTabs..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).() )) {
397
398 if (pickPath->containsNodecxx . . $ SoPath#containsNode(25d228eba4c5059a).( edgeScaleTab0cxx . . $ SoTabPlaneDragger#edgeScaleTab0..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).()) ) {
399 currentScalePatchcxx . . $ SoTabPlaneDragger#currentScalePatch. = 0;
400 currentStatecxx . . $ SoTabPlaneDragger#currentState. = EDGE_SCALINGcxx . . $ SoTabPlaneDragger#EDGE_SCALING.;
401 }
402 else if (pickPath->containsNodecxx . . $ SoPath#containsNode(25d228eba4c5059a).( edgeScaleTab1cxx . . $ SoTabPlaneDragger#edgeScaleTab1..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).()) ) {
403 currentScalePatchcxx . . $ SoTabPlaneDragger#currentScalePatch. = 1;
404 currentStatecxx . . $ SoTabPlaneDragger#currentState. = EDGE_SCALINGcxx . . $ SoTabPlaneDragger#EDGE_SCALING.;
405 }
406 else if (pickPath->containsNodecxx . . $ SoPath#containsNode(25d228eba4c5059a).( edgeScaleTab2cxx . . $ SoTabPlaneDragger#edgeScaleTab2..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).()) ) {
407 currentScalePatchcxx . . $ SoTabPlaneDragger#currentScalePatch. = 2;
408 currentStatecxx . . $ SoTabPlaneDragger#currentState. = EDGE_SCALINGcxx . . $ SoTabPlaneDragger#EDGE_SCALING.;
409 }
410 else if (pickPath->containsNodecxx . . $ SoPath#containsNode(25d228eba4c5059a).( edgeScaleTab3cxx . . $ SoTabPlaneDragger#edgeScaleTab3..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).()) ) {
411 currentScalePatchcxx . . $ SoTabPlaneDragger#currentScalePatch. = 3;
412 currentStatecxx . . $ SoTabPlaneDragger#currentState. = EDGE_SCALINGcxx . . $ SoTabPlaneDragger#EDGE_SCALING.;
413 }
414 else if (pickPath->containsNodecxx . . $ SoPath#containsNode(25d228eba4c5059a).( cornerScaleTab0cxx . . $ SoTabPlaneDragger#cornerScaleTab0..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).()) ) {
415 currentScalePatchcxx . . $ SoTabPlaneDragger#currentScalePatch. = 0;
416 currentStatecxx . . $ SoTabPlaneDragger#currentState. = CORNER_SCALINGcxx . . $ SoTabPlaneDragger#CORNER_SCALING.;
417 }
418 else if (pickPath->containsNodecxx . . $ SoPath#containsNode(25d228eba4c5059a).( cornerScaleTab1cxx . . $ SoTabPlaneDragger#cornerScaleTab1..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).()) ) {
419 currentScalePatchcxx . . $ SoTabPlaneDragger#currentScalePatch. = 1;
420 currentStatecxx . . $ SoTabPlaneDragger#currentState. = CORNER_SCALINGcxx . . $ SoTabPlaneDragger#CORNER_SCALING.;
421 }
422 else if (pickPath->containsNodecxx . . $ SoPath#containsNode(25d228eba4c5059a).( cornerScaleTab2cxx . . $ SoTabPlaneDragger#cornerScaleTab2..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).()) ) {
423 currentScalePatchcxx . . $ SoTabPlaneDragger#currentScalePatch. = 2;
424 currentStatecxx . . $ SoTabPlaneDragger#currentState. = CORNER_SCALINGcxx . . $ SoTabPlaneDragger#CORNER_SCALING.;
425 }
426 else if (pickPath->containsNodecxx . . $ SoPath#containsNode(25d228eba4c5059a).( cornerScaleTab3cxx . . $ SoTabPlaneDragger#cornerScaleTab3..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).()) ) {
427 currentScalePatchcxx . . $ SoTabPlaneDragger#currentScalePatch. = 3;
428 currentStatecxx . . $ SoTabPlaneDragger#currentState. = CORNER_SCALINGcxx . . $ SoTabPlaneDragger#CORNER_SCALING.;
429 }
430
431 if ( currentStatecxx . . $ SoTabPlaneDragger#currentState. == CORNER_SCALINGcxx . . $ SoTabPlaneDragger#CORNER_SCALING. && shftDowncxx . . $ SoTabPlaneDragger#shftDown. )
432 currentStatecxx . . $ SoTabPlaneDragger#currentState. = UNIFORM_SCALINGcxx . . $ SoTabPlaneDragger#UNIFORM_SCALING.;
433 }
434
435 if (currentStatecxx . . $ SoTabPlaneDragger#currentState. == TRANSLATINGcxx . . $ SoTabPlaneDragger#TRANSLATING. )
436 translateStartcxx . . $ SoTabPlaneDragger#translateStart(49f6e7a06ebc5aa8).();
437 else if (currentStatecxx . . $ SoTabPlaneDragger#currentState. == EDGE_SCALINGcxx . . $ SoTabPlaneDragger#EDGE_SCALING. )
438 edgeScaleStartcxx . . $ SoTabPlaneDragger#edgeScaleStart(49f6e7a06ebc5aa8).();
439 else if (currentStatecxx . . $ SoTabPlaneDragger#currentState. == CORNER_SCALINGcxx . . $ SoTabPlaneDragger#CORNER_SCALING. )
440 cornerScaleStartcxx . . $ SoTabPlaneDragger#cornerScaleStart(49f6e7a06ebc5aa8).();
441 else if (currentStatecxx . . $ SoTabPlaneDragger#currentState. == UNIFORM_SCALINGcxx . . $ SoTabPlaneDragger#UNIFORM_SCALING. )
442 scaleUniformStartcxx . . $ SoTabPlaneDragger#scaleUniformStart(49f6e7a06ebc5aa8).();
443 }
444
445 ////////////////////////////////////////////////////////////////////////
446 //
447 // Description:
448 //
449 // Use: private
450 //
451 void
452 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::dragcxx . . $ SoTabPlaneDragger#drag(49f6e7a06ebc5aa8).()
453 //
454 ////////////////////////////////////////////////////////////////////////
455 {
456 if ( currentStatecxx . . $ SoTabPlaneDragger#currentState. == TRANSLATINGcxx . . $ SoTabPlaneDragger#TRANSLATING. )
457 translateDragcxx . . $ SoTabPlaneDragger#translateDrag(49f6e7a06ebc5aa8).();
458 else if ( currentStatecxx . . $ SoTabPlaneDragger#currentState. == EDGE_SCALINGcxx . . $ SoTabPlaneDragger#EDGE_SCALING. )
459 edgeScaleDragcxx . . $ SoTabPlaneDragger#edgeScaleDrag(49f6e7a06ebc5aa8).();
460 else if ( currentStatecxx . . $ SoTabPlaneDragger#currentState. == CORNER_SCALINGcxx . . $ SoTabPlaneDragger#CORNER_SCALING. )
461 cornerScaleDragcxx . . $ SoTabPlaneDragger#cornerScaleDrag(49f6e7a06ebc5aa8).();
462 else if ( currentStatecxx . . $ SoTabPlaneDragger#currentState. == UNIFORM_SCALINGcxx . . $ SoTabPlaneDragger#UNIFORM_SCALING. )
463 scaleUniformDragcxx . . $ SoTabPlaneDragger#scaleUniformDrag(49f6e7a06ebc5aa8).();
464 }
465
466 ////////////////////////////////////////////////////////////////////////
467 //
468 // Description:
469 //
470 // Use: private
471 //
472 void
473 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::dragFinishcxx . . $ SoTabPlaneDragger#dragFinish(49f6e7a06ebc5aa8).()
474 //
475 ////////////////////////////////////////////////////////////////////////
476 {
477 // turn off highlighting and adjust scale tabs
478 currentStatecxx . . $ SoTabPlaneDragger#currentState. = INACTIVEcxx . . $ SoTabPlaneDragger#INACTIVE.;
479 restartStatecxx . . $ SoTabPlaneDragger#restartState. = INACTIVEcxx . . $ SoTabPlaneDragger#INACTIVE.;
480 adjustScaleTabSizecxx . . $ SoTabPlaneDragger#adjustScaleTabSize(49f6e7a06ebc5aa8).();
481 }
482
483 ////////////////////////////////////////////////////////////////////////
484 //
485 // Description:
486 // Initializes for motion
487 //
488 void
489 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::translateStartcxx . . $ SoTabPlaneDragger#translateStart(49f6e7a06ebc5aa8).()
490 //
491 ////////////////////////////////////////////////////////////////////////
492 {
493 // This is the point we'll use if a metaKey callback makes us re-start.
494 worldRestartPtcxx . . $ SoTabPlaneDragger#worldRestartPt. =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). getWorldStartingPointcxx . . $ SoDragger#getWorldStartingPoint(42d43ea8522fe3bf).();
495
496 // Establish the projector line in local space.
497 SbVec3fcxx . . $ SbVec3f# startLocalHitPt = getLocalStartingPointcxx . . $ SoDragger#getLocalStartingPoint(42d43ea8522fe3bf).();
498
499 SbVec3fcxx . . $ SbVec3f# planeNormalcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(0,0,1);
500 planeProjcxx . . $ SoTabPlaneDragger#planeProj.->setPlanecxx . . $ SbPlaneProjector#setPlane(b57880e1f0abeb65).( SbPlanecxx . . $ SbPlane#SbPlane(d696704770a33d8f).( planeNormal, startLocalHitPt ) );
501
502 // as of yet, translation direction (for 1-D translating) is undefined.
503 translateDircxx . . $ SoTabPlaneDragger#translateDir. = -1;
504 }
505
506 ////////////////////////////////////////////////////////////////////////
507 //
508 void
509 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::translateDragcxx . . $ SoTabPlaneDragger#translateDrag(49f6e7a06ebc5aa8).()
510 //
511 ////////////////////////////////////////////////////////////////////////
512 {
513 if (shftDowncxx . . $ SoTabPlaneDragger#shftDown. && ! isAdequateConstraintMotioncxx . . $ SoDragger#isAdequateConstraintMotion(b126dc7c1de90089).())
514 return;
515
516 // Get startHitPt in local space.
517 SbVec3fcxx . . $ SbVec3f# startHitPt = getLocalStartingPointcxx . . $ SoDragger#getLocalStartingPoint(42d43ea8522fe3bf).();;
518
519 // Calculate intersection with plane projector.
520 // Find mouse hit on plane currently in use...
521 planeProjcxx . . $ SoTabPlaneDragger#planeProj.->setViewVolumecxx . . $ SbProjector#setViewVolume(187982bfa537c808).( getViewVolumecxx . . $ SoDragger#getViewVolume(ee52a61c9e3934e6).() );
522 planeProjcxx . . $ SoTabPlaneDragger#planeProj.->setWorkingSpacecxx . . $ SbProjector#setWorkingSpace(37d2f951b3ffd7a6).( getLocalToWorldMatrixcxx . . $ SoDragger#getLocalToWorldMatrix(2db31fc6bbb60646).() );
523 SbVec3fcxx . . $ SbVec3f# newHitPt
524 = planeProjcxx . . $ SoTabPlaneDragger#planeProj.->projectcxx . . $ SbPlaneProjector#project(52e93d88cc4c3965).(getNormalizedLocaterPositioncxx . . $ SoDragger#getNormalizedLocaterPosition(e67d94fc922bbbd4).());
525
526 // If we need to start a new gesture, we'll carry on from this pt.
527 getLocalToWorldMatrixcxx . . $ SoDragger#getLocalToWorldMatrix(2db31fc6bbb60646).().multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).( newHitPt, worldRestartPtcxx . . $ SoTabPlaneDragger#worldRestartPt.);
528
529 // find the difference between current and previous intersections.
530 SbVec3fcxx . . $ SbVec3f# localMotion = newHitPt -cxx . . $ operator-(af63bf8d0639b76b). startHitPt;
531
532 if ( !shftDowncxx . . $ SoTabPlaneDragger#shftDown. )
533 // constrainKey not down. Clear the 1-D translation dir.
534 translateDircxx . . $ SoTabPlaneDragger#translateDir. = -1;
535 else {
536 // the constrain key is pressed. This means 1-D translation.
537 if ( translateDircxx . . $ SoTabPlaneDragger#translateDir. == -1 ) {
538 // The 1-D direction is not defined. Calculate it
539 // based on which direction got the maximum locater motion.
540 if ( _ABScxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:87:9`!( localMotion[0]) > _ABScxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:87:9`!( localMotion[1])
541 && _ABScxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:87:9`!( localMotion[0]) > _ABScxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:87:9`!( localMotion[2]) )
542 translateDircxx . . $ SoTabPlaneDragger#translateDir. = 0;
543 else if ( _ABScxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:87:9`!( localMotion[1]) > _ABScxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:87:9`!( localMotion[2]) )
544 translateDircxx . . $ SoTabPlaneDragger#translateDir. = 1;
545 else
546 translateDircxx . . $ SoTabPlaneDragger#translateDir. = 2;
547 }
548
549 // get the projection of 'localMotion' onto the preferred axis.
550 SbVec3fcxx . . $ SbVec3f# constrainedMotioncxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(0,0,0);
551 constrainedMotion[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).translateDircxx . . $ SoTabPlaneDragger#translateDir.] = localMotion[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).translateDircxx . . $ SoTabPlaneDragger#translateDir.];
552 localMotion =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). constrainedMotion;
553 }
554
555 // Append this to the startMotionMatrix, which we saved at the beginning
556 // of the drag, to find the current motion matrix.
557 setMotionMatrixcxx . . $ SoDragger#setMotionMatrix(37d2f951b3ffd7a6).(appendTranslationcxx . . $ SoDragger#appendTranslation(dddd3455b0488ad9).(getStartMotionMatrixcxx . . $ SoDragger#getStartMotionMatrix(c49c36ee78b0a89e).(),localMotion));
558
559 return;
560 }
561
562 ////////////////////////////////////////////////////////////////////////
563 //
564 void
565 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::edgeScaleStartcxx . . $ SoTabPlaneDragger#edgeScaleStart(49f6e7a06ebc5aa8).()
566 //
567 ////////////////////////////////////////////////////////////////////////
568 {
569 // This is the point we'll use if a metaKey callback makes us re-start.
570 worldRestartPtcxx . . $ SoTabPlaneDragger#worldRestartPt. =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). getWorldStartingPointcxx . . $ SoDragger#getWorldStartingPoint(42d43ea8522fe3bf).();
571
572 // Setup scale center and direction for projector line.
573 SbVec3fcxx . . $ SbVec3f# lineDircxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8).;
574 switch (currentScalePatchcxx . . $ SoTabPlaneDragger#currentScalePatch.) {
575 case 0:
576 scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 0, -1, 0 );
577 lineDir.setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 0, 1, 0);
578 break;
579 case 1:
580 scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 0, 1, 0 );
581 lineDir.setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 0, 1, 0);
582 break;
583 case 2:
584 scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -1, 0, 0 );
585 lineDir.setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 1, 0, 0);
586 break;
587 case 3:
588 scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 1, 0, 0 );
589 lineDir.setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 1, 0, 0);
590 break;
591 }
592
593 // Establish the projector line
594 SbVec3fcxx . . $ SbVec3f# startLocalHitPt = getLocalStartingPointcxx . . $ SoDragger#getLocalStartingPoint(42d43ea8522fe3bf).();
595
596 lineProjcxx . . $ SoTabPlaneDragger#lineProj.->setLinecxx . . $ SbLineProjector#setLine(40219236977e8d5e).( SbLinecxx . . $ SbLine#SbLine(d696704770a33d8f).(startLocalHitPt, startLocalHitPt +cxx . . $ operator+(af63bf8d0639b76b). lineDir));
597 }
598
599 ////////////////////////////////////////////////////////////////////////
600 void
601 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::edgeScaleDragcxx . . $ SoTabPlaneDragger#edgeScaleDrag(49f6e7a06ebc5aa8).()
602 //
603 ////////////////////////////////////////////////////////////////////////
604 {
605 lineProjcxx . . $ SoTabPlaneDragger#lineProj.->setViewVolumecxx . . $ SbProjector#setViewVolume(187982bfa537c808).( getViewVolumecxx . . $ SoDragger#getViewVolume(ee52a61c9e3934e6).() );
606 lineProjcxx . . $ SoTabPlaneDragger#lineProj.->setWorkingSpacecxx . . $ SbProjector#setWorkingSpace(37d2f951b3ffd7a6).( getLocalToWorldMatrixcxx . . $ SoDragger#getLocalToWorldMatrix(2db31fc6bbb60646).() );
607
608 SbVec3fcxx . . $ SbVec3f# startHitPt = getLocalStartingPointcxx . . $ SoDragger#getLocalStartingPoint(42d43ea8522fe3bf).();
609
610 SbVec3fcxx . . $ SbVec3f# newHitPt = lineProjcxx . . $ SoTabPlaneDragger#lineProj.->projectcxx . . $ SbLineProjector#project(52e93d88cc4c3965).( getNormalizedLocaterPositioncxx . . $ SoDragger#getNormalizedLocaterPosition(e67d94fc922bbbd4).());
611 // If we need to start a new gesture, we'll carry on from this pt.
612 getLocalToWorldMatrixcxx . . $ SoDragger#getLocalToWorldMatrix(2db31fc6bbb60646).().multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).( newHitPt, worldRestartPtcxx . . $ SoTabPlaneDragger#worldRestartPt.);
613
614 // Figure out 'delta', the amount to scale by.
615 // To do this:
616 // [1] the line we are really supposed to scale along passes through
617 // scaleCenter in the direction of our projection line.
618 // Drop a perpendicular from 'scaleCenter' to our projection line
619 // to find the origin to use in calculating change of scale.
620 SbVec3fcxx . . $ SbVec3f# projectedScaleCenter
621 = lineProjcxx . . $ SoTabPlaneDragger#lineProj.->getLinecxx . . $ SbLineProjector#getLine(ea1b170d7c045246).().getClosestPointcxx . . $ SbLine#getClosestPoint(d67ad7d0c0b29ebb).(scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter.);
622
623 // [2] Find the distance from the old and new projected points to this
624 // center.
625 SbVec3fcxx . . $ SbVec3f# oldDiff = startHitPt -cxx . . $ operator-(af63bf8d0639b76b). projectedScaleCenter;
626 SbVec3fcxx . . $ SbVec3f# newDiff = newHitPt -cxx . . $ operator-(af63bf8d0639b76b). projectedScaleCenter;
627
628 float oldDist = oldDiff.lengthcxx . . $ SbVec3f#length(5036dfe8d4170af2).();
629 float newDist = newDiff.lengthcxx . . $ SbVec3f#length(5036dfe8d4170af2).();
630
631 if ( oldDiff.dotcxx . . $ SbVec3f#dot(adcfb95606509c95).( newDiff ) < 0.0 )
632 newDist *= -1.0;
633
634 // [3] Change in scale is the ratio of newDist to oldDist
635 #define TINYcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:635:9`! 0.0001
636 float delta = ( fabs(oldDist) < TINYcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:635:9`! || fabs(newDist) < TINYcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:635:9`!)
637 ? 1.0 : newDist / oldDist;
638 #undef TINYcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:635:9`!
639
640 // Constrain the scaling to be greater than getMinScale();
641 if (delta < getMinScalecxx . . $ SoDragger#getMinScale(9b8c9e39889c762c).() )
642 delta = getMinScalecxx . . $ SoDragger#getMinScale(9b8c9e39889c762c).();
643
644 // Get the scale we want to apply. It's 'delta' in the direction of our
645 // projector line and 1 in the other directions
646 SbVec3fcxx . . $ SbVec3f# newScalingcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(1,1,1);
647 SbVec3fcxx . . $ SbVec3f# lineDir = lineProjcxx . . $ SoTabPlaneDragger#lineProj.->getLinecxx . . $ SbLineProjector#getLine(ea1b170d7c045246).().getDirectioncxx . . $ SbLine#getDirection(b5c384c15c94bb12).();
648 for (int i = 0; i < 3; i++ )
649 if (lineDir[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).i] == 1.0)
650 newScaling[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).i] = delta;
651
652 // append this to the startMotionMatrix.
653 setMotionMatrixcxx . . $ SoDragger#setMotionMatrix(37d2f951b3ffd7a6).(appendScalecxx . . $ SoDragger#appendScale(582101c4f33c2642).(getStartMotionMatrixcxx . . $ SoDragger#getStartMotionMatrix(c49c36ee78b0a89e).(),newScaling,scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter.));
654 }
655
656
657 ////////////////////////////////////////////////////////////////////////
658 //
659 void
660 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::cornerScaleStartcxx . . $ SoTabPlaneDragger#cornerScaleStart(49f6e7a06ebc5aa8).()
661 //
662 ////////////////////////////////////////////////////////////////////////
663 {
664 // This is the point we'll use if a metaKey callback makes us re-start.
665 worldRestartPtcxx . . $ SoTabPlaneDragger#worldRestartPt. =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). getWorldStartingPointcxx . . $ SoDragger#getWorldStartingPoint(42d43ea8522fe3bf).();
666
667 // Setup scale center
668 switch (currentScalePatchcxx . . $ SoTabPlaneDragger#currentScalePatch.) {
669 case 0: scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -1, -1, 0 ); break;
670 case 1: scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -1, 1, 0 ); break;
671 case 2: scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 1, 1, 0 ); break;
672 case 3: scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 1, -1, 0 ); break;
673 }
674
675 SbVec3fcxx . . $ SbVec3f# startLocalHitPt = getLocalStartingPointcxx . . $ SoDragger#getLocalStartingPoint(42d43ea8522fe3bf).();
676
677 // 2-D scaling motion within plane. Establish the projector plane
678 SbVec3fcxx . . $ SbVec3f# planeNormalcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(0,0,1);
679 planeProjcxx . . $ SoTabPlaneDragger#planeProj.->setPlanecxx . . $ SbPlaneProjector#setPlane(b57880e1f0abeb65).( SbPlanecxx . . $ SbPlane#SbPlane(d696704770a33d8f).( planeNormal, startLocalHitPt ) );
680 }
681
682 ////////////////////////////////////////////////////////////////////////
683 void
684 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::cornerScaleDragcxx . . $ SoTabPlaneDragger#cornerScaleDrag(49f6e7a06ebc5aa8).()
685 //
686 ////////////////////////////////////////////////////////////////////////
687 {
688 planeProjcxx . . $ SoTabPlaneDragger#planeProj.->setViewVolumecxx . . $ SbProjector#setViewVolume(187982bfa537c808).( getViewVolumecxx . . $ SoDragger#getViewVolume(ee52a61c9e3934e6).() );
689 planeProjcxx . . $ SoTabPlaneDragger#planeProj.->setWorkingSpacecxx . . $ SbProjector#setWorkingSpace(37d2f951b3ffd7a6).( getLocalToWorldMatrixcxx . . $ SoDragger#getLocalToWorldMatrix(2db31fc6bbb60646).() );
690
691 SbVec3fcxx . . $ SbVec3f# startHitPt = getLocalStartingPointcxx . . $ SoDragger#getLocalStartingPoint(42d43ea8522fe3bf).();
692
693 SbVec3fcxx . . $ SbVec3f# newHitPt = planeProjcxx . . $ SoTabPlaneDragger#planeProj.->projectcxx . . $ SbPlaneProjector#project(52e93d88cc4c3965).( getNormalizedLocaterPositioncxx . . $ SoDragger#getNormalizedLocaterPosition(e67d94fc922bbbd4).());
694 // If we need to start a new gesture, we'll carry on from this pt.
695 getLocalToWorldMatrixcxx . . $ SoDragger#getLocalToWorldMatrix(2db31fc6bbb60646).().multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).( newHitPt, worldRestartPtcxx . . $ SoTabPlaneDragger#worldRestartPt.);
696
697 // Figure out 'delta', the amount to scale by.
698 // To do this:
699 // [1] the plane we are really supposed to scale in passes through
700 // scaleCenter with normal of zAxis
701 // Drop perpendicular from 'scaleCenter' to projection plane
702 // to find the origin to use in calculating change of scale.
703 SbVec3fcxx . . $ SbVec3f# projectedScaleCentercxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8).;
704 SbLinecxx . . $ SbLine# lineThroughCentercxx . . $ SbLine#SbLine(d696704770a33d8f).( scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter., scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter. +cxx . . $ operator+(af63bf8d0639b76b). SbVec3fcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(0,0,1) );
705 planeProjcxx . . $ SoTabPlaneDragger#planeProj.->getPlanecxx . . $ SbPlaneProjector#getPlane(e01acef9bccbd60e).().intersectcxx . . $ SbPlane#intersect(e7f2e87438e5a6ef).(lineThroughCenter,projectedScaleCenter);
706
707 // [2] Now find the scale change in each of the x and y directions.
708 // Start by projecting each newHitPt's offset onto the two axes.
709 SbVec3fcxx . . $ SbVec3f# oldDiff = startHitPt -cxx . . $ operator-(af63bf8d0639b76b). projectedScaleCenter;
710 SbVec3fcxx . . $ SbVec3f# newDiff = newHitPt -cxx . . $ operator-(af63bf8d0639b76b). projectedScaleCenter;
711
712 // [3] Change in scale is the ratio of new to old
713 #define TINYcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:713:9`! 0.0001
714 float xAxisDelta = (_ABScxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:87:9`!(newDiff[0]) < TINYcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:713:9`! || _ABScxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:87:9`!(oldDiff[0])
715 < TINYcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:713:9`!) ? 1.0 : newDiff[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0] / oldDiff[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0];
716 float yAxisDelta = (_ABScxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:87:9`!(newDiff[1]) < TINYcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:713:9`! || _ABScxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:87:9`!(oldDiff[1])
717 < TINYcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:713:9`!) ? 1.0 : newDiff[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1] / oldDiff[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1];
718 #undef TINYcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:713:9`!
719
720 // Make sure we didn't fall below minscale
721 if ( xAxisDelta < getMinScalecxx . . $ SoDragger#getMinScale(9b8c9e39889c762c).() )
722 xAxisDelta = getMinScalecxx . . $ SoDragger#getMinScale(9b8c9e39889c762c).();
723 if ( yAxisDelta < getMinScalecxx . . $ SoDragger#getMinScale(9b8c9e39889c762c).() )
724 yAxisDelta = getMinScalecxx . . $ SoDragger#getMinScale(9b8c9e39889c762c).();
725
726 SbVec3fcxx . . $ SbVec3f# scaleDeltacxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).( xAxisDelta, yAxisDelta, 1 );
727
728
729 setMotionMatrixcxx . . $ SoDragger#setMotionMatrix(37d2f951b3ffd7a6).( appendScalecxx . . $ SoDragger#appendScale(582101c4f33c2642).( getStartMotionMatrixcxx . . $ SoDragger#getStartMotionMatrix(c49c36ee78b0a89e).(),
730 scaleDelta, scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter. ) );
731 }
732
733 ////////////////////////////////////////////////////////////////////////
734 //
735 void
736 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::scaleUniformStartcxx . . $ SoTabPlaneDragger#scaleUniformStart(49f6e7a06ebc5aa8).()
737 //
738 ////////////////////////////////////////////////////////////////////////
739 {
740 // This is the point we'll use if a metaKey callback makes us re-start.
741 worldRestartPtcxx . . $ SoTabPlaneDragger#worldRestartPt. =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). getWorldStartingPointcxx . . $ SoDragger#getWorldStartingPoint(42d43ea8522fe3bf).();
742
743 // We wish to scale in 2 dimensions about the corner opposite
744 // the patch that we have hit.
745 switch (currentScalePatchcxx . . $ SoTabPlaneDragger#currentScalePatch.) {
746 case 0:
747 scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -1, -1, 0);
748 break;
749 case 1:
750 scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -1, 1, 0);
751 break;
752 case 2:
753 scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 1, 1, 0);
754 break;
755 case 3:
756 scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( 1, -1, 0);
757 break;
758 }
759
760 // Find the projection line.
761 // This line should lie within the same local z-plane
762 // as the startLocalHitPt.
763 // It should pass through the startLocalHitPt.
764 // It should also pass through the point where the scaleCenter
765 // projects onto the same z-plane as the startLocalHitPt.
766 SbVec3fcxx . . $ SbVec3f# startLocalHitPt = getLocalStartingPointcxx . . $ SoDragger#getLocalStartingPoint(42d43ea8522fe3bf).();
767 SbVec3fcxx . . $ SbVec3f# zPlaneCentercxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).( scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter.[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0], scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter.[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1], startLocalHitPt[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).2]);
768 lineProjcxx . . $ SoTabPlaneDragger#lineProj.->setLinecxx . . $ SbLineProjector#setLine(40219236977e8d5e).( SbLinecxx . . $ SbLine#SbLine(d696704770a33d8f).( startLocalHitPt, zPlaneCenter ) );
769 }
770
771 ////////////////////////////////////////////////////////////////////////
772 void
773 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::scaleUniformDragcxx . . $ SoTabPlaneDragger#scaleUniformDrag(49f6e7a06ebc5aa8).()
774 //
775 ////////////////////////////////////////////////////////////////////////
776 {
777 lineProjcxx . . $ SoTabPlaneDragger#lineProj.->setViewVolumecxx . . $ SbProjector#setViewVolume(187982bfa537c808).( getViewVolumecxx . . $ SoDragger#getViewVolume(ee52a61c9e3934e6).() );
778 lineProjcxx . . $ SoTabPlaneDragger#lineProj.->setWorkingSpacecxx . . $ SbProjector#setWorkingSpace(37d2f951b3ffd7a6).( getLocalToWorldMatrixcxx . . $ SoDragger#getLocalToWorldMatrix(2db31fc6bbb60646).() );
779
780 SbVec3fcxx . . $ SbVec3f# startHitPt = getLocalStartingPointcxx . . $ SoDragger#getLocalStartingPoint(42d43ea8522fe3bf).();
781
782 SbVec3fcxx . . $ SbVec3f# newHitPt = lineProjcxx . . $ SoTabPlaneDragger#lineProj.->projectcxx . . $ SbLineProjector#project(52e93d88cc4c3965).( getNormalizedLocaterPositioncxx . . $ SoDragger#getNormalizedLocaterPosition(e67d94fc922bbbd4).());
783 // If we need to start a new gesture, we'll carry on from this pt.
784 getLocalToWorldMatrixcxx . . $ SoDragger#getLocalToWorldMatrix(2db31fc6bbb60646).().multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).( newHitPt, worldRestartPtcxx . . $ SoTabPlaneDragger#worldRestartPt.);
785
786 // [1] Find distance from old and new projected points to projectedCenter
787 // projectedCenter is zero-scale point on the lineProj.
788 SbVec3fcxx . . $ SbVec3f# projectedCenter = lineProjcxx . . $ SoTabPlaneDragger#lineProj.->getLinecxx . . $ SbLineProjector#getLine(ea1b170d7c045246).().getClosestPointcxx . . $ SbLine#getClosestPoint(d67ad7d0c0b29ebb).(scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter.);
789 SbVec3fcxx . . $ SbVec3f# oldDiff = startHitPt -cxx . . $ operator-(af63bf8d0639b76b). projectedCenter;
790 SbVec3fcxx . . $ SbVec3f# newDiff = newHitPt -cxx . . $ operator-(af63bf8d0639b76b). projectedCenter;
791
792 float oldDist = oldDiff.lengthcxx . . $ SbVec3f#length(5036dfe8d4170af2).();
793 float newDist = newDiff.lengthcxx . . $ SbVec3f#length(5036dfe8d4170af2).();
794
795 // [2] Change in scale is ratio of newDist to oldDist
796 #define TINYcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:796:9`! 0.0001
797 float delta =(oldDist < TINYcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:796:9`! || newDist < TINYcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:796:9`!) ? 1.0 : newDist/oldDist;
798 #undef TINYcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:796:9`!
799
800 // [3] Check if sign of scale changed.
801 if (oldDiff.dotcxx . . $ SbVec3f#dot(adcfb95606509c95).(newDiff) < 0 )
802 delta *= -1.0;
803
804 if ( delta < getMinScalecxx . . $ SoDragger#getMinScale(9b8c9e39889c762c).() )
805 delta = getMinScalecxx . . $ SoDragger#getMinScale(9b8c9e39889c762c).();
806
807 SbVec3fcxx . . $ SbVec3f# scaleDeltacxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).( delta, delta, delta );
808
809 setMotionMatrixcxx . . $ SoDragger#setMotionMatrix(37d2f951b3ffd7a6).( appendScalecxx . . $ SoDragger#appendScale(582101c4f33c2642).( getStartMotionMatrixcxx . . $ SoDragger#getStartMotionMatrix(c49c36ee78b0a89e).(),
810 scaleDelta, scaleCentercxx . . $ SoTabPlaneDragger#scaleCenter. ));
811 }
812
813 ////////////////////////////////////////////////////////////////////////
814 //
815 // Description:
816 // In addition to usual rendering, this dragger
817 // turns off the faces of the dragger that face away from the camera.
818 void
819 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::GLRendercxx . . $ SoTabPlaneDragger#GLRender(5c806c737f468e18).( SoGLRenderActioncxx . . $ SoGLRenderAction# *action )
820 //
821 ////////////////////////////////////////////////////////////////////////
822 {
823 if ( needScaleTabAdjustmentcxx . . $ SoTabPlaneDragger#needScaleTabAdjustment. == TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!)
824 reallyAdjustScaleTabSizecxx . . $ SoTabPlaneDragger#reallyAdjustScaleTabSize(5c806c737f468e18).(action);
825
826 SoDraggercxx . . $ SoDragger#::GLRendercxx . . $ SoBaseKit#GLRender(5c806c737f468e18).( action );
827 }
828
829 ////////////////////////////////////////////////////////////////////////
830 //
831 // Description:
832 // Adjusts the size of the scale tabs to be something reasonable in
833 // screen space.
834 //
835 ////////////////////////////////////////////////////////////////////////
836
837 #define SCREEN_TAB_SIZEcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:837:9`! 8
838
839 void
840 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::adjustScaleTabSizecxx . . $ SoTabPlaneDragger#adjustScaleTabSize(49f6e7a06ebc5aa8).()
841 {
842 needScaleTabAdjustmentcxx . . $ SoTabPlaneDragger#needScaleTabAdjustment. = TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!;
843 // This forces a redraw, so any caches containing this will be broken
844 touchcxx . . $ SoBase#touch(49f6e7a06ebc5aa8).();
845 }
846
847 void
848 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::reallyAdjustScaleTabSizecxx . . $ SoTabPlaneDragger#reallyAdjustScaleTabSize(5c806c737f468e18).(SoGLRenderActioncxx . . $ SoGLRenderAction# *action)
849 {
850 // If the viewport size is still (1,1) or (0,0) then the
851 // Window we are in has not yet been mapped and realized.
852 // So we need to just return and wait until next time.
853 if ( action == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! )
854 return;
855 SoStatecxx . . $ SoState# *state = action->getStatecxx . . $ SoAction#getState(5c8eb8fe6550a03).();
856 const SbVec2scxx . . $ SbVec2s# &vpSize
857 = SoViewportRegionElementcxx . . $ SoViewportRegionElement#::getcxx . . $ SoViewportRegionElement#get(862cff51521dc30e).(state).getViewportSizePixelscxx . . $ SbViewportRegion#getViewportSizePixels(f469ede4e6b056fc).();
858 if (vpSize[cxx . . $ SbVec2s#`operator[]`(1e601d28ecbc4f85).0] < 2 || vpSize[cxx . . $ SbVec2s#`operator[]`(1e601d28ecbc4f85).1] < 2)
859 return;
860
861 needScaleTabAdjustmentcxx . . $ SoTabPlaneDragger#needScaleTabAdjustment. = FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!;
862
863 setCameraInfocxx . . $ SoDragger#setCameraInfo(967167263c8a77b7).( action );
864 setTempPathToThiscxx . . $ SoDragger#setTempPathToThis(d28825413bd51af8).( action->getCurPathcxx . . $ SoAction#getCurPath(10165cdcf501ddd2).() );
865
866 SbMatrixcxx . . $ SbMatrix# localToWorld = getLocalToWorldMatrixcxx . . $ SoDragger#getLocalToWorldMatrix(2db31fc6bbb60646).();
867 SbMatrixcxx . . $ SbMatrix# viewMat = SoViewingMatrixElementcxx . . $ SoViewingMatrixElement#::getcxx . . $ SoViewingMatrixElement#get(361591dce4cd33b0).(action->getStatecxx . . $ SoAction#getState(5c8eb8fe6550a03).());
868 SbMatrixcxx . . $ SbMatrix# viewMatInv = viewMat.inversecxx . . $ SbMatrix#inverse(467bf55909e615bd).();
869 SbMatrixcxx . . $ SbMatrix# projMat = SoProjectionMatrixElementcxx . . $ SoProjectionMatrixElement#::getcxx . . $ SoProjectionMatrixElement#get(361591dce4cd33b0).(action->getStatecxx . . $ SoAction#getState(5c8eb8fe6550a03).());
870 SbMatrixcxx . . $ SbMatrix# lclToScr = localToWorld *cxx . . $ `operator*`(adcbd3b4d8f7ce57). viewMat *cxx . . $ `operator*`(adcbd3b4d8f7ce57). projMat;
871
872 // This will give the length of the x and y axes,
873 // each axis going from -1 to +1.
874 SbVec2fcxx . . $ SbVec2f# screenLengthscxx . . $ SbVec2f#SbVec2f(49f6e7a06ebc5aa8).;
875 getXYScreenLengthscxx . . $ SoTabPlaneDragger#getXYScreenLengths(d3fc8848d79b9788).(screenLengths,
876 lclToScr, getViewportRegioncxx . . $ SoDragger#getViewportRegion(497037bbdbaf1636).().getViewportSizePixelscxx . . $ SbViewportRegion#getViewportSizePixels(f469ede4e6b056fc).());
877
878 //
879 // Here's how big the tabs will be, in local space.
880 // The 2.0 is because the box
881 // is of width 2.
882 // Each dimension is considered separately, because they will almost
883 // always be different sizes on screen.
884 //
885 SbVec2fcxx . . $ SbVec2f# localTabSizecxx . . $ SbVec2f#SbVec2f(5102ef758adc0ae7).(2.0 * SCREEN_TAB_SIZEcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:837:9`!/screenLengths[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0],
886 2.0 * SCREEN_TAB_SIZEcxx . . $ `lib/interaction/src/draggers/SoTabPlaneDragger.c++:837:9`!/screenLengths[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1]);
887
888 SbVec2fcxx . . $ SbVec2f# innerEdgeDistcxx . . $ SbVec2f#SbVec2f(49f6e7a06ebc5aa8).;
889 innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0] = 1.0 - localTabSize[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0];
890 innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1] = 1.0 - localTabSize[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1];
891
892 SbVec2fcxx . . $ SbVec2f# outerEdgeDistcxx . . $ SbVec2f#SbVec2f(5102ef758adc0ae7).(1.0, 1.0);
893
894 SbVec2fcxx . . $ SbVec2f# halfTabWidthcxx . . $ SbVec2f#SbVec2f(49f6e7a06ebc5aa8).;
895 halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0] = (localTabSize[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0]/2.0);
896 halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1] = (localTabSize[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1]/2.0);
897
898 // Be sure to keep vertices in counter-clockwise order. For each
899 // group of four, they go in order: 3 2
900 // when front-facing 0 1
901
902 // use a small z value to move points off of cube faces...
903 const float z = .002;
904
905 SoCoordinate3cxx . . $ SoCoordinate3# *esc = (SoCoordinate3cxx . . $ SoCoordinate3# *) edgeScaleCoordscxx . . $ SoTabPlaneDragger#edgeScaleCoords..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).();
906 if ( esc != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
907
908 // Make sure there is enough room in the coordinate node.
909 esc->pointcxx . . $ SoCoordinate3#point..setNumcxx . . $ SoMField#setNum(d4f767463ce0a6b3).( 16 );
910 SbVec3fcxx . . $ SbVec3f# *pts = esc->pointcxx . . $ SoCoordinate3#point..startEditingcxx . . $ SoMFVec3f#startEditing(d7218d170b8c46e1).();
911
912 pts[0].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
913 pts[1].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
914 pts[2].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
915 pts[3].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
916
917 pts[4].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
918 pts[5].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
919 pts[6].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
920 pts[7].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
921
922 pts[8].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
923 pts[9].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
924 pts[10].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
925 pts[11].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
926
927 pts[12].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
928 pts[13].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
929 pts[14].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
930 pts[15].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], halfTabWidth[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
931
932 esc->pointcxx . . $ SoCoordinate3#point..finishEditingcxx . . $ SoMFVec3f#finishEditing(49f6e7a06ebc5aa8).();
933 }
934
935 SoCoordinate3cxx . . $ SoCoordinate3# *csc = (SoCoordinate3cxx . . $ SoCoordinate3# *) cornerScaleCoordscxx . . $ SoTabPlaneDragger#cornerScaleCoords..getValuecxx . . $ SoSFNode#getValue(b794963b450d51b3).();
936 if ( csc != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
937
938 // Make sure there is enough room in the coordinate node.
939 csc->pointcxx . . $ SoCoordinate3#point..setNumcxx . . $ SoMField#setNum(d4f767463ce0a6b3).( 16 );
940 SbVec3fcxx . . $ SbVec3f# *pts = csc->pointcxx . . $ SoCoordinate3#point..startEditingcxx . . $ SoMFVec3f#startEditing(d7218d170b8c46e1).();
941
942 pts[0].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
943 pts[1].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
944 pts[2].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
945 pts[3].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
946
947 pts[4].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
948 pts[5].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
949 pts[6].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
950 pts[7].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
951
952 pts[8].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
953 pts[9].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
954 pts[10].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(-innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
955 pts[11].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(-outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], -innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
956
957 pts[12].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(-outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
958 pts[13].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(-innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
959 pts[14].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(-innerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
960 pts[15].setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(-outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0], outerEdgeDist[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1], z);
961
962 csc->pointcxx . . $ SoCoordinate3#point..finishEditingcxx . . $ SoMFVec3f#finishEditing(49f6e7a06ebc5aa8).();
963 }
964 }
965
966 ////////////////////////////////////////////////////////////////////
967 // Stubs for callbacks
968 ////////////////////////////////////////////////////////////////////
969 void
970 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::startCBcxx . . $ SoTabPlaneDragger#startCB(7027446dc0b7318f).( void *, SoDraggercxx . . $ SoDragger# *inDragger )
971 {
972 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger# *dl = (SoTabPlaneDraggercxx . . $ SoTabPlaneDragger# *) inDragger;
973 dl->dragStartcxx . . $ SoTabPlaneDragger#dragStart(49f6e7a06ebc5aa8).();
974 }
975
976 void
977 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::motionCBcxx . . $ SoTabPlaneDragger#motionCB(7027446dc0b7318f).( void *, SoDraggercxx . . $ SoDragger# *inDragger )
978 {
979 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger# *dl = (SoTabPlaneDraggercxx . . $ SoTabPlaneDragger# *) inDragger;
980 dl->dragcxx . . $ SoTabPlaneDragger#drag(49f6e7a06ebc5aa8).();
981 }
982
983 void
984 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::finishCBcxx . . $ SoTabPlaneDragger#finishCB(7027446dc0b7318f).( void *, SoDraggercxx . . $ SoDragger# *inDragger )
985 {
986 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger# *dl = (SoTabPlaneDraggercxx . . $ SoTabPlaneDragger# *) inDragger;
987 dl->dragFinishcxx . . $ SoTabPlaneDragger#dragFinish(49f6e7a06ebc5aa8).();
988 }
989
990 //
991 // For each of the two primary axes, x and y, see how int32_t the segment is
992 // that goes from -1 to 1.
993 //
994 void
995 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::getXYScreenLengthscxx . . $ SoTabPlaneDragger#getXYScreenLengths(d3fc8848d79b9788).(SbVec2fcxx . . $ SbVec2f# &lengths,
996 const SbMatrixcxx . . $ SbMatrix# &localToScreen, const SbVec2scxx . . $ SbVec2s# &winSize)
997 {
998 // Set the values of the endpoints in local space.
999 SbVec3fcxx . . $ SbVec3f# plusXcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(1,0,0), minusXcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(-1, 0,0);
1000 SbVec3fcxx . . $ SbVec3f# plusYcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(0,1,0), minusYcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).( 0,-1,0);
1001
1002 // Transform them into screen space.
1003 localToScreen.multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).( plusX, plusX );
1004 localToScreen.multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).( minusX, minusX );
1005 localToScreen.multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).( plusY, plusY );
1006 localToScreen.multVecMatrixcxx . . $ SbMatrix#multVecMatrix(f4e74898890c8c54).( minusY, minusY );
1007
1008 // These results are in -1 to 1 space.
1009 // Get them in 0 to 1 space.
1010 plusX[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0] = 0.5 * (plusX[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0] + 1.0);
1011 plusX[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1] = 0.5 * (plusX[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1] + 1.0);
1012 minusX[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0] = 0.5 * (minusX[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0] + 1.0);
1013 minusX[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1] = 0.5 * (minusX[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1] + 1.0);
1014
1015 plusY[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0] = 0.5 * (plusY[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0] + 1.0);
1016 plusY[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1] = 0.5 * (plusY[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1] + 1.0);
1017 minusY[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0] = 0.5 * (minusY[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0] + 1.0);
1018 minusY[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1] = 0.5 * (minusY[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1] + 1.0);
1019
1020 // Find square of the length of each transformed segment,
1021 // in pixels.
1022 SbVec2fcxx . . $ SbVec2f# xAxisPixcxx . . $ SbVec2f#SbVec2f(49f6e7a06ebc5aa8).;
1023 xAxisPix[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0] = (plusX[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0] - minusX[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0]) * winSize[cxx . . $ SbVec2s#`operator[]`(1e601d28ecbc4f85).0];
1024 xAxisPix[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1] = (plusX[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1] - minusX[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1]) * winSize[cxx . . $ SbVec2s#`operator[]`(1e601d28ecbc4f85).1];
1025
1026 SbVec2fcxx . . $ SbVec2f# yAxisPixcxx . . $ SbVec2f#SbVec2f(49f6e7a06ebc5aa8).;
1027 yAxisPix[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0] = (plusY[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0] - minusY[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).0]) * winSize[cxx . . $ SbVec2s#`operator[]`(1e601d28ecbc4f85).0];
1028 yAxisPix[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1] = (plusY[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1] - minusY[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).1]) * winSize[cxx . . $ SbVec2s#`operator[]`(1e601d28ecbc4f85).1];
1029
1030 lengths[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).0] = xAxisPix.lengthcxx . . $ SbVec2f#length(5036dfe8d4170af2).();
1031 lengths[cxx . . $ SbVec2f#`operator[]`(5dbdaf238659ae67).1] = yAxisPix.lengthcxx . . $ SbVec2f#length(5036dfe8d4170af2).();
1032 }
1033
1034 //
1035 ////////////////////////////////////////////////////////////////////////
1036 // keypress/release callback functions
1037 //
1038 // These assure that the proper changes to the highlights,
1039 // currentState, and projectors are made
1040 //
1041 ////////////////////////////////////////////////////////////////////////
1042 //
1043
1044 void
1045 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::metaKeyChangeCBcxx . . $ SoTabPlaneDragger#metaKeyChangeCB(7027446dc0b7318f).( void *, SoDraggercxx . . $ SoDragger# *inDragger)
1046 {
1047 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger# *tpd = (SoTabPlaneDraggercxx . . $ SoTabPlaneDragger# *) inDragger;
1048
1049 SoHandleEventActioncxx . . $ SoHandleEventAction# *ha = tpd->getHandleEventActioncxx . . $ SoDragger#getHandleEventAction(259d39329627b7cc).();
1050
1051 //[1] Only do this if we are grabbing events
1052 if ( ha->getGrabbercxx . . $ SoHandleEventAction#getGrabber(b794963b450d51b3).() != tpd )
1053 return;
1054
1055 //[2] We only want key press or release events.
1056 const SoEventcxx . . $ SoEvent# *event = tpd->getEventcxx . . $ SoDragger#getEvent(c30b8bbf6163e0e4).();
1057 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))
1058 return;
1059
1060 //[3] Is the key 'shift'
1061 const SoKeyboardEventcxx . . $ SoKeyboardEvent# *ke = (const SoKeyboardEventcxx . . $ SoKeyboardEvent# *) event;
1062 SoKeyboardEventcxx . . $ SoKeyboardEvent#::Keycxx . . $ SoKeyboardEvent#Key# key = ke->getKeycxx . . $ SoKeyboardEvent#getKey(4f90a17ab6d7b294).();
1063
1064 if ( ( key == SoKeyboardEventcxx . . $ SoKeyboardEvent#::LEFT_SHIFTcxx . . $ SoKeyboardEvent#LEFT_SHIFT. ||
1065 key == SoKeyboardEventcxx . . $ SoKeyboardEvent#::RIGHT_SHIFTcxx . . $ SoKeyboardEvent#RIGHT_SHIFT. ) &&
1066 ( tpd->currentStatecxx . . $ SoTabPlaneDragger#currentState. == TRANSLATINGcxx . . $ SoTabPlaneDragger#TRANSLATING. ||
1067 tpd->currentStatecxx . . $ SoTabPlaneDragger#currentState. == UNIFORM_SCALINGcxx . . $ SoTabPlaneDragger#UNIFORM_SCALING. ||
1068 tpd->currentStatecxx . . $ SoTabPlaneDragger#currentState. == CORNER_SCALINGcxx . . $ SoTabPlaneDragger#CORNER_SCALING. )) {
1069
1070 // We want to end the old gesture and start a new one.
1071
1072 // [A] Release the grabber. This ends the gesture and calls all
1073 // finishCallbacks (on parent dragger, too, if we're registered)
1074 Statecxx . . $ SoTabPlaneDragger#State# savedState = tpd->currentStatecxx . . $ SoTabPlaneDragger#currentState.;
1075 ha->releaseGrabbercxx . . $ SoHandleEventAction#releaseGrabber(49f6e7a06ebc5aa8).();
1076
1077 // [B] Set the starting point to be our saved worldRestartPoint
1078 tpd->setStartingPointcxx . . $ SoDragger#setStartingPoint(65a601b9d70571d6).( tpd->worldRestartPtcxx . . $ SoTabPlaneDragger#worldRestartPt. );
1079 tpd->restartStatecxx . . $ SoTabPlaneDragger#restartState. = savedState;
1080
1081 // [C] Become the grabber again. This begins a new gesture and calls all
1082 // startCallbacks (parent dragger, too). Info like viewVolume,
1083 // viewportRegion, handleEventAction, and tempPathToThis
1084 // is still valid.
1085 ha->setGrabbercxx . . $ SoHandleEventAction#setGrabber(da6c7544ccee32bd).(tpd);
1086
1087 // [D] set handled
1088 ha->setHandledcxx . . $ SoHandleEventAction#setHandled(49f6e7a06ebc5aa8).();
1089 }
1090 }
1091
1092 void
1093 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::valueChangedCBcxx . . $ SoTabPlaneDragger#valueChangedCB(7027446dc0b7318f).( void *, SoDraggercxx . . $ SoDragger# *inDragger )
1094 {
1095 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger# *tpd = (SoTabPlaneDraggercxx . . $ SoTabPlaneDragger# *) inDragger;
1096 SbMatrixcxx . . $ SbMatrix# motMat = tpd->getMotionMatrixcxx . . $ SoDragger#getMotionMatrix(c49c36ee78b0a89e).();
1097
1098 SbVec3fcxx . . $ SbVec3f# transcxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8)., scalecxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8).;
1099 SbRotationcxx . . $ SbRotation# rotcxx . . $ SbRotation#SbRotation(49f6e7a06ebc5aa8)., scaleOrientcxx . . $ SbRotation#SbRotation(49f6e7a06ebc5aa8).;
1100 getTransformFastcxx . . $ SoDragger#getTransformFast(87c9df4114162fa2).( motMat, trans, rot, scale, scaleOrient);
1101
1102 // Disconnect the field sensors
1103 tpd->translFieldSensorcxx . . $ SoTabPlaneDragger#translFieldSensor.->detachcxx . . $ SoFieldSensor#detach(49f6e7a06ebc5aa8).();
1104 tpd->scaleFieldSensorcxx . . $ SoTabPlaneDragger#scaleFieldSensor.->detachcxx . . $ SoFieldSensor#detach(49f6e7a06ebc5aa8).();
1105
1106 if ( tpd->translationcxx . . $ SoTabPlaneDragger#translation..getValuecxx . . $ SoSFVec3f#getValue(b5c384c15c94bb12).() !=cxx . . $ `operator!=`(648f52454fd9f27). trans )
1107 tpd->translationcxx . . $ SoTabPlaneDragger#translation. =cxx . . $ SoSFVec3f#`operator=`(861f7885f8980b32). trans;
1108 if ( tpd->scaleFactorcxx . . $ SoTabPlaneDragger#scaleFactor..getValuecxx . . $ SoSFVec3f#getValue(b5c384c15c94bb12).() !=cxx . . $ `operator!=`(648f52454fd9f27). scale )
1109 tpd->scaleFactorcxx . . $ SoTabPlaneDragger#scaleFactor. =cxx . . $ SoSFVec3f#`operator=`(861f7885f8980b32). scale;
1110
1111 // Reconnect the field sensors
1112 tpd->translFieldSensorcxx . . $ SoTabPlaneDragger#translFieldSensor.->attachcxx . . $ SoFieldSensor#attach(6a35cc9f7090653f).( &(tpd->translationcxx . . $ SoTabPlaneDragger#translation.) );
1113 tpd->scaleFieldSensorcxx . . $ SoTabPlaneDragger#scaleFieldSensor.->attachcxx . . $ SoFieldSensor#attach(6a35cc9f7090653f).( &(tpd->scaleFactorcxx . . $ SoTabPlaneDragger#scaleFactor.) );
1114 }
1115
1116 void
1117 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::fieldSensorCBcxx . . $ SoTabPlaneDragger#fieldSensorCB(c8d298b3e215c027).( void *inDragger, SoSensorcxx . . $ SoSensor# * )
1118 {
1119 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger# *tpd = (SoTabPlaneDraggercxx . . $ SoTabPlaneDragger# *) inDragger;
1120
1121 // Incorporate the new field values into the matrix
1122 SbMatrixcxx . . $ SbMatrix# motMat = tpd->getMotionMatrixcxx . . $ SoDragger#getMotionMatrix(c49c36ee78b0a89e).();
1123 tpd->workFieldsIntoTransformcxx . . $ SoDragger#workFieldsIntoTransform(ab60305a37435a6f).(motMat);
1124
1125 tpd->setMotionMatrixcxx . . $ SoDragger#setMotionMatrix(37d2f951b3ffd7a6).( motMat );
1126 }
1127
1128
1129 void
1130 SoTabPlaneDraggercxx . . $ SoTabPlaneDragger#::setDefaultOnNonWritingFieldscxx . . $ SoTabPlaneDragger#setDefaultOnNonWritingFields(49f6e7a06ebc5aa8).()
1131 {
1132 // This node may change after construction, but we still
1133 // don't want to write it out.
1134 edgeScaleCoordscxx . . $ SoTabPlaneDragger#edgeScaleCoords..setDefaultcxx . . $ SoField#setDefault(d4f767463ce0a6b3).(TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
1135 cornerScaleCoordscxx . . $ SoTabPlaneDragger#cornerScaleCoords..setDefaultcxx . . $ SoField#setDefault(d4f767463ce0a6b3).(TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!);
1136
1137 // Call the base class...
1138 SoDraggercxx . . $ SoDragger#::setDefaultOnNonWritingFieldscxx . . $ SoDragger#setDefaultOnNonWritingFields(49f6e7a06ebc5aa8).();
1139 }