@@ -23,12 +23,12 @@ function vtkImageSlice(publicAPI, model) {
2323 return false ;
2424 }
2525 // make sure we have a property
26- if ( ! model . property ) {
26+ if ( ! model . properties [ 0 ] ) {
2727 // force creation of a property
2828 publicAPI . getProperty ( ) ;
2929 }
3030
31- let isOpaque = model . property . getOpacity ( ) >= 1.0 ;
31+ let isOpaque = model . properties [ 0 ] . getOpacity ( ) >= 1.0 ;
3232
3333 // are we using an opaque scalar array, if any?
3434 isOpaque = isOpaque && ( ! model . mapper || model . mapper . getIsOpaque ( ) ) ;
@@ -45,13 +45,6 @@ function vtkImageSlice(publicAPI, model) {
4545
4646 publicAPI . makeProperty = vtkImageProperty . newInstance ;
4747
48- publicAPI . getProperty = ( ) => {
49- if ( model . property === null ) {
50- model . property = publicAPI . makeProperty ( ) ;
51- }
52- return model . property ;
53- } ;
54-
5548 publicAPI . getBoundsForSlice = ( slice , thickness ) => {
5649 // Check for the special case when the mapper's bounds are unknown
5750 const bds = model . mapper . getBoundsForSlice ( slice , thickness ) ;
@@ -86,16 +79,6 @@ function vtkImageSlice(publicAPI, model) {
8679 // Get the maximum Z bound
8780 publicAPI . getMaxZBound = ( ) => publicAPI . getBounds ( ) [ 5 ] ;
8881
89- publicAPI . getMTime = ( ) => {
90- let mt = model . mtime ;
91- if ( model . property !== null ) {
92- const time = model . property . getMTime ( ) ;
93- mt = time > mt ? time : mt ;
94- }
95-
96- return mt ;
97- } ;
98-
9982 publicAPI . getRedrawMTime = ( ) => {
10083 let mt = model . mtime ;
10184 if ( model . mapper !== null ) {
@@ -108,14 +91,13 @@ function vtkImageSlice(publicAPI, model) {
10891 mt = time > mt ? time : mt ;
10992 }
11093 }
111- if ( model . property !== null ) {
112- let time = model . property . getMTime ( ) ;
113- mt = time > mt ? time : mt ;
114- if ( model . property . getRGBTransferFunction ( ) !== null ) {
115- time = model . property . getRGBTransferFunction ( ) . getMTime ( ) ;
116- mt = time > mt ? time : mt ;
94+ model . properties . forEach ( ( property ) => {
95+ mt = Math . max ( mt , property . getMTime ( ) ) ;
96+ const rgbFunc = property . getRGBTransferFunction ( ) ;
97+ if ( rgbFunc !== null ) {
98+ mt = Math . max ( mt , rgbFunc . getMTime ( ) ) ;
11799 }
118- }
100+ } ) ;
119101 return mt ;
120102 } ;
121103
@@ -129,7 +111,6 @@ function vtkImageSlice(publicAPI, model) {
129111
130112const DEFAULT_VALUES = {
131113 mapper : null ,
132- property : null ,
133114 forceOpaque : false ,
134115 forceTranslucent : false ,
135116} ;
@@ -147,7 +128,6 @@ export function extend(publicAPI, model, initialValues = {}) {
147128 macro . obj ( model . boundsMTime ) ;
148129
149130 // Build VTK API
150- macro . set ( publicAPI , model , [ 'property' ] ) ;
151131 macro . setGet ( publicAPI , model , [ 'mapper' , 'forceOpaque' , 'forceTranslucent' ] ) ;
152132
153133 // Object methods
0 commit comments