Cloned library of VTK-5.0.0 with extra build files for internal package management.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

38 lines
940 B

package require -exact vtkrendering 5.0
namespace eval ::vtk {
proc grab_screenshot {renderer basename} {
$renderer Render
set rs \
[::vtk::new_widget_object "_${renderer}" vtkRendererSource rs]
$rs SetInput $renderer
$rs DepthValuesOff
$rs DepthValuesInScalarsOn
set pw \
[::vtk::new_widget_object "_${renderer}" vtkPNGWriter pw]
$pw SetInput [$rs GetOutput]
$pw SetFileName "$basename-rgbz.png"
$pw Write
set iec \
[::vtk::new_widget_object "_${renderer}" vtkImageExtractComponents iec]
$iec SetInput [$rs GetOutput]
$iec SetComponents 3
$pw SetInput [$iec GetOutput]
$pw SetFileName "$basename-z.png"
$pw Write
$iec SetComponents 0 1 2
$pw SetFileName "$basename-rgb.png"
$pw Write
$rs Delete
$pw Delete
$iec Delete
}
}