File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Core/AbstractRepresentationProxy
Representations/SliceRepresentationProxy Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ function vtkAbstractRepresentationProxy(publicAPI, model) {
2727 publicAPI . updateColorByDomain ( ) ;
2828 } ;
2929
30- publicAPI . getInputDataSet = ( ) => model . input . getDataset ( ) ;
30+ publicAPI . getInputDataSet = ( ) => model . input ? model . input . getDataset ( ) : null ;
3131
3232 publicAPI . getDataArray = ( arrayName , arrayLocation ) => {
3333 const [ selectedArray , selectedLocation ] = publicAPI . getColorBy ( ) ;
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ function vtkSliceRepresentationProxy(publicAPI, model) {
123123 model . mapper [ `set${ model . slicingMode } Slice` ] ( index ) ;
124124
125125 publicAPI . getSliceIndex = ( ) =>
126- model . mapper [ `get${ model . slicingMode } Slice` ] ( ) ;
126+ model . slicingMode ? model . mapper [ `get${ model . slicingMode } Slice` ] ( ) : 0 ;
127127
128128 publicAPI . setSlicingMode = ( mode ) => {
129129 if ( ! mode ) {
@@ -148,8 +148,12 @@ function vtkSliceRepresentationProxy(publicAPI, model) {
148148
149149 // Used for UI
150150 publicAPI . getSliceIndexValues = ( ) => {
151+ const ds = publicAPI . getInputDataSet ( ) ;
152+ if ( ! ds ) {
153+ return [ ] ;
154+ }
151155 const values = [ ] ;
152- const extent = publicAPI . getInputDataSet ( ) . getExtent ( ) ;
156+ const extent = ds . getExtent ( ) ;
153157 const axisIndex = 'XYZ' . indexOf ( model . slicingMode ) ;
154158 const endValue = extent [ axisIndex * 2 + 1 ] ;
155159 let currentValue = extent [ axisIndex * 2 ] ;
You can’t perform that action at this time.
0 commit comments