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

The module SoView2DLabel displays 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 Open Inventor 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 Open Inventor scene.

Parameter Fields

Field Index

Alpha (alpha): Float

Depth Visibility: Float

Relative Viewer Position: Vector2

Alpha (backgroundAlpha): Float

Depth Visibility Mode: Enum

renderOnSlab: Bool

Alt: Enum

doubleClicked: Trigger

selectionTolerance: Float

Background: Color

Draw Background: Bool

setEventHandled: Bool

backgroundMarginBottom: Float

Draw text shadow: Bool

Shift: Enum

backgroundMarginLeft: Float

Drawing On: Bool

Show label on all time points: Bool

backgroundMarginRight: Float

Editing On: Bool

singleClicked: Trigger

backgroundMarginTop: Float

Font Size: Integer

Snap to slice on drag: Bool

Border Color: Color

Font Size Mode: Enum

Text: String

Border Mode: Enum

highlighted: Bool

Text Positioning: Enum

Button1: Enum

Horizontal Position: Enum

Time Point: Integer

Button2: Enum

ignoreHandledEvents: Bool

Use Depth Visibility: Bool

Button3: Enum

interactionProviderID: String

Vertical Position: Enum

clipToSlice: Bool

isUnderMouse: Bool

Viewer Id: String

Color: Color

Keep Label In Viewer: Bool

wantsAllEvents: Bool

Control: Enum

keepCursorPositionInViewerWhenMoving: Bool

wantsKeyEvents: Bool

createNewMode: Bool

maskValid: Bool

wantsMouseWheelEvents: Bool

createNewModeRequest: Trigger

needsValidVoxel: Bool

World Position: Vector3

Cursor Shape: Enum

Offset (verticalOffset): Float

Depth Minimum Alpha: Float

Offset (horizontalOffset): Float

Visible Fields

Drawing On

name: drawingOn, type: Bool, default: TRUE

If checked, the label is rendered.

see also SoView2DExtension.drawingOn

Editing On

name: editingOn, type: Bool, default: FALSE

If checked, 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 checked, the world coordinate is snapped to the current slice on dragging (only if Text Positioning is WORLD_COORDINATES).

Color

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

Sets the 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

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

Viewer Id

name: viewerId, type: String

Sets 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

Sets 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

If checked, the label is kept 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

If checked, the depth visibility feature is enabled.

This only works if World Position is used.

Depth Visibility

name: depthVisibility, type: Float, default: 1

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

Depth Visibility Mode

name: depthVisibilityMode, type: Enum, default: DEPTH_IN_SLICES

Defines the units for Depth Visibility.

Values:

Title

Name

Description

​Slices

​DEPTH_IN_SLICES

​:field:depthVisibility is given in number of slices.

​Mm

​DEPTH_IN_MM

​:field:depthVisibility is given in millimeters.

Depth Minimum Alpha

name: depthMinimumAlpha, type: Float, default: 0

Sets 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

Sets the time point at which to show this label.

Show label on all time points

name: showLabelOnAllTimePoints, type: Bool, default: TRUE

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

Offset (verticalOffset)

name: verticalOffset, type: Float, default: 0

Sets 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

Defines 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

Sets 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

Defines 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

Sets the font size of the label.

Font Size Mode

name: fontSizeMode, type: Enum, default: FONT_SIZE_IN_PIXELS

Defines the unit for Font Size.

Values:

Title

Name

Description

​Mm

​FONT_SIZE_IN_MM

​:field:fontSize is given in millimeters.

​Pixels

​FONT_SIZE_IN_PIXELS

​:field:fontSize is given in pixels.

​Voxels

​FONT_SIZE_IN_VOXELS

​:field:fontSize 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

Sets the 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

If checked, a (black) text shadow is displayed.

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

Sets the 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

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

Draw Background

name: drawBackground, type: Bool, default: FALSE

If checked, the background is shown.

Alpha (backgroundAlpha)

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

Sets an 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

Shows whether 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 pixels of the background to the top.

backgroundMarginRight

name: backgroundMarginRight, type: Float, default: 0

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

backgroundMarginBottom

name: backgroundMarginBottom, type: Float, default: 0

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

backgroundMarginLeft

name: backgroundMarginLeft, type: Float, default: 0

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

isUnderMouse

name: isUnderMouse, type: Bool, persistent: no