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) {
27
27
publicAPI . updateColorByDomain ( ) ;
28
28
} ;
29
29
30
- publicAPI . getInputDataSet = ( ) => model . input . getDataset ( ) ;
30
+ publicAPI . getInputDataSet = ( ) => model . input ? model . input . getDataset ( ) : null ;
31
31
32
32
publicAPI . getDataArray = ( arrayName , arrayLocation ) => {
33
33
const [ selectedArray , selectedLocation ] = publicAPI . getColorBy ( ) ;
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ function vtkSliceRepresentationProxy(publicAPI, model) {
123
123
model . mapper [ `set${ model . slicingMode } Slice` ] ( index ) ;
124
124
125
125
publicAPI . getSliceIndex = ( ) =>
126
- model . mapper [ `get${ model . slicingMode } Slice` ] ( ) ;
126
+ model . slicingMode ? model . mapper [ `get${ model . slicingMode } Slice` ] ( ) : 0 ;
127
127
128
128
publicAPI . setSlicingMode = ( mode ) => {
129
129
if ( ! mode ) {
@@ -148,8 +148,12 @@ function vtkSliceRepresentationProxy(publicAPI, model) {
148
148
149
149
// Used for UI
150
150
publicAPI . getSliceIndexValues = ( ) => {
151
+ const ds = publicAPI . getInputDataSet ( ) ;
152
+ if ( ! ds ) {
153
+ return [ ] ;
154
+ }
151
155
const values = [ ] ;
152
- const extent = publicAPI . getInputDataSet ( ) . getExtent ( ) ;
156
+ const extent = ds . getExtent ( ) ;
153
157
const axisIndex = 'XYZ' . indexOf ( model . slicingMode ) ;
154
158
const endValue = extent [ axisIndex * 2 + 1 ] ;
155
159
let currentValue = extent [ axisIndex * 2 ] ;
You can’t perform that action at this time.
0 commit comments