VTKView

MacroModule

genre

VTKMacros

author

MeVis Medical Solutions AG

package

MeVisLab/VTK

definition

VTKView.def

see also

View2D, View3D, SoExaminerViewer

keywords

vtkRenderer, Viewer, Examiner

Purpose

The VTKView is a convenience macro that allows to render a VTK object using the VTK class vtkRenderer.

Some display settings are available in the tab Properties.

On the tabs Input Connectors and Output Connectors, the visibility of different input and output connectors can be toggled.

The most used input is the dataSetMapper input that allows to connect a VTK data source either directly or via scripting (as shown in the example network).

Usage

This module can be used as a viewer for VTK data sets.

In the render view, the following interactions are available:

  • Key R: Center the scene

  • Key S: Use solid rendering

  • Key W: Use wireframe rendering

  • Left-Mouse button dragging: Rotate the scene

  • Shift-Left-Mouse button or middle mouse button dragging: Translate the scene

  • Right-Mouse dragging or Mouse Scroll Wheel: Scale the scene

Tips

  • This module can be used either as viewer or as a convenience module to simplify VTK module networks. It also can be used in an existing network to have a quick look at the content of data outputs.

  • The example network contains a VTKView macro with a scripted cone input. Use MLABMLBaseField.setObject on the input field to set any VTK object as input.

  • Simultaneous use of the render widget and the outputRenderer object in another render window can lead to crashes, which can be avoided by setting Enable the render tab to off.

Windows

Camera

../../../Modules/Macros/VTKView/mhelp/Images/Screenshots/VTKView.Camera.png

Input Fields

The number of input connectors is configurable; at least the connector for data sets is enabled by default, all other inputs need to be configured in the Output Connectors panel.

inputMapperLookupTable (hidden)

name: inputMapperLookupTable, type: VTKObjectWrapper(MLBase), deprecated name: dataSetMapperinputLookupTable\_vtkScalarsToColors,polyDataMapperinputLookupTable\_vtkScalarsToColors

Sets the LookupTable on the internal vtkDataSetMapper.

inputActorBackfaceProperty (hidden)

name: inputActorBackfaceProperty, type: VTKObjectWrapper(MLBase), deprecated name: actorinputBackfaceProperty\_vtkProperty

Sets the BackfaceProperty on the internal VTKActor.

inputActorTexture (hidden)

name: inputActorTexture, type: VTKObjectWrapper(MLBase), deprecated name: actorinputTexture\_vtkTexture

Sets the Texture on the internal VTKActor.

inputRendererViewProp1 (hidden)

name: inputRendererViewProp1, type: VTKObjectWrapper(MLBase), deprecated name: rendererinputvtkPropActor0

This input is added as ViewProp to the internal vtkOpenGLRenderer.

inputDataSet

name: inputDataSet, type: VTKObjectWrapper(MLBase), deprecated name: dataSetMapperinputInput\_vtkDataSet,polyDataMapperinputInput\_vtkPolyData

Sets the input vtkDataSet on the internal vtkDataSetMapper. Outputs of vtkAlgorithm objects are automatically extracted.

inputRendererViewProp2 (hidden)

name: inputRendererViewProp2, type: VTKObjectWrapper(MLBase), deprecated name: rendererinputvtkPropActor2

This input is added as ViewProp to the internal vtkOpenGLRenderer.

Output Fields

The module has a configurable number of outputs; the only default one corresponds to the actor output of the internal VTKActor module. It can be disabled in the Output Connectors panel with the Actor Output checkbox.

outputRenderer (hidden)

name: outputRenderer, type: VTKObjectWrapper(MLBase)

This gives access to the internal vtkOpenGLRenderer object.

outputActor

name: outputActor, type: VTKObjectWrapper(MLBase), deprecated name: actorOutputActor

This gives access to the internal VTKActor object.

outputDataSetMapper (hidden)

name: outputDataSetMapper, type: VTKObjectWrapper(MLBase)

This gives access to the internal vtkDataSetMapper object.

outputProperty (hidden)

name: outputProperty, type: VTKObjectWrapper(MLBase)

This gives access to the internal vtkProperty object.

Parameter Fields

Field Index

Actor Output: Bool

Position: Vector3

Scalar Visibility: Bool

BackfaceProperty Input: Bool

Property Output: Bool

Texture Property Input: Bool

Background Color: Color

Property1 Input: Bool

useCamera: Bool

Data Set Mapper Input: Bool

Property2 Input: Bool

Data Set Mapper Output: Bool

Renderer Output: Bool

Enable the render tab: Bool

Rendering Mode: Enum

Image Color: Color

repaint: Trigger

LookupTable Input: Bool

Scalar Range: Vector2

Visible Fields

LookupTable Input

name: showLookupTableInput, type: Bool, default: FALSE

If checked, the lookup table input that sets the lookup table in the internal vtkDataSetMapper object is visible.

Texture Property Input

name: showTextureInput, type: Bool, default: FALSE

If checked, the texture input that sets the texture in the internal VTKActor object is visible.

BackfaceProperty Input

name: showBackfacePropertyInput, type: Bool, default: FALSE

If checked, the BackfaceProperty input of the internal VTKActor object is visible.

Property1 Input

name: showActorProperty0Input, type: Bool, default: FALSE

If checked, the first property input of the internal vtkRenderer object is visible.

Property2 Input

name: showActorProperty2Input, type: Bool, default: FALSE

Activates the visibility of the second property input of the internal vtkRenderer object.

Data Set Mapper Input

name: showDataSetMapperInput, type: Bool, default: TRUE

If checked, the data set input of the internal vtkDataSetMapper object is visible.

Actor Output

name: showActorOutput, type: Bool, default: TRUE

If checked, the output connector with the internal VTKActor object is visible.

Data Set Mapper Output

name: showDataSetMapperOutput, type: Bool, default: FALSE

If checked, the output connector with the internal vtkDataSetMapper object is visible.

Property Output

name: showPropertyOutput, type: Bool, default: FALSE

If checked, the output connector with the internal vtkProperty object is visible.

Renderer Output

name: showRendererOutput, type: Bool, default: FALSE

If checked, the output connector with the internal vtkRenderer object is visible.

See also the notes for Enable the render tab.

Enable the render tab

name: enableRenderWidget, type: Bool, default: TRUE

If checked, the render tab in this module panel is enabled.

This can be disabled when the vtkRenderer object created by this module is used with an external vtkRenderWindow - such as a VTKRemoteRendering - because a vtkRenderer can only used with one vtkRenderWindow at a time.

Note that shared ownership can lead to crashes.

Background Color

name: background, type: Color, default: 0 0 0

Sets the Background parameter for the internal vtkRenderer object.

Position

name: position, type: Vector3, default: 0 0 0

Sets the Position parameter for the internal VTKActor object.

Scalar Visibility

name: scalarVisibility, type: Bool, default: FALSE

Sets the ScalarVisibility parameter for the internal vtkDataSetMapper object.

Scalar Range

name: scalarRange, type: Vector2, default: 0 0

Sets the ScalarRange property for the internal vtkDataSetMapper object.

Image Color

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

Sets the object color for the internal vtkProperty object.

Rendering Mode

name: representation, type: Enum, default: Surface

Defines the rendering mode (point, wireframe, surface) for the internal vtkProperty object.

Values:

Title

Name

Deprecated Name

Points

Points

0

Wireframe

Wireframe

1

Surface

Surface

2

Hidden Fields

useCamera

name: useCamera, type: Bool, default: TRUE

If checked, the internal camera is used, and the camera properties have an effect.

For documentation of the camera properties, see the documentation of vtkCamera from VTK.

repaint

name: repaint, type: Trigger

When pressed, a repaint of the vtkRenderWidget control (if visible) is triggered.