Class SoRectangleScreenDrawer
- 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
-
- com.openinventor.inventor.drawers.SoPolyLineScreenDrawer
-
- com.openinventor.inventor.drawers.SoRectangleScreenDrawer
-
- All Implemented Interfaces:
SafeDisposable
public class SoRectangleScreenDrawer extends SoPolyLineScreenDrawer
Interactively draws a rectangle in normalized screen space. This class can be used to interactively draw a rectangle on screen.When the rectangle is finished, an event is raised to notify the application (see
SoPolyLineScreenDrawer.onFinish
). Points are returned as normalized coordinates in the range -1..1, which is conveniently the default view volume for anSoOrthographicCamera
node.The line color and simplification threshold are specified by fields in the parent class
SoPolyLineScreenDrawer
.Please see
SoPolyLineScreenDrawer
for general notes and code example.Rectangle specific notes:
- The rectangle can be specified by 2 corner points (default) or by a center point and one corner point (see
CreationMethod
). - The rectangle points are always delivered upper-left corner first, then counter-clockwise.
- The
simplificationThreshold
field does not apply to this node. A rectangle always has four points. - The
isClosed
field does apply to this node (but false is not very useful). - If user finishes a rectangle, then the next click will automatically clear the polyline (begin a new rectangle).
- SbEventHandlers:
- OnStart : Triggered on LeftMouseDown input event.
- OnMove : Triggered on MouseMove input events (after Start).
- OnFinish : Triggered on LeftMouseUp input event.
USAGE - Press left mouse and drag to draw the rectangle.
- Release to finish it.
- Press Escape to cancel.
File format/default:
RectangleScreenDrawer {
point [] color 1 0 0 simplificationThreshold 0 isClosed true method CORNER_CORNER
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SoRectangleScreenDrawer.CreationMethods
Methods to create rectangle.-
Nested classes/interfaces inherited from class com.openinventor.inventor.drawers.SoPolyLineScreenDrawer
SoPolyLineScreenDrawer.EventArg
-
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 SoSFEnum<SoRectangleScreenDrawer.CreationMethods>
method
Method to create rectangle.-
Fields inherited from class com.openinventor.inventor.drawers.SoPolyLineScreenDrawer
color, doCCW, isClosed, linePattern, linePatternScaleFactor, lineWidth, onFinish, onMove, onStart, point, simplificationThreshold
-
Fields inherited from class com.openinventor.inventor.drawers.SoScreenDrawer
sceneGraph
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoRectangleScreenDrawer()
Constructor.
-
Method Summary
-
Methods inherited from class com.openinventor.inventor.drawers.SoPolyLineScreenDrawer
clear
-
Methods inherited from class com.openinventor.inventor.drawers.SoScreenDrawer
reset
-
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
-
method
public final SoSFEnum<SoRectangleScreenDrawer.CreationMethods> method
Method to create rectangle. . Default is CORNER_CORNER.
-
-