Class SoScreenDrawer
- 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.drawers.SoScreenDrawer
-
- All Implemented Interfaces:
SafeDisposable
- Direct Known Subclasses:
SoPolyLineScreenDrawer
public class SoScreenDrawer extends SoNode
Base class to draw a scene graph in screen space. This node displays the scene graph specified by thesceneGraphfield in screen space normalized in the range ([-1, 1]x[-1, 1]x[-1, 1]) relative to the current viewport.The specified scene graph is automatically rendered using an
SoAnnotationnode, anSoPickStylenode with style = UNPICKABLE, and anSoOrthographicCameranode.Classes derived from
SoScreenDrawerare normally used to implement dynamically drawing a 2D shape, for example a rectangle, in response to mouse events. Applications will typically use one of these derived classes, for example,SoEllipseScreenDrawer,SoRectangleScreenDrawer,SoPolygonScreenDrawerorSoLassoScreenDrawer.Please see
SoPolyLineScreenDrawerfor important notes about these classes and a code example.Applications may also implement their own custom screen drawer classes. The convenient onMouseDown(), onMouseMove(), ... methods can be implemented by sub-classes to customize behaviors for specific events, but the application can also reimplement the handleEvent() method to handle any event.
There should only be one
SoScreenDrawerderived node in the sceneGraph (to avoid conflicts in mouse events).NOTE: This node and its subclasses use screen coordinates ranging from -1 to 1. (Because this is the default view volume for an
SoOrthographicCameranode.) Be careful because other classes in Open Inventor use normalized screen coordinates ranging from 0 to 1. In particular theSbViewportRegionnormalize() method and theSbViewVolumemethods that project from 3D to 2D and vice-versa.
-
-
Nested Class Summary
-
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 SoSFNodesceneGraphScene graph to render.-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoScreenDrawer()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidreset()Resets internal state to initial values.-
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, set, 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
-
sceneGraph
public final SoSFNode sceneGraph
Scene graph to render.
-
-