public class SoTabPlaneDragger extends SoDragger
SoTabPlaneDragger
is a dragger which allows the user to interactively translate and scale in a plane. It looks like a square white outline with smaller green squares (or tabs ) set in the corners and along the center of each edge.
Dragging a corner tab scales the dragger in 2D by scaling about the opposite corner. Holding the SHIFT key while while dragging a corner tab forces uniform scaling.
Dragging an edge tab performs 1D scaling about the opposite edge.
Uniform scaling can also be forced by setting the scaleUniform
field to true.
Clicking and dragging a face does translation within the plane of the face. Although the face of the dragger is invisible (using the default dragger geometry) it is pickable.
The dragger tries to keep the small tabs a constant size in screen space. Before version 7.0, this adjustment was only done when a drag operation started and ended, or when the adjustScaleTabSize
method was called. Now as long as the resizeHandles
field is set to true (the default), the tab size is automatically recalculated whenever the view matrix changes (normally because the camera position or orientation changed).
If the dragger becomes too small in one dimension to contain all three tabs (two corner tabs plus the edge tab), the middle (edge) tab will not be drawn. If the dragger becomes very small (or flat) in one dimension, it may not be possible for the user to resize using the tabs. One solution for this is to provide a "reset dragger" button in the application.
When dragging the translator part, press the <Shift> key and you can constrain motion to either the local x axis or the y axis . The direction is determined by your initial mouse gesture after pressing the key. Releasing the key removes the constraint.
When the translator part drags, the dragger updates its translation
field. The various scaling parts cause changes to both the scaleFactor
and translation
field, since scaling about a point other than the center adds translation to the center of the dragger. If you set the field, the dragger will move accordingly. You can also connect fields of other nodes or engines from this one to make them follow the dragger's motion.
You can not change the shape used to draw the tabs. This part is kept privately and may not be changed; the coordinates for the tabs are edited during adjustScaleTabSize()
.
The SoTabPlaneDragger
class does contain three other parts you can change: tabPlaneTranslator , tabPlaneScaleTabMaterial and tabPlaneScaleTabHints .
Each of these is set by default from a resource described in the Dragger Resources section of the online reference page for this class. You can change the parts in any instance of this dragger using setPart()
.
You can make your program use different default resources for the parts by copying the file $OIVHOME/data/draggerDefaults/tabPlaneDragger.iv into your own directory, editing the file, and then setting the environment variable SO_DRAGGER_DIR to be a path to that directory.
See SoDragger
for more information about using and customizing draggers, including code examples, using draggers in an immersive VR environment and using WYSIWYG draggers.
File format/default:
TabPlaneDragger {
renderCaching | AUTO |
boundingBoxCaching | AUTO |
renderCulling | AUTO |
pickCulling | AUTO |
isActive | false |
resizeHandles | true |
translation | 0 0 0 |
scaleFactor | 1 1 1 |
scaleUniform | false |
twoSidedLighting | false |
lineWidth | 1 |
tabPixelSize | 8 |
callbackList | NULL |
translator | <tabPlaneTranslator resource> |
scaleTabMaterial | <tabPlaneScaleTabMaterial resource> |
scaleTabHints | <tabPlaneScaleTabHints resource> |
Resource: | tabPlaneTranslator |
Part: | translator |
Appearance: | Outline of a Square. The region within it is pickable |
Description: | Begins translation within the plane |
Resource: | tabPlaneScaleTabMaterial |
Part: | scaleTabMaterial |
Appearance: | Green - half diffuse, half emissive. |
Description: | Used as material for scaling tabs. |
Resource: | tabPlaneScaleTabHints |
Part: | scaleTabHints |
Appearance: | shapeHints node:COUNTERCLOCKWISE/SOLID/CONVEX |
Description: | Property for the tab nodes. |
All Parts
Part Name | Part Type | Default Type | NULL Default |
callbackList | NodeKitListPart | yes | |
translator | Separator | yes | |
scaleTabMaterial | Material | yes | |
scaleTabHints | ShapeHints | yes | |
translatorDrawStyle | DrawStyle | no | |
translatorMaterial | Material | no |
Extra Information for List Parts from Above Table
Part Name | Container Type | Possible Types |
callbackList | Separator | Callback, EventCallback |
See also:
SoInteractionKit
, SoDragger
, SoCenterballDragger
, SoDirectionalLightDragger
, SoDragPointDragger
, SoHandleBoxDragger
, SoJackDragger
, SoPointLightDragger
, SoRotateCylindricalDragger
, SoRotateDiscDragger
, SoRotateSphericalDragger
, SoScale1Dragger
, SoScale2Dragger
, SoScale2UniformDragger
, SoScaleUniformDragger
, SoSpotLightDragger
, SoTabBoxDragger
, SoTrackballDragger
, SoTransformBoxDragger
, SoTransformerDragger
, SoTranslate1Dragger
, SoTranslate2Dragger
SoDragger.TrackerDirectModes
SoInteractionKit.Cachings
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
SoSFFloat |
lineWidth
Specifies the line width for the outline box.
|
SoSFBool |
resizeHandles
If set to true, handles will be resized automatically when the view matrix (camera) changes.
|
SoSFVec3f |
scaleFactor
Scale factor affecting the dragger.
|
SoSFBool |
scaleUniform
If set to true, scaling will always be uniform.
|
SoSFInt32 |
tabPixelSize
Specifies the size of the green tabs in pixels.
|
SoSFVec3f |
translation
Position of the dragger.
|
SoSFBool |
twoSidedLighting
If set to true, OpenGL two sided lighting will be enabled.
|
DEFAULT, enableCallbacks, FREE, isActive, MOVE, NONE, ROTATE
AUTO, boundingBoxCaching, OFF, ON, pickCulling, renderCaching, renderCulling
boundingBoxIgnoring
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoTabPlaneDragger()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
adjustScaleTabSize()
Causes the scale tab sizes to be adjusted so that they remain a near constant screen space size.
|
static SoNodekitCatalog |
getClassNodekitCatalog()
Returns the
SoNodekitCatalog for this class. |
void |
showCornerScales(boolean show)
show or hide corners
|
void |
showEdgeScales(boolean show)
show or hide edges
|
addFinishCallback, addMotionCallback, addStartCallback, addValueChangedCallback, enableValueChangedCallbacks, getInitialTrackerDirectMode, getMinGesture, getMinGestureFloat, getMinScale, getMotionMatrix, getTrackerDirectMode, removeFinishCallback, removeMotionCallback, removeStartCallback, removeValueChangedCallback, setInitialTrackerDirectMode, setInitialTrackerDirectMode, setMinGesture, setMinGesture, setMinScale, setMotionMatrix, setTrackerDirectMode, setTrackerDirectMode
setPartAsPath
getNodekitCatalog, getPart, getPart, getPartString, getViewportIsEnabled, getViewportOrigin, getViewportSize, isSearchingChildren, set, set, setPart, setSearchingChildren
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, setToDefaults
dispose, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizable
getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public final SoSFVec3f translation
public final SoSFVec3f scaleFactor
public final SoSFBool resizeHandles
public final SoSFBool scaleUniform
public final SoSFBool twoSidedLighting
public final SoSFFloat lineWidth
public final SoSFInt32 tabPixelSize
public void showCornerScales(boolean show)
public static SoNodekitCatalog getClassNodekitCatalog()
SoNodekitCatalog
for this class.public void adjustScaleTabSize()
resizeHandles
field is set to true.public void showEdgeScales(boolean show)
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com