Purpose

The module SoView2DExample is a programming example to demonstrate how to develop a new SoView2DExtension which draws its own OpenGL stuff on slices in 2D viewers.

It derives from the SoView2DExtension class and needs to be connected somewhere before a SoView2D in the Open Inventor scene graph to become active.

The programmer can handle viewer events as well as OpenGL drawings on each slice shown in a viewer. Also a definition of colors, mouse buttons and different event phases is possible.

Have a close look to the source code of the SoView2DExample project for detailed programming information.

Windows

Default Panel

../../../Modules/Inventor/SoView2DExample/mhelp/Images/Screenshots/SoView2DExample._default.png

Output Fields

self

name: self, type: SoNode

Parameter Fields

Field Index

alt: Enum createNewModeRequest: Trigger needsValidVoxel: Bool
Button1: Enum cursorShape: Enum renderOnSlab: Bool
Button2: Enum Drawing On: Bool selectionTolerance: Float
Button3: Enum Editing On: Bool setEventHandled: Bool
clipToSlice: Bool fixZOn: Bool shift: Enum
Color: Color ignoreHandledEvents: Bool wantsAllEvents: Bool
control: Enum interactionProviderID: String wantsKeyEvents: Bool
createNewMode: Bool maskValid: Bool wantsMouseWheelEvents: Bool

Visible Fields

Drawing On

name: drawingOn, type: Bool, default: TRUE

see SoView2DExtension.drawingOn

Editing On

name: editingOn, type: Bool, default: TRUE

see SoView2DExtension.editingOn

Color

name: color, type: Color, default: 1 1 1

see SoView2DExtension.color

Button1

name: button1, type: Enum, default: PRESSED

see SoView2DExtension.button1

Button2

name: button2, type: Enum, default: IGNORED

see SoView2DExtension.button2

Button3

name: button3, type: Enum, default: IGNORED

see SoView2DExtension.button3

Hidden Fields

interactionProviderID

name: interactionProviderID, type: String

see SoView2DExtension.interactionProviderID

maskValid

name: maskValid, type: Bool, persistent: no

fixZOn

name: fixZOn, type: Bool, default: TRUE

selectionTolerance

name: selectionTolerance, type: Float, default: 4

needsValidVoxel

name: needsValidVoxel, type: Bool, default: TRUE

see SoView2DExtension.needsValidVoxel

shift

name: shift, type: Enum, default: IGNORED

see SoView2DExtension.shift

control

name: control, type: Enum, default: IGNORED

see SoView2DExtension.control

alt

name: alt, type: Enum, default: IGNORED

see SoView2DExtension.alt

wantsAllEvents

name: wantsAllEvents, type: Bool, default: FALSE

wantsKeyEvents

name: wantsKeyEvents, type: Bool, default: FALSE

wantsMouseWheelEvents

name: wantsMouseWheelEvents, type: Bool, default: FALSE

setEventHandled

name: setEventHandled, type: Bool, default: FALSE

see SoView2DExtension.setEventHandled

ignoreHandledEvents

name: ignoreHandledEvents, type: Bool, default: FALSE

see SoView2DExtension.ignoreHandledEvents

createNewMode

name: createNewMode, type: Bool, default: FALSE

see SoView2DExtension.createNewMode

createNewModeRequest

name: createNewModeRequest, type: Trigger

see SoView2DExtension.createNewModeRequest

renderOnSlab

name: renderOnSlab, type: Bool, default: FALSE

clipToSlice

name: clipToSlice, type: Bool, default: FALSE

cursorShape

name: cursorShape, type: Enum, default: UNDEFINED_CURSOR

see SoView2DExtension.cursorShape