Class SoPolygonScreenDrawer
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.SoPolygonScreenDrawer
- All Implemented Interfaces:
SafeDisposable
Interactively draws a polygon in normalized screen space.
This class can be used to interactively draw a polygon on screen.
When the polygon 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 an SoOrthographicCamera
node.
The line color and simplification threshold are specified by fields in the parent class SoPolyLineScreenDrawer
.
Please see SoPolyLineScreenDrawer
for additional notes and code example.
Polygon specific notes:
- The
simplificationThreshold
field does apply to this node. - If the user finishes a polygon and the application does not call the clear() method, then the next click will add another point to the existing polygon.
- SbEventHandlers:
- OnStart : Triggered on initial LeftMouseDown input event.
- OnMove : Triggered on MouseMove input events (after Start)
and also on LeftMouseDown and LeftMouseUp input events (after Start). - OnFinish : Triggered on LeftMouseDoubleClick input event
or KeyPress input event with <Enter> or <ESC> keys.
- Left click to add a point.
- Double-click to add a point and finish the polygon.
- Press Enter to finish the polygon (with the points added so far).
- Press Escape to cancel creation of the polygon.
File format/default:
PolygonScreenDrawer {
point | [] |
color | 1 0 0 |
simplificationThreshold | 5 |
isClosed | true |
- See Also:
-
Nested Class Summary
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 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 -
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
-
Constructor Details
-
SoPolygonScreenDrawer
public SoPolygonScreenDrawer()Constructor.
-