@@ -122,30 +122,30 @@ function vtkCell(publicAPI, model) {
122
122
// Object factory
123
123
// ----------------------------------------------------------------------------
124
124
125
- const DEFAULT_VALUES = {
126
- bounds : [ - 1 , - 1 , - 1 , - 1 , - 1 , - 1 ] ,
127
- pointsIds : [ ] ,
128
- } ;
125
+ function defaultValues ( initialValues ) {
126
+ return {
127
+ points : vtkPoints . newInstance ( ) ,
128
+ bounds : [ - 1 , - 1 , - 1 , - 1 , - 1 , - 1 ] ,
129
+ pointsIds : [ ] ,
130
+ ...initialValues ,
131
+ } ;
132
+ }
129
133
130
134
// ----------------------------------------------------------------------------
131
135
132
136
export function extend ( publicAPI , model , initialValues = { } ) {
133
- Object . assign ( model , DEFAULT_VALUES , initialValues ) ;
137
+ Object . assign ( initialValues , defaultValues ( initialValues ) ) ;
134
138
135
139
macro . obj ( publicAPI , model ) ;
136
140
137
- if ( ! model . points ) {
138
- model . points = vtkPoints . newInstance ( { values : [ ] } ) ;
139
- }
140
-
141
141
macro . get ( publicAPI , model , [ 'points' , 'pointsIds' ] ) ;
142
142
143
143
vtkCell ( publicAPI , model ) ;
144
144
}
145
145
146
146
// ----------------------------------------------------------------------------
147
147
148
- export const newInstance = macro . newInstance ( extend , 'vtkCell' ) ;
148
+ export const newInstance = macro . newInstance ( extend , 'vtkCell' , true ) ;
149
149
150
150
// ----------------------------------------------------------------------------
151
151
0 commit comments