@@ -155,7 +155,7 @@ define(["jupyter-js-widgets", "underscore", "three"],
155
155
156
156
update : function ( ) {
157
157
//this.replace_obj(this.new_obj());
158
- // this.update_object_parameters();
158
+ this . update_object_parameters ( ) ;
159
159
this . needs_update ( ) ;
160
160
} ,
161
161
@@ -1167,36 +1167,22 @@ define(["jupyter-js-widgets", "underscore", "three"],
1167
1167
}
1168
1168
} ) ;
1169
1169
1170
-
1171
- var Basic3dObject = Object3dView . extend ( {
1172
- render : function ( ) {
1173
- this . update ( ) ;
1174
- return this . obj ;
1175
- } ,
1176
-
1177
- update : function ( ) {
1178
- this . replace_obj ( this . new_obj ( ) ) ;
1179
- Object3dView . prototype . update . call ( this ) ;
1180
- }
1181
- } ) ;
1182
-
1183
-
1184
- var AmbientLight = Basic3dObject . extend ( {
1170
+ var AmbientLight = Object3dView . extend ( {
1185
1171
new_obj : function ( ) {
1186
1172
return new THREE . AmbientLight ( this . model . get ( 'color' ) ) ;
1187
1173
}
1188
1174
} ) ;
1189
1175
1190
1176
1191
- var DirectionalLight = Basic3dObject . extend ( {
1177
+ var DirectionalLight = Object3dView . extend ( {
1192
1178
new_obj : function ( ) {
1193
1179
return new THREE . DirectionalLight ( this . model . get ( 'color' ) ,
1194
1180
this . model . get ( 'intensity' ) ) ;
1195
1181
}
1196
1182
} ) ;
1197
1183
1198
1184
1199
- var PointLight = Basic3dObject . extend ( {
1185
+ var PointLight = Object3dView . extend ( {
1200
1186
new_obj : function ( ) {
1201
1187
return new THREE . PointLight ( this . model . get ( 'color' ) ,
1202
1188
this . model . get ( 'intensity' ) ,
@@ -1205,15 +1191,15 @@ define(["jupyter-js-widgets", "underscore", "three"],
1205
1191
} ) ;
1206
1192
1207
1193
1208
- var SpotLight = Basic3dObject . extend ( {
1194
+ var SpotLight = Object3dView . extend ( {
1209
1195
new_obj : function ( ) {
1210
1196
return new THREE . SpotLight ( this . model . get ( 'color' ) ,
1211
1197
this . model . get ( 'intensity' ) ,
1212
1198
this . model . get ( 'distance' ) ) ;
1213
1199
}
1214
1200
} ) ;
1215
1201
1216
- var HemisphereLight = Basic3dObject . extend ( {
1202
+ var HemisphereLight = Object3dView . extend ( {
1217
1203
new_obj : function ( ) {
1218
1204
return new THREE . HemisphereLight ( this . model . get ( 'color' ) ,
1219
1205
this . model . get ( 'ground_color' ) ,
@@ -1259,17 +1245,21 @@ define(["jupyter-js-widgets", "underscore", "three"],
1259
1245
}
1260
1246
} ) ;
1261
1247
1262
- var Basic3dObjectModel = widgets . WidgetModel . extend ( {
1248
+ var Object3dModel = widgets . WidgetModel . extend ( {
1263
1249
defaults : _ . extend ( { } , widgets . WidgetModel . prototype . defaults , {
1264
- _model_module : 'jupyter-threejs' ,
1265
1250
_view_module : 'jupyter-threejs' ,
1266
- _model_name : 'Basic3dObjectModel' ,
1267
- _view_name : 'Basic3dObjectView'
1251
+ _model_module : 'jupyter-threejs' ,
1252
+ _view_name : 'Object3dView' ,
1253
+ _model_name : 'Object3dModel'
1268
1254
} )
1255
+ } , {
1256
+ serializers : _ . extend ( {
1257
+ children : { deserialize : widgets . unpack_models }
1258
+ } , widgets . WidgetModel . serializers )
1269
1259
} ) ;
1270
1260
1271
- var LightModel = Basic3dObjectModel . extend ( {
1272
- defaults : _ . extend ( { } , Basic3dObjectModel . prototype . defaults , {
1261
+ var LightModel = Object3dModel . extend ( {
1262
+ defaults : _ . extend ( { } , Object3dModel . prototype . defaults , {
1273
1263
_model_name : 'LightModel' ,
1274
1264
color : 'white'
1275
1265
} )
@@ -1322,18 +1312,6 @@ define(["jupyter-js-widgets", "underscore", "three"],
1322
1312
} )
1323
1313
} , { } , LightModel . serializers ) ;
1324
1314
1325
- var Object3dModel = widgets . WidgetModel . extend ( {
1326
- defaults : _ . extend ( { } , widgets . WidgetModel . prototype . defaults , {
1327
- _view_module : 'jupyter-threejs' ,
1328
- _model_module : 'jupyter-threejs' ,
1329
- _view_name : 'Object3dView' ,
1330
- _model_name : 'Object3dModel'
1331
- } )
1332
- } , {
1333
- serializers : _ . extend ( {
1334
- children : { deserialize : widgets . unpack_models }
1335
- } , widgets . WidgetModel . serializers )
1336
- } ) ;
1337
1315
1338
1316
var ScaledObjectModel = Object3dModel . extend ( {
1339
1317
defaults : _ . extend ( { } , Object3dModel . prototype . defaults , {
@@ -1998,8 +1976,6 @@ define(["jupyter-js-widgets", "underscore", "three"],
1998
1976
EffectModel : EffectModel ,
1999
1977
AnaglyphEffectView : AnaglyphEffectView ,
2000
1978
AnaglyphEffectModel : AnaglyphEffectModel ,
2001
- Basic3dObject : Basic3dObject ,
2002
- Basic3dObjectModel : Basic3dObjectModel ,
2003
1979
BasicMaterialView : BasicMaterialView ,
2004
1980
BasicMaterialModel : BasicMaterialModel ,
2005
1981
BoxGeometryView : BoxGeometryView ,
0 commit comments