SoView2DLabel

InventorModule
genre View2DExtended
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll SoView2D
definition view2d.def
see also SoView2D, SoView2DAnnotation, SoView2DVoxelValue
inherits from SoView2DExtension
keywords Label, String, Annotation, Position, Text, Font

Purpose

This module shows a text label at a given world position in a 2D viewer.

Usage

Provide the world position and a string to display, and add this module into an OpenInventor scene before an SoView2D module.

Windows

Default Panel

../../../Modules/Inventor/SoView2D/mhelp/Images/Screenshots/SoView2DLabel._default.png

Output Fields

self

name: self, type: SoNode

Connect this to an OpenInventor scene.

Parameter Fields

Visible Fields

Drawing On

name: drawingOn, type: Bool, default: TRUE

Determines if the label is shown or not.

see also SoView2DExtension.drawingOn

Editing On

name: editingOn, type: Bool, default: FALSE

If set, the label can be moved with the mouse cursor.

This is implemented with Managed Interaction. The pointing action is named “moveLabel”.

see also SoView2DExtension.editingOn

Snap to slice on drag

name: fixZOn, type: Bool, default: TRUE

If set, snap the world coordinate to the current slice on dragging (only if Text Positioning is WORLD_COORDINATES).

Color

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

Text color of the label.

see also 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

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

Cursor Shape

name: cursorShape, type: Enum, default: UNDEFINED_CURSOR

see SoView2DExtension.cursorShape

Text

name: text, type: String

The text to display. The text may contain multiple lines.

Viewer Id

name: viewerId, type: String

The name of the viewer to display this label in. If you leave this empty, the label will be shown in every connected viewer that shows this world coordinates. Otherwise the label will only be shown in the SoView2D with this exact name.

Text Positioning

name: textPositioning, type: Enum, default: WORLD_COORDINATES

Defines how the text position set.

Values:

Title Name Description
World Coordinates WORLD_COORDINATES The position is set as world coordinates which are transformed to viewer space.
Relative To Viewer RELATIVE_TO_VIEWER The position is set relative to the viewer’s visible device rectangle in [0..1].

World Position

name: worldPosition, type: Vector3, default: 0 0 0

The position in world coordinates this label is referring to.

Relative Viewer Position

name: relativeViewerPosition, type: Vector2, default: 0.5 0.5

Sets a relative viewer position for the text.

Keep Label In Viewer

name: keepLabelInViewer, type: Bool, default: TRUE

Keep the label inside the viewer even when its position is panned out of the viewer (only works when World Position is used).

Use Depth Visibility

name: useDepthVisibility, type: Bool, default: FALSE

Enables the depth visibility feature (only works when World Position is used).

Depth Visibility

name: depthVisibility, type: Float, default: 1

Selects the distance of the depth visibility (in voxels or mm, depending on Depth Visibility Mode).

Depth Visibility Mode

name: depthVisibilityMode, type: Enum, default: DEPTH_IN_SLICES

Selects the units for Depth Visibility.

Values:

Title Name Description
Slices DEPTH_IN_SLICES Depth Visibility is given in number of slices.
Mm DEPTH_IN_MM Depth Visibility is given in millimeters.

Depth Minimum Alpha

name: depthMinimumAlpha, type: Float, default: 0

Selects the minimum alpha that is used for depth visibility. If the label is outside of the depth visibility range, it will get this alpha value.

Time Point

name: timePoint, type: Integer, default: 0

The time point at which to show this label.

Show label on all time points

name: showLabelOnAllTimePoints, type: Bool, default: TRUE

If set, the label is shown for all time points, regardless of the value of Time Point.

Offset (verticalOffset)

name: verticalOffset, type: Float, default: 0

The vertical offset (in device coordinates - that is pixels) to the world position to display the label at.

Vertical Position

name: verticalPosition, type: Enum, default: POS_VCENTER

Where to (vertically) put the label relative to the point described by World Position and Offset.

Values:

Title Name Description
Above POS_ABOVE Position label so that it is just above the point.
Vcenter POS_VCENTER Position label so that it is vertically centered over the point.
Below POS_BELOW Position label so that it is just below the point.

Offset (horizontalOffset)

name: horizontalOffset, type: Float, default: 0

The horizontal offset (in device coordinates - that is pixels) to the world position to display the label at.

Horizontal Position

name: horizontalPosition, type: Enum, default: POS_RIGHT

Where to (horizontally) put the label relative to the point described by World Position and Offset.

Values:

Title Name Description
Left POS_LEFT Position label so that it is just left of the point.
Hcenter POS_HCENTER Position label so that it is horizontally centered over the point.
Right POS_RIGHT Position label so that it is just right of the point.

Font Size

name: fontSize, type: Integer, default: 12

Font size of the label.

Font Size Mode

name: fontSizeMode, type: Enum, default: FONT_SIZE_IN_PIXELS

Selects the unit for Font Size.

Values:

Title Name Description
Mm FONT_SIZE_IN_MM Font Size is given in millimeters.
Pixels FONT_SIZE_IN_PIXELS Font Size is given in pixels.
Voxels FONT_SIZE_IN_VOXELS Font Size is given in voxels (or, more precisely, in multiples of the width of a voxel).

Alpha (alpha)

name: alpha, type: Float, default: 1, minimum: 0, maximum: 1

Alpha (opacity) value of the label. 1 means the label obscures the image below completely, 0 means the label is invisible.

Draw text shadow

name: textShadow, type: Bool, default: FALSE

Whether to display a (black) text shadow. This can improve readability on bright images. The type of shadow depends on system settings.

Border Mode

name: borderMode, type: Enum, default: SHOW_BORDER_OFF, deprecated name: drawBorderWhenHighlighted

Defines the border mode of the background.

Values:

Title Name Deprecated Name Description
Off SHOW_BORDER_OFF False The background never has a border.
When Highlighted SHOW_BORDER_WHEN_HIGHLIGHTED True The background only has a border if the label is highlighted.
Always SHOW_BORDER_ALWAYS   The border of the background is always rendered.

Border color

name: borderColor, type: Color, default: 1 1 1

Border color of the label (only works when Border Mode is not set to SHOW_BORDER_OFF).

Background

name: backgroundColor, type: Color, default: 0 0 0

Background color of the label (only works when Draw Background is used).

Draw Background

name: drawBackground, type: Bool, default: FALSE

Determines if the background is shown or not.

Alpha (backgroundAlpha)

name: backgroundAlpha, type: Float, default: 1, minimum: 0, maximum: 1

Alpha (opacity) value of the background. 1 means the label obscures the image below completely, 0 means the label is invisible (only works when Draw Background is used).

Hidden Fields

interactionProviderID

name: interactionProviderID, type: String

see SoView2DExtension.interactionProviderID

maskValid

name: maskValid, type: Bool, persistent: no

selectionTolerance

name: selectionTolerance, type: Float, persistent: no

needsValidVoxel

name: needsValidVoxel, type: Bool, persistent: no

see SoView2DExtension.needsValidVoxel

wantsAllEvents

name: wantsAllEvents, type: Bool, persistent: no

wantsKeyEvents

name: wantsKeyEvents, type: Bool, persistent: no

wantsMouseWheelEvents

name: wantsMouseWheelEvents, type: Bool, persistent: no

setEventHandled

name: setEventHandled, type: Bool, persistent: no

see SoView2DExtension.setEventHandled

ignoreHandledEvents

name: ignoreHandledEvents, type: Bool, persistent: no

see SoView2DExtension.ignoreHandledEvents

createNewMode

name: createNewMode, type: Bool, persistent: no

see SoView2DExtension.createNewMode

createNewModeRequest

name: createNewModeRequest, type: Trigger, persistent: no

see SoView2DExtension.createNewModeRequest

renderOnSlab

name: renderOnSlab, type: Bool, persistent: no

clipToSlice

name: clipToSlice, type: Bool, persistent: no

singleClicked

name: singleClicked, type: Trigger, persistent: no

doubleClicked

name: doubleClicked, type: Trigger, persistent: no

keepCursorPositionInViewerWhenMoving

name: keepCursorPositionInViewerWhenMoving, type: Bool, default: FALSE

highlighted

name: highlighted, type: Bool, persistent: no

If this flag is set, the mouse cursor is over the label and the user can move the label.

backgroundMarginTop

name: backgroundMarginTop, type: Float, default: 0

Sets a margin in pixel of the background to the top.

backgroundMarginRight

name: backgroundMarginRight, type: Float, default: 0

Sets a margin in pixel of the background to the right.

backgroundMarginBottom

name: backgroundMarginBottom, type: Float, default: 0

Sets a margin in pixel of the background to the bottom.

backgroundMarginLeft

name: backgroundMarginLeft, type: Float, default: 0

Sets a margin in pixel of the background to the left.

isUnderMouse

name: isUnderMouse, type: Bool, persistent: no