Class SoTabPlaneDragger
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.inventor.nodekits.SoBaseKit
-
- com.openinventor.inventor.nodekits.SoInteractionKit
-
- com.openinventor.inventor.draggers.SoDragger
-
- com.openinventor.inventor.draggers.SoTabPlaneDragger
-
- All Implemented Interfaces:
SafeDisposable
- Direct Known Subclasses:
SoEllipsoidDragger
public class SoTabPlaneDragger extends SoDragger
Object you can translate or scale within a plane by dragging with the mouse.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 theresizeHandles
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 thescaleFactor
andtranslation
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 {
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> DRAGGER RESOURCES 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. CATALOG PARTS 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.draggers.SoDragger
SoDragger.TrackerDirectModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodekits.SoInteractionKit
SoInteractionKit.Cachings
-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
Fields Modifier and Type Field 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.-
Fields inherited from class com.openinventor.inventor.draggers.SoDragger
enableCallbacks, isActive
-
Fields inherited from class com.openinventor.inventor.nodekits.SoInteractionKit
boundingBoxCaching, pickCulling, renderCaching, renderCulling
-
Fields inherited from class com.openinventor.inventor.nodekits.SoBaseKit
boundingBoxIgnoring
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoTabPlaneDragger()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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 theSoNodekitCatalog
for this class.void
showCornerScales(boolean show)
show or hide cornersvoid
showEdgeScales(boolean show)
show or hide edges-
Methods inherited from class com.openinventor.inventor.draggers.SoDragger
addFinishCallback, addMotionCallback, addStartCallback, addValueChangedCallback, enableValueChangedCallbacks, getInitialTrackerDirectMode, getMinGesture, getMinGestureFloat, getMinScale, getMotionMatrix, getTrackerDirectMode, removeFinishCallback, removeMotionCallback, removeStartCallback, removeValueChangedCallback, setInitialTrackerDirectMode, setInitialTrackerDirectMode, setMinGesture, setMinGesture, setMinScale, setMotionMatrix, setTrackerDirectMode, setTrackerDirectMode
-
Methods inherited from class com.openinventor.inventor.nodekits.SoInteractionKit
setPartAsPath
-
Methods inherited from class com.openinventor.inventor.nodekits.SoBaseKit
getNodekitCatalog, getPart, getPart, getPartString, getViewportIsEnabled, getViewportOrigin, getViewportSize, isSearchingChildren, set, set, setPart, setSearchingChildren
-
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Field Detail
-
translation
public final SoSFVec3f translation
Position of the dragger. Default is (0,0,0).
-
scaleFactor
public final SoSFVec3f scaleFactor
Scale factor affecting the dragger. Default is (1,1,1).
-
resizeHandles
public final SoSFBool resizeHandles
If set to true, handles will be resized automatically when the view matrix (camera) changes. Default is true.- Since:
- Open Inventor 7.0
-
scaleUniform
public final SoSFBool scaleUniform
If set to true, scaling will always be uniform. Default is false.- Since:
- Open Inventor 7.1
-
twoSidedLighting
public final SoSFBool twoSidedLighting
If set to true, OpenGL two sided lighting will be enabled. Default is false.- Since:
- Open Inventor 7.1
-
lineWidth
public final SoSFFloat lineWidth
Specifies the line width for the outline box. Default is 1.0- Since:
- Open Inventor 7.1
-
tabPixelSize
public final SoSFInt32 tabPixelSize
Specifies the size of the green tabs in pixels. Default is 8- Since:
- Open Inventor 9.2
-
-
Method Detail
-
showEdgeScales
public void showEdgeScales(boolean show)
show or hide edges
-
showCornerScales
public void showCornerScales(boolean show)
show or hide corners
-
getClassNodekitCatalog
public static SoNodekitCatalog getClassNodekitCatalog()
Returns theSoNodekitCatalog
for this class.
-
adjustScaleTabSize
public void adjustScaleTabSize()
Causes the scale tab sizes to be adjusted so that they remain a near constant screen space size. This happens automatically upon dragger finish. Call this to manually adjust the scale tab sizes at other times, for instance after the camera has changed in a viewer finish callback . Note that (since version 7.0) handles are automatically resized when the camera changes, as long as theresizeHandles
field is set to true.
-
-