1SoTabPlaneDragger(3IV)() SoTabPlaneDragger(3IV)()
2
3
4
6 SoTabPlaneDragger — object you can translate or scale within a plane by
7 dragging with the mouse
8
10 SoBase > SoFieldContainer > SoNode > SoBaseKit > SoInteractionKit >
11 SoDragger > SoTabPlaneDragger
12
14 #include <Inventor/draggers/SoTabPlaneDragger.h>
15
16 Fields from class SoTabPlaneDragger:
17
18 SoSFVec3f scaleFactor
19 SoSFVec3f translation
20
21 Fields from class SoDragger:
22
23 SoSFBool isActive
24
25 Fields from class SoInteractionKit:
26
27 SoSFEnum renderCaching
28 SoSFEnum boundingBoxCaching
29 SoSFEnum renderCulling
30 SoSFEnum pickCulling
31
32 Parts from class SoBaseKit:
33
34 (SoNodeKitListPart) callbackList
35
36 Methods from class SoTabPlaneDragger:
37
38 SoTabPlaneDragger()
39 void adjustScaleTabSize()
40 static const SoNodekitCatalog *
41 getClassNodekitCatalog() const
42 static SoType getClassTypeId()
43
44 Methods from class SoDragger:
45
46 void addStartCallback(SoDraggerCB *f, void *userData =
47 NULL)
48 void removeStartCallback(SoDraggerCB *f, void *userData =
49 NULL)
50 void addMotionCallback(SoDraggerCB *f, void *userData =
51 NULL)
52 void removeMotionCallback(SoDraggerCB *f, void *userData =
53 NULL)
54 void addFinishCallback(SoDraggerCB *f, void *userData =
55 NULL)
56 void removeFinishCallback(SoDraggerCB *f, void *userData =
57 NULL)
58 void addValueChangedCallback(SoDraggerCB *f, void *user‐
59 Data = NULL)
60 void removeValueChangedCallback(SoDraggerCB *f, void
61 *userData = NULL)
62 SbBool enableValueChangedCallbacks()
63 void setMinGesture(int pixels)
64 int getMinGesture() const
65 static void setMinScale(float newMinScale)
66 static float getMinScale()
67
68 Methods from class SoInteractionKit:
69
70 virtual SbBool setPartAsPath(const SbName &partName, SoPath *surro‐
71 gatePath )
72
73 Methods from class SoBaseKit:
74
75 virtual const SoNodekitCatalog *
76 getNodekitCatalog() const
77 virtual SoNode * getPart(const SbName &partName, SbBool
78 makeIfNeeded)
79 SbString getPartString(const SoBase *part)
80 virtual SoNodeKitPath * createPathToPart(const SbName &partName, SbBool
81 makeIfNeeded, const SoPath *pathToExtend =
82 NULL)
83 virtual SbBool setPart(const SbName &partName, SoNode *newPart)
84 SbBool set(char *partName, char *parameters)
85 SbBool set(char *nameValuePairs)
86 static SbBool isSearchingChildren()
87 static void setSearchingChildren(SbBool newVal)
88
89 Methods from class SoNode:
90
91 void setOverride(SbBool state)
92 SbBool isOverride() const
93 SoNode * copy(SbBool copyConnections = FALSE) const
94 virtual SbBool affectsState() const
95 static SoNode * getByName(const SbName &name)
96 static int getByName(const SbName &name, SoNodeList &list)
97
98 Methods from class SoFieldContainer:
99
100 void setToDefaults()
101 SbBool hasDefaultValues() const
102 SbBool fieldsAreEqual(const SoFieldContainer *fc) const
103 void copyFieldValues(const SoFieldContainer *fc, SbBool
104 copyConnections = FALSE)
105 void get(SbString &fieldDataString)
106 virtual int getFields(SoFieldList &resultList) const
107 virtual SoField * getField(const SbName &fieldName) const
108 SbBool getFieldName(const SoField *field, SbName &fieldName)
109 const
110 SbBool isNotifyEnabled() const
111 SbBool enableNotify(SbBool flag)
112
113 Methods from class SoBase:
114
115 void ref()
116 void unref() const
117 void unrefNoDelete() const
118 void touch()
119 virtual SoType getTypeId() const
120 SbBool isOfType(SoType type) const
121 virtual void setName(const SbName &name)
122 virtual SbName getName() const
123
124 Macros from class SoBaseKit:
125
126 SO_GET_PART(kit, partName, partClass)
127 SO_CHECK_PART(kit, partName, partClass)
128
129
131 SoTabPlaneDragger is a dragger which allows the user to interactively
132 translate and scale in a plane. It looks like a square white outline
133 with smaller green squares (or tabs) set in the corners and along the
134 center of each edge. Dragging a corner tab scales the dragger in 2D by
135 scaling about the opposite corner. Dragging an edge tab performs 1D
136 scaling about the opposite edge. The rest of the dragger is invisible
137 but pickable; selecting it initiates translation within the plane.
138
139 The dragger tries to keep the small tabs a constant size in screen
140 space. Every time a drag begins or ends, the size is recalculated based
141 on the viewing and modeling matrix.
142
143 When dragging the translator part, press the <Shift> key and you can
144 constrain motion to either the local x axis or the y axis. The direc‐
145 tion is determined by your initial mouse gesture after pressing the
146 key. Releasing the key removes the constraint.
147
148 When the translator part drags, the dragger updates its translation
149 field. The various scaling parts cause changes to both the scaleFactor
150 and translation field, since scaling about a point other than the cen‐
151 ter adds translation to the center of the dragger. If you set the
152 field, the dragger will move accordingly. You can also connect fields
153 of other nodes or engines from this one to make them follow the drag‐
154 ger's motion.
155
156 You can not change the shape used to draw the tabs. This part is kept
157 privately and may not be changed; the coordinates for the tabs are
158 edited during adjustScaleTabSize().
159
160 The SoTabPlaneDragger class does contain three other parts you can
161 change: tabPlaneTranslator, tabPlaneScaleTabMaterial and tab‐
162 PlaneScaleTabHints.
163
164 Each of these is set by default from a resource described in the Drag‐
165 ger Resources section of the online reference page for this class. You
166 can change the parts in any instance of this dragger using setPart().
167
168 You can make your program use different default resources for the parts
169 by copying the file /usr/share/data/draggerDefaults/tabPlaneDragger.iv
170 into your own directory, editing the file, and then setting the envi‐
171 ronment variable SO_DRAGGER_DIR to be a path to that directory.
172
174 SoSFVec3f scaleFactor
175 Scale factor affecting the dragger.
176
177 SoSFVec3f translation
178 Position of the dragger.
179
180
182 SoTabPlaneDragger()
183 Constructor.
184
185 void adjustScaleTabSize()
186 Cause the scale tab sizes to be re-adjusted so that they remain a
187 near constant screen space size. This happens automatically upon
188 dragger finish. Call this to adjust the scale tab sizes at other
189 times, for instance after the camera has changed in a viewer finish
190 callback.
191
192 static const SoNodekitCatalog *
193 getClassNodekitCatalog() const
194 Returns an SoNodekitCatalog for this class
195
196 static SoType getClassTypeId()
197 Returns type identifier for this class.
198
199
201 ┌────────────────────────────────────────────────────────────┐
202 │ All parts │
203 │ NULL by │
204 │Part Name Part Type Default Type Default │
205 │ │
206 │callbackList NodeKitListPart -- yes │
207 │translator Separator -- yes │
208 │scaleTabMaterial Material -- yes │
209 │scaleTabHints ShapeHints -- yes │
210 │ │
211 └────────────────────────────────────────────────────────────┘
212 ┌───────────────────────────────────────────────────────────────┐
213 │ Extra information for list parts from above table │
214 │ │
215 │Part Name Container Type Permissible Types │
216 │ │
217 │callbackList Separator Callback, EventCallback │
218 │ │
219 └───────────────────────────────────────────────────────────────┘
221 .in 0n+.5i
222 Resource: tabPlaneTranslator
223 .in 0n+.5i
224 Part: translator
225 Appearance: Outline of a Square. The region within it is pickable
226 Description: Begins translation within the plane
227
228 .in 0n+.5i
229 Resource: tabPlaneScaleTabMaterial
230 .in 0n+.5i
231 Part: scaleTabMaterial
232 Appearance: Green - half diffuse, half emissive.
233 Description: Used as material for scaling tabs.
234
235 .in 0n+.5i
236 Resource: tabPlaneScaleTabHints
237 .in 0n+.5i
238 Part: scaleTabHints
239 Appearance: shapeHints node:COUNTERCLOCKWISE/SOLID/CONVEX
240 Description: Property for the tab nodes.
241
242
244 TabPlaneDragger {
245 renderCaching AUTO
246 boundingBoxCaching AUTO
247 renderCulling AUTO
248 pickCulling AUTO
249 isActive FALSE
250 translation 0 0 0
251 scaleFactor 1 1 1
252 callbackList NULL
253 translator <tabPlaneTranslator resource>
254 scaleTabMaterial <tabPlaneScaleTabMaterial resource>
255 scaleTabHints <tabPlaneScaleTabHints resource>
256 }
257
259 SoInteractionKit, SoDragger, SoCenterballDragger, SoDirectionalLight‐
260 Dragger, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger,
261 SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger,
262 SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger,
263 SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger,
264 SoTabBoxDragger, SoTrackballDragger, SoTransformBoxDragger, SoTrans‐
265 formerDragger, SoTranslate1Dragger, SoTranslate2Dragger
266
267
268
269
270 SoTabPlaneDragger(3IV)()