File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,22 +16,25 @@ function vtkImageResliceMapper(publicAPI, model) {
1616 // Set our className
1717 model . classHierarchy . push ( 'vtkImageResliceMapper' ) ;
1818
19- publicAPI . getBounds = ( ) => {
20- let bds = [ ...vtkBoundingBox . INIT_BOUNDS ] ;
19+ publicAPI . computeBounds = ( ) => {
2120 const image = publicAPI . getInputData ( ) ;
2221 if ( publicAPI . getSlicePolyData ( ) ) {
23- bds = publicAPI . getSlicePolyData ( ) . getBounds ( ) ;
22+ vtkBoundingBox . setBounds (
23+ model . bounds ,
24+ publicAPI . getSlicePolyData ( ) . getBounds ( )
25+ ) ;
2426 } else if ( image ) {
25- bds = image . getBounds ( ) ;
27+ vtkBoundingBox . setBounds ( model . bounds , image . getBounds ( ) ) ;
2628 if ( publicAPI . getSlicePlane ( ) ) {
2729 vtkBoundingBox . cutWithPlane (
28- bds ,
30+ model . bounds ,
2931 publicAPI . getSlicePlane ( ) . getOrigin ( ) ,
3032 publicAPI . getSlicePlane ( ) . getNormal ( )
3133 ) ;
3234 }
35+ } else {
36+ vtkBoundingBox . reset ( model . bounds ) ;
3337 }
34- return bds ;
3538 } ;
3639}
3740
Original file line number Diff line number Diff line change @@ -81,12 +81,16 @@ function vtkVolumeMapper(publicAPI, model) {
8181
8282 const superClass = { ...publicAPI } ;
8383
84- publicAPI . getBounds = ( ) => {
84+ publicAPI . computeBounds = ( ) => {
85+ const input = publicAPI . getInputData ( ) ;
86+ if ( ! input ) {
87+ vtkBoundingBox . reset ( model . bounds ) ;
88+ return ;
89+ }
8590 if ( ! model . static ) {
8691 publicAPI . update ( ) ;
8792 }
88- model . bounds = [ ...publicAPI . getInputData ( ) . getBounds ( ) ] ;
89- return model . bounds ;
93+ vtkBoundingBox . setBounds ( model . bounds , input . getBounds ( ) ) ;
9094 } ;
9195
9296 publicAPI . setBlendModeToComposite = ( ) => {
You can’t perform that action at this time.
0 commit comments