SoViewportRegion

InventorModule
genre Visualization
author Christian Schumann
package MeVisLab/Standard
dll SoUtils
definition utils.def
see also SoOrientationInset
keywords overlay

Purpose

The module SoViewportRegion renders a sub graph into a specified viewport region (VPR).

It can be compared with the picture-in-picture-function of modern TVs.

Interaction is possible in the displayed rendering. The module can also be used with SoView2D renderings. That way, you can build your own ortho-views very easily.

Usage

Connect the subgraph to the child input(s) of the SoViewportRegion.

The self-output should be connected to a viewer.

The viewer might display other graphs directly or may have additional SoViewportRegion attached (see example network).

Modify the viewport according to your needs. You can use one of the presets to start and then adjust the viewport settings according to your needs.

You can use SoViewportRegion in a nested manner. This means, a SoViewportRegion that is the child of another SoViewportRegion, may use the previously defined viewport region and modify it instead of modifying the original window ("Relate to existing viewport region" has to be activated; see example network). This may be useful if you want to define some kind of margin, which may be complicated with the viewport definition parameters alone.

Windows

Default Panel

../../../Modules/Inventor/SoUtils/mhelp/Images/Screenshots/SoViewportRegion._default.png

Input Fields

child

name: child, type: SoNode

Output Fields

self

name: self, type: SoNode

Parameter Fields

Visible Fields

On

name: on, type: Bool, default: TRUE

If checked, the module is active.

Modify viewport region

name: modifyVP, type: Bool, default: TRUE

If checked, the current viewport region will be modified.

Otherwise, the module uses the whole viewer or a previously attached viewport region.

Relate to existing viewport region

name: usePreviousVP, type: Bool, default: FALSE

If checked, the modifications will relate to an existing viewport region (which may have been defined by another SoViewportRegion instance).

Otherwise, the changes relate to the original window and the existing viewport region will be overridden for the child graph.

Mode (xPositionMode)

name: xPositionMode, type: Enum, default: POSITION_MODE_MIN_AND_MAX

Defines the positioning mode in x-direction.

Values:

Title Name Description
Define left and right border of viewport region (VPR) POSITION_MODE_MIN_AND_MAX X1 and X2 act as minimum and maximum values horizontally.
Define center and width of viewport region (VPR) POSITION_MODE_CENTER_AND_SIZE X1 and X2 act as center and size horizontally.
Define left border and width of viewport region (VPR) POSITION_MODE_MIN_AND_SIZE X1 and X2 act as minimum value and size horizontally.
Define right border and width of viewport region (VPR) POSITION_MODE_MAX_AND_SIZE X1 and X2 act as maximum value and size horizontally.

X1

name: x1, type: Float, default: 0.5

Sets the minimum/center horizontally.

Reference (x1ReferenceMode)

name: x1ReferenceMode, type: Enum, default: REFERENCE_MODE_MIN

Defines from where the values for X1 are measured.

Basically,the parameter allows to specify the alignment. Note, that you can use different reference for the left and right border for example. This allows for the definition of some kind of border for example (see example network).

Values:

Title Name Description
Left window border REFERENCE_MODE_MIN Value (X1, X2, Y1, Y2) relates to the left (x) / lower (y) border of the window (or previously defined viewport).
Window center REFERENCE_MODE_CENTER Value relates window center (or to the center of a previously defined viewport).
Right window border REFERENCE_MODE_MAX Value relates to the right (x) / upper (y) border of the window (or previously defined viewport).

Domain (x1DomainMode)

name: x1DomainMode, type: Enum, default: DOMAIN_MODE_RELATIVE_TO_WIDTH

Defines how the value of X1 is interpreted.

Values:

Title Name Description
Pixels DOMAIN_MODE_ABSOLUTE Value is interpreted as an absolute value in pixel.
Fraction of height DOMAIN_MODE_RELATIVE_TO_HEIGHT value is interpreted relative to the viewer's height.
Fraction of width DOMAIN_MODE_RELATIVE_TO_WIDTH Value is interpreted relative to the viewer's width.
Fraction of smallest dimension DOMAIN_MODE_RELATIVE_TO_MIN Value is interpreted relative to the viewer's minimum value.
Fraction of largest dimension DOMAIN_MODE_RELATIVE_TO_MAX Value is interpreted relative to the viewer's maximum value.

X2

name: x2, type: Float, default: 1

Sets the maximum/width horizontally.

Reference (x2ReferenceMode)

name: x2ReferenceMode, type: Enum, default: REFERENCE_MODE_MIN

Defines from where the values for X2 are measured.

Values:

Title Name
Left window border REFERENCE_MODE_MIN
Window center REFERENCE_MODE_CENTER
Right window border REFERENCE_MODE_MAX

Domain (x2DomainMode)

name: x2DomainMode, type: Enum, default: DOMAIN_MODE_RELATIVE_TO_WIDTH

Defines how the value of X2 is interpreted.

Values:

Title Name
Pixels DOMAIN_MODE_ABSOLUTE
Fraction of height DOMAIN_MODE_RELATIVE_TO_HEIGHT
Fraction of width DOMAIN_MODE_RELATIVE_TO_WIDTH
Fraction of smallest dimension DOMAIN_MODE_RELATIVE_TO_MIN
Fraction of largest dimension DOMAIN_MODE_RELATIVE_TO_MAX

Mode (yPositionMode)

name: yPositionMode, type: Enum, default: POSITION_MODE_MIN_AND_MAX

Defines the positioning mode in y-direction.

Values:

Title Name
Define lower and upper border of viewport region (VPR) POSITION_MODE_MIN_AND_MAX
Define center and height of viewport region (VPR) POSITION_MODE_CENTER_AND_SIZE
Define lower border and height of viewport region (VPR) POSITION_MODE_MIN_AND_SIZE
Define upper border and height of viewport region (VPR) POSITION_MODE_MAX_AND_SIZE

Y1

name: y1, type: Float, default: 0.5

Sets the minimum/center vertically.

Reference (y1ReferenceMode)

name: y1ReferenceMode, type: Enum, default: REFERENCE_MODE_MAX

Defines from where the values for Y1 are measured.

Values:

Title Name
Lower window border REFERENCE_MODE_MIN
Window center REFERENCE_MODE_CENTER
Upper window border REFERENCE_MODE_MAX

Domain (y1DomainMode)

name: y1DomainMode, type: Enum, default: DOMAIN_MODE_RELATIVE_TO_HEIGHT

Defines how the value of Y1 is interpreted.

Values:

Title Name
Pixels DOMAIN_MODE_ABSOLUTE
Fraction of height DOMAIN_MODE_RELATIVE_TO_HEIGHT
Fraction of width DOMAIN_MODE_RELATIVE_TO_WIDTH
Fraction of smallest dimension DOMAIN_MODE_RELATIVE_TO_MIN
Fraction of largest dimension DOMAIN_MODE_RELATIVE_TO_MAX

Y2

name: y2, type: Float, default: 1

Sets the maximum/height vertically.

Reference (y2ReferenceMode)

name: y2ReferenceMode, type: Enum, default: REFERENCE_MODE_MAX

Defines from where the values for Y2 are measured.

Values:

Title Name
Lower window border REFERENCE_MODE_MIN
Window center REFERENCE_MODE_CENTER
Upper window border REFERENCE_MODE_MAX

Domain (y2DomainMode)

name: y2DomainMode, type: Enum, default: DOMAIN_MODE_RELATIVE_TO_HEIGHT

Defines how the value of Y2 is interpreted.

Values:

Title Name
Pixels DOMAIN_MODE_ABSOLUTE
Fraction of height DOMAIN_MODE_RELATIVE_TO_HEIGHT
Fraction of width DOMAIN_MODE_RELATIVE_TO_WIDTH
Fraction of smallest dimension DOMAIN_MODE_RELATIVE_TO_MIN
Fraction of largest dimension DOMAIN_MODE_RELATIVE_TO_MAX

Detect if mouse is over the viewport

name: detectMouseOver, type: Bool, default: FALSE

If checked, the module detects whether the mouse is over the viewport.

Mouse is over

name: mouseOverViewport, type: Bool, persistent: no

Shows whether the mouse is over the viewport.

Forward events to child graph

name: forwardEvents, type: Bool, default: TRUE

If checked, events will be evaluated by the child graph.

In viewport only

name: forwardEventsInViewportOnly, type: Bool, default: TRUE

If checked, only events that occur in the viewport are forwarded to the child graph (should be checked in most cases).

Map to viewport

name: mapEventToViewport, type: Bool, default: TRUE

If checked, the event coordinates will be mapped to the viewport region (should be checked in most cases).

Otherwise event handling inside the child graph will not work as expected.

Consume events in viewport

name: consumeEventsInViewport, type: Bool, default: TRUE

If checked, all events that occur in the viewport region will be consumed.

Even if there is no module in the sub graph that reacts to the event, the event will be consumed by the SoViewportRegion module itself. This avoids the handling of the event by a module that is not in the SoViewportRegion.

Preset

name: preset, type: Enum, default: centeredThird

Defines a preset for positioning the viewport inside a viewer.

Values:

Title Name
Centered and third of dimensions centeredThird
Centered and third of minimum dimension centeredMinThird
Centered and fixed size centeredFixed
Upper left corner and third of minimum dimension upperLeftMinThird
Upper right corner and third of minimum dimension upperRightMinThird
Lower left corner and third of minimum dimension lowerLeftMinThird
Lower right corner and third of minimum dimension lowerRightMinThird
20 Pixel margin margin

Hidden Fields

projectionType

name: projectionType, type: Enum, default: ORTHOGRAPHIC

Values:

Title Name
Orthographic ORTHOGRAPHIC
Perspective PERSPECTIVE
Auto AUTO
Unmodified UNMODIFIED

renderDelayedPaths

name: renderDelayedPaths, type: Bool, default: TRUE

x1Title (hidden)

name: x1Title, type: String, persistent: no

x2Title (hidden)

name: x2Title, type: String, persistent: no

y1Title (hidden)

name: y1Title, type: String, persistent: no

y2Title (hidden)

name: y2Title, type: String, persistent: no