File tree Expand file tree Collapse file tree 5 files changed +32
-45
lines changed
Sources/Widgets/Representations
ArrowHandleRepresentation
CircleContextRepresentation
SphereContextRepresentation
SphereHandleRepresentation Expand file tree Collapse file tree 5 files changed +32
-45
lines changed Original file line number Diff line number Diff line change @@ -251,17 +251,15 @@ function vtkArrowHandleRepresentation(publicAPI, model) {
251
251
return orientationRotation ;
252
252
}
253
253
254
+ const superGetRepresentationStates = publicAPI . getRepresentationStates ;
255
+ publicAPI . getRepresentationStates = ( input = model . inputData [ 0 ] ) =>
256
+ superGetRepresentationStates ( input ) . filter (
257
+ ( state ) => state . getOrigin ?. ( ) && state . isVisible ?. ( )
258
+ ) ;
259
+
254
260
publicAPI . requestDataInternal = ( inData , outData ) => {
255
261
const { points, scale, color, direction } = model . internalArrays ;
256
- const list = publicAPI
257
- . getRepresentationStates ( inData [ 0 ] )
258
- . filter (
259
- ( state ) =>
260
- state . getOrigin &&
261
- state . getOrigin ( ) &&
262
- state . isVisible &&
263
- state . isVisible ( )
264
- ) ;
262
+ const list = publicAPI . getRepresentationStates ( inData [ 0 ] ) ;
265
263
const totalCount = list . length ;
266
264
267
265
if ( color . getNumberOfValues ( ) !== totalCount ) {
Original file line number Diff line number Diff line change @@ -111,19 +111,16 @@ function vtkCircleContextRepresentation(publicAPI, model) {
111
111
model . pipelines . circle . actor . getProperty ( ) . setOpacity ( opacity ) ;
112
112
} ;
113
113
114
+ const superGetRepresentationStates = publicAPI . getRepresentationStates ;
115
+ publicAPI . getRepresentationStates = ( input = model . inputData [ 0 ] ) =>
116
+ superGetRepresentationStates ( input ) . filter (
117
+ ( state ) => state . getOrigin ?. ( ) && state . isVisible ?. ( )
118
+ ) ;
114
119
// --------------------------------------------------------------------------
115
120
116
121
publicAPI . requestData = ( inData , outData ) => {
117
122
const { points, scale, color, direction } = model . internalArrays ;
118
- const list = publicAPI
119
- . getRepresentationStates ( inData [ 0 ] )
120
- . filter (
121
- ( state ) =>
122
- state . getOrigin &&
123
- state . getOrigin ( ) &&
124
- state . isVisible &&
125
- state . isVisible ( )
126
- ) ;
123
+ const list = publicAPI . getRepresentationStates ( inData [ 0 ] ) ;
127
124
const totalCount = list . length ;
128
125
129
126
if ( color . getNumberOfValues ( ) !== totalCount ) {
Original file line number Diff line number Diff line change @@ -55,19 +55,16 @@ function vtkCubeHandleRepresentation(publicAPI, model) {
55
55
56
56
publicAPI . addActor ( model . actor ) ;
57
57
58
+ const superGetRepresentationStates = publicAPI . getRepresentationStates ;
59
+ publicAPI . getRepresentationStates = ( input = model . inputData [ 0 ] ) =>
60
+ superGetRepresentationStates ( input ) . filter (
61
+ ( state ) => state . getOrigin ?. ( ) && state . isVisible ?. ( )
62
+ ) ;
58
63
// --------------------------------------------------------------------------
59
64
60
65
publicAPI . requestData = ( inData , outData ) => {
61
66
const { points, scale, color } = model . internalArrays ;
62
- const list = publicAPI
63
- . getRepresentationStates ( inData [ 0 ] )
64
- . filter (
65
- ( state ) =>
66
- state . getOrigin &&
67
- state . getOrigin ( ) &&
68
- state . isVisible &&
69
- state . isVisible ( )
70
- ) ;
67
+ const list = publicAPI . getRepresentationStates ( inData [ 0 ] ) ;
71
68
const totalCount = list . length ;
72
69
73
70
if ( color . getNumberOfValues ( ) !== totalCount ) {
Original file line number Diff line number Diff line change @@ -63,17 +63,14 @@ function vtkSphereContextRepresentation(publicAPI, model) {
63
63
publicAPI . setOpacity = ( opacity ) => {
64
64
model . pipelines . circle . actor . getProperty ( ) . setOpacity ( opacity ) ;
65
65
} ;
66
+ const superGetRepresentationStates = publicAPI . getRepresentationStates ;
67
+ publicAPI . getRepresentationStates = ( input = model . inputData [ 0 ] ) =>
68
+ superGetRepresentationStates ( input ) . filter (
69
+ ( state ) => state . getOrigin ?. ( ) && state . isVisible ?. ( )
70
+ ) ;
66
71
publicAPI . requestData = ( inData , outData ) => {
67
72
const { points, scale, color } = model . internalArrays ;
68
- const list = publicAPI
69
- . getRepresentationStates ( inData [ 0 ] )
70
- . filter (
71
- ( state ) =>
72
- state . getOrigin &&
73
- state . getOrigin ( ) &&
74
- state . isVisible &&
75
- state . isVisible ( )
76
- ) ;
73
+ const list = publicAPI . getRepresentationStates ( inData [ 0 ] ) ;
77
74
const totalCount = list . length ;
78
75
79
76
if ( color . getNumberOfValues ( ) !== totalCount ) {
Original file line number Diff line number Diff line change @@ -104,19 +104,17 @@ function vtkSphereHandleRepresentation(publicAPI, model) {
104
104
model . displayMapper . setCallback ( callback ? callbackProxy : null ) ;
105
105
} ;
106
106
107
+ const superGetRepresentationStates = publicAPI . getRepresentationStates ;
108
+ publicAPI . getRepresentationStates = ( input = model . inputData [ 0 ] ) =>
109
+ superGetRepresentationStates ( input ) . filter (
110
+ ( state ) => state . getOrigin ?. ( ) && state . isVisible ?. ( )
111
+ ) ;
112
+
107
113
// --------------------------------------------------------------------------
108
114
109
115
publicAPI . requestData = ( inData , outData ) => {
110
116
const { points, scale, color } = model . internalArrays ;
111
- const list = publicAPI
112
- . getRepresentationStates ( inData [ 0 ] )
113
- . filter (
114
- ( state ) =>
115
- state . getOrigin &&
116
- state . getOrigin ( ) &&
117
- state . isVisible &&
118
- state . isVisible ( )
119
- ) ;
117
+ const list = publicAPI . getRepresentationStates ( inData [ 0 ] ) ;
120
118
const totalCount = list . length ;
121
119
122
120
if ( color . getNumberOfValues ( ) !== totalCount ) {
You can’t perform that action at this time.
0 commit comments