@@ -155,7 +155,7 @@ define(["jupyter-js-widgets", "underscore", "three", "ndarray"],
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
@@ -1185,36 +1185,22 @@ define(["jupyter-js-widgets", "underscore", "three", "ndarray"],
1185
1185
}
1186
1186
} ) ;
1187
1187
1188
-
1189
- var Basic3dObject = Object3dView . extend ( {
1190
- render : function ( ) {
1191
- this . update ( ) ;
1192
- return this . obj ;
1193
- } ,
1194
-
1195
- update : function ( ) {
1196
- this . replace_obj ( this . new_obj ( ) ) ;
1197
- Object3dView . prototype . update . call ( this ) ;
1198
- }
1199
- } ) ;
1200
-
1201
-
1202
- var AmbientLight = Basic3dObject . extend ( {
1188
+ var AmbientLight = Object3dView . extend ( {
1203
1189
new_obj : function ( ) {
1204
1190
return new THREE . AmbientLight ( this . model . get ( 'color' ) ) ;
1205
1191
}
1206
1192
} ) ;
1207
1193
1208
1194
1209
- var DirectionalLight = Basic3dObject . extend ( {
1195
+ var DirectionalLight = Object3dView . extend ( {
1210
1196
new_obj : function ( ) {
1211
1197
return new THREE . DirectionalLight ( this . model . get ( 'color' ) ,
1212
1198
this . model . get ( 'intensity' ) ) ;
1213
1199
}
1214
1200
} ) ;
1215
1201
1216
1202
1217
- var PointLight = Basic3dObject . extend ( {
1203
+ var PointLight = Object3dView . extend ( {
1218
1204
new_obj : function ( ) {
1219
1205
return new THREE . PointLight ( this . model . get ( 'color' ) ,
1220
1206
this . model . get ( 'intensity' ) ,
@@ -1223,15 +1209,15 @@ define(["jupyter-js-widgets", "underscore", "three", "ndarray"],
1223
1209
} ) ;
1224
1210
1225
1211
1226
- var SpotLight = Basic3dObject . extend ( {
1212
+ var SpotLight = Object3dView . extend ( {
1227
1213
new_obj : function ( ) {
1228
1214
return new THREE . SpotLight ( this . model . get ( 'color' ) ,
1229
1215
this . model . get ( 'intensity' ) ,
1230
1216
this . model . get ( 'distance' ) ) ;
1231
1217
}
1232
1218
} ) ;
1233
1219
1234
- var HemisphereLight = Basic3dObject . extend ( {
1220
+ var HemisphereLight = Object3dView . extend ( {
1235
1221
new_obj : function ( ) {
1236
1222
return new THREE . HemisphereLight ( this . model . get ( 'color' ) ,
1237
1223
this . model . get ( 'ground_color' ) ,
@@ -1277,17 +1263,21 @@ define(["jupyter-js-widgets", "underscore", "three", "ndarray"],
1277
1263
}
1278
1264
} ) ;
1279
1265
1280
- var Basic3dObjectModel = widgets . WidgetModel . extend ( {
1266
+ var Object3dModel = widgets . WidgetModel . extend ( {
1281
1267
defaults : _ . extend ( { } , widgets . WidgetModel . prototype . defaults , {
1282
- _model_module : 'jupyter-threejs' ,
1283
1268
_view_module : 'jupyter-threejs' ,
1284
- _model_name : 'Basic3dObjectModel' ,
1285
- _view_name : 'Basic3dObjectView'
1269
+ _model_module : 'jupyter-threejs' ,
1270
+ _view_name : 'Object3dView' ,
1271
+ _model_name : 'Object3dModel'
1286
1272
} )
1273
+ } , {
1274
+ serializers : _ . extend ( {
1275
+ children : { deserialize : widgets . unpack_models }
1276
+ } , widgets . WidgetModel . serializers )
1287
1277
} ) ;
1288
1278
1289
- var LightModel = Basic3dObjectModel . extend ( {
1290
- defaults : _ . extend ( { } , Basic3dObjectModel . prototype . defaults , {
1279
+ var LightModel = Object3dModel . extend ( {
1280
+ defaults : _ . extend ( { } , Object3dModel . prototype . defaults , {
1291
1281
_model_name : 'LightModel' ,
1292
1282
color : 'white'
1293
1283
} )
@@ -1340,18 +1330,6 @@ define(["jupyter-js-widgets", "underscore", "three", "ndarray"],
1340
1330
} )
1341
1331
} , { } , LightModel . serializers ) ;
1342
1332
1343
- var Object3dModel = widgets . WidgetModel . extend ( {
1344
- defaults : _ . extend ( { } , widgets . WidgetModel . prototype . defaults , {
1345
- _view_module : 'jupyter-threejs' ,
1346
- _model_module : 'jupyter-threejs' ,
1347
- _view_name : 'Object3dView' ,
1348
- _model_name : 'Object3dModel'
1349
- } )
1350
- } , {
1351
- serializers : _ . extend ( {
1352
- children : { deserialize : widgets . unpack_models }
1353
- } , widgets . WidgetModel . serializers )
1354
- } ) ;
1355
1333
1356
1334
var ScaledObjectModel = Object3dModel . extend ( {
1357
1335
defaults : _ . extend ( { } , Object3dModel . prototype . defaults , {
@@ -2065,8 +2043,6 @@ define(["jupyter-js-widgets", "underscore", "three", "ndarray"],
2065
2043
EffectModel : EffectModel ,
2066
2044
AnaglyphEffectView : AnaglyphEffectView ,
2067
2045
AnaglyphEffectModel : AnaglyphEffectModel ,
2068
- Basic3dObject : Basic3dObject ,
2069
- Basic3dObjectModel : Basic3dObjectModel ,
2070
2046
BasicMaterialView : BasicMaterialView ,
2071
2047
BasicMaterialModel : BasicMaterialModel ,
2072
2048
BoxGeometryView : BoxGeometryView ,
0 commit comments