SoView2DScene¶
- InventorModule¶
genre
author
package
dll
definition
see also
inherits from
keywords
Purpose¶
The module SoView2DScene renders an Open Inventor scene graph into 2D slices.
Only the part of the scene that fits into the current slice or slab is displayed.
Details¶
The scene graph rendered by this module is transformed from world space into voxel space and clipped against the top and bottom slice. Since the scene is rendered with OpenGL directly into the slice, it is displayed with pixel accuracy, which is often more accurate than a rasterized voxel representation.
This module is very useful in combination with the SoGVRVolumeRenderer, since it allows for rendering a GVR slab rendering onto any SoView2D coordinate system. Have a look at the SoGVRSlabHint example network for an example usage.
Windows¶
Default Panel¶
Input Fields¶
sceneGraph¶
- name: sceneGraph, type: SoNode¶
Output Fields¶
self¶
- name: self, type: SoNode¶
Parameter Fields¶
Field Index¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Visible Fields¶
Drawing On¶
- name: drawingOn, type: Bool, default: TRUE¶
If checked, the module renders geometry onto the current slice.
see also SoView2DExtension.drawingOn
Color¶
- name: color, type: Color, default: 1 1 1¶
Sets a default diffuse color of the rendered scene.
This color may be overwritten by any color node such as
SoBaseColororSoMaterial.
see also SoView2DExtension.color
Send Events To Scene¶
- name: sendEventsToScene, type: Bool, default: FALSE¶
If checked, mouse events are forwarded to the 3D scene.
If you do not want to pass all mouse events to the scene, you can set the
button1,button2,button3,shift,control, andaltmask to something different than IGNORED, and also can unsetwantsAllEvents.You can also set the
wantsKeyEventsandwantsMouseWheelEventsto forward these event types to the scene.
Slab Size¶
Slab Mode¶
- name: slabMode, type: Enum, default: USE_VIEW2D_SLAB_SIZE¶
Defines the slab mode.
Pseudo code that shows the slab calculation (using Python syntax, note that the end position is +1 because of range() at the bottom):
mode = ctx.field("SoView2DScene.slabMode").value slabSize = ctx.field("SoView2DScene.slabSize").value startSlice = ctx.field("SoView2D.startSlice").value voxelSizeZ = ctx.field("SoView2D.image").voxelSizeZ() if mode == "SLAB_SIZE_IN_SLICES": slabSize = int(slabSize) start = startSlice - (slabSize-1)//2 end = startSlice + 1 + slabSize//2 elif mode == "USE_VIEW2D_SLAB_SIZE": slabSize = int(ctx.field("SoView2D.slab").value) start = startSlice - (slabSize-1)//2 end = startSlice + 1 + slabSize//2 elif mode == "SLAB_SIZE_IN_SLICES_NEGATIVE_FIRST": slabSize = int(slabSize) start = startSlice - slabSize//2 end = startSlice + 1 + (slabSize-1)//2 elif mode == "SLAB_SIZE_IN_SLICES_FORWARD": slabSize = int(slabSize) start = startSlice end = startSlice + slabSize elif mode == "SLAB_SIZE_IN_MM_FORWARD": slabSize = math.floor(slabSize/voxelSizeZ + 0.5) if slabSize < 1: slabSize = 1 start = int(startSlice) end = int(math.ceil(startSlice + slabSize)) elif mode == "SLAB_SIZE_IN_MM": slabSize = slabSize/voxelSizeZ if slabSize < 1: slabSize = 1 start = int(math.ceil(startSlice - slabSize/2.)) end = int(math.floor(startSlice + 1 + slabSize/2.)) # clip to dataset if start<0: start = 0 maxSlice = int(ctx.field("SoView2D.maxSlice").value); if end>maxSlice+1: end = maxSlice+1 # return the expected range return range(start, end)
Values:
Title |
Name |
Description |
|---|---|---|
Use View2d Slab Size |
USE_VIEW2D_SLAB_SIZE |
Uses the slab parameter of the attached |
Slab Size In Mm |
SLAB_SIZE_IN_MM |
Uses the |
Slab Size In Mm Forward |
SLAB_SIZE_IN_MM_FORWARD |
Uses the |
Slab Size In Slices |
SLAB_SIZE_IN_SLICES |
Uses the |
Slab Size In Slices Negative First |
SLAB_SIZE_IN_SLICES_NEGATIVE_FIRST |
Uses the |
Slab Size In Slices Forward |
SLAB_SIZE_IN_SLICES_FORWARD |
Uses the |
Slab Size Unlimited |
SLAB_SIZE_UNLIMITED |
Does not set any clipping planes and thus renders all geometry that is visible. Note: this is not supported by the |
Lighting Model¶
- name: lightingModel, type: Enum, default: BASE_COLOR¶
Defines the lighting model.
Values:
Title |
Name |
|---|---|
Base Color |
BASE_COLOR |
Phong |
PHONG |