Skip to content

Commit b53155a

Browse files
committed
remove commented code
1 parent dbbdb61 commit b53155a

File tree

1 file changed

+3
-176
lines changed

1 file changed

+3
-176
lines changed

js/src/_base/Three.js

Lines changed: 3 additions & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -340,15 +340,9 @@ var ThreeModel = widgets.DOMWidgetModel.extend({
340340
// initialize properties arrays
341341
this.three_properties = [];
342342
this.three_array_properties = [];
343+
344+
// TODO: not currently integrated
343345
this.three_dict_properties = [];
344-
// this.scalar_properties = [];
345-
// this.enum_properties = [];
346-
// this.color_properties = [];
347-
// this.array_properties = [];
348-
// this.dict_properties = [];
349-
// this.function_properties = [];
350-
// this.properties_properties = [];
351-
// this.vector_properties = [];
352346

353347
this.enum_property_types = {};
354348
this.props_created_by_three = {};
@@ -405,7 +399,7 @@ var ThreeModel = widgets.DOMWidgetModel.extend({
405399
}, this);
406400
}, this);
407401

408-
// TODO: handle dicts of children
402+
// TODO: handle dicts of children via this.three_dict_properties
409403

410404
this.on('change', this.onChange, this);
411405
this.on('msg:custom', this.onCustomMessage, this);
@@ -588,9 +582,6 @@ var ThreeModel = widgets.DOMWidgetModel.extend({
588582
//
589583

590584
onChange: function(model, options) {
591-
// console.log(this.id + ' onChange: ');
592-
// console.log(this.changedAttributes());
593-
594585
this.syncToThreeObj();
595586
this.trigger('rerender', this, {});
596587
},
@@ -603,19 +594,6 @@ var ThreeModel = widgets.DOMWidgetModel.extend({
603594
// push data from model to three object
604595
syncToThreeObj: function() {
605596

606-
// var arrayMappers = {
607-
// 'three_properties': this.syncThreePropToThree,
608-
// 'three_array_properties': this.syncThreeArrayToThree,
609-
// 'three_dict_properties': this.syncThreeDictToThree,
610-
// 'scalar_properties': this.syncScalarToThree,
611-
// 'enum_properties': this.syncEnumToThree,
612-
// 'color_properties': this.syncColorToThree,
613-
// 'array_properties': this.syncArrayToThree,
614-
// 'dict_properties': this.syncDictToThree,
615-
// 'function_properties': this.syncFunctionToThree,
616-
// 'vector_properties': this.syncVectorToThree,
617-
// };
618-
619597
_.each(this.property_converters, function(converterName, propName) {
620598
if (!converterName) {
621599
this.obj[propName] = this.get(propName);
@@ -647,103 +625,14 @@ var ThreeModel = widgets.DOMWidgetModel.extend({
647625
mapperFn.bind(this)();
648626
}, this);
649627

650-
// _.each(arrayMappers, function(mapFn, arrayName) {
651-
// this[arrayName].forEach(function(propName) {
652-
// mapFn.bind(this)(propName);
653-
// }, this);
654-
// }, this);
655-
656628
this.obj.needsUpdate = true;
657629
},
658630

659-
// syncThreePropToThree: function(propName) {
660-
// var submodel = this.get(propName);
661-
662-
// if (!submodel) {
663-
// this.obj[propName] = null;
664-
// } else {
665-
// var subThreeObj = submodel.obj;
666-
// this.obj[propName] = subThreeObj;
667-
// }
668-
// },
669-
670-
// syncThreeArrayToThree: function(propName) {
671-
// var submodelArray = this.get(propName);
672-
673-
// if (!submodelArray) {
674-
// this.obj[propName] = null;
675-
// return;
676-
// }
677-
678-
// this.obj[propName] = _.map(submodelArray, function(submodel) {
679-
// return submodel.obj;
680-
// });
681-
// },
682-
683-
// syncThreeDictToThree: function(propName) {
684-
// var submodelDict = this.get(propName);
685-
686-
// if (!submodelDict) {
687-
// this.obj[propName] = null;
688-
// return;
689-
// }
690-
691-
// this.obj[propName] = _.mapObject(submodelDict, function(submodel) {
692-
// return submodel.obj;
693-
// });
694-
// },
695-
696-
// syncScalarToThree: function(propName) {
697-
// this.obj[propName] = this.get(propName);
698-
// },
699-
700-
// syncEnumToThree: function(propName) {
701-
// this.obj[propName] = THREE[this.get(propName)];
702-
// },
703-
704-
// syncColorToThree: function(propName) {
705-
// this.obj[propName].set(this.get(propName));
706-
// },
707-
708-
// syncArrayToThree: function(propName) {
709-
// // TODO: is this needed?
710-
// this.obj[propName] = this.get(propName);
711-
// },
712-
713-
// syncDictToThree: function(propName) {
714-
// // TODO: is this needed?
715-
// this.obj[propName] = this.get(propName);
716-
// },
717-
718-
// syncFunctionToThree: function(propName) {
719-
// // TODO: is this needed?
720-
// eval('var fn = ' + this.get(propName));
721-
// this.obj[propName] = fn;
722-
// },
723-
724-
// syncVectorToThree: function(propName) {
725-
// var arr = this.get(propName);
726-
// this.obj[propName].fromArray(arr);
727-
// },
728-
729631
// push data from three object to model
730632
syncToModel: function(syncAllProps) {
731633

732634
syncAllProps = syncAllProps == null ? false : syncAllProps;
733635

734-
// var arrayMappers = {
735-
// 'three_properties': this.syncThreePropToModel,
736-
// 'three_array_properties': this.syncThreeArrayToModel,
737-
// 'three_dict_properties': this.syncThreeDictToModel,
738-
// 'scalar_properties': this.syncScalarToModel,
739-
// 'enum_properties': this.syncEnumToModel,
740-
// 'color_properties': this.syncColorToModel,
741-
// 'array_properties': this.syncArrayToModel,
742-
// 'dict_properties': this.syncDictToModel,
743-
// 'function_properties': this.syncFunctionToModel,
744-
// 'vector_properties': this.syncVectorToModel,
745-
// };
746-
747636
_.each(this.property_converters, function(converterName, propName) {
748637
if (!syncAllProps && !(propName in this.props_created_by_three)) {
749638
return;
@@ -779,71 +668,9 @@ var ThreeModel = widgets.DOMWidgetModel.extend({
779668
mapperFn.bind(this)();
780669
}, this);
781670

782-
// _.each(arrayMappers, function(mapFn, arrayName) {
783-
// // class config defines the list of properties that are explicitly
784-
// // set by three.js.
785-
// // this method will only sync those properties back to the model
786-
// // in order to minimize the number of props set and sent to the server
787-
788-
// var props = this[arrayName];
789-
// if (!syncAllProps) {
790-
// props = props.filter(function(propName) {
791-
// return (propName in this.props_created_by_three);
792-
// }, this);
793-
// }
794-
795-
// props.forEach(function(propName) {
796-
// mapFn.bind(this)(propName);
797-
// }, this);
798-
799-
// }, this);
800-
801671
this.save_changes();
802672
},
803673

804-
// syncThreePropToModel: function(propName) {
805-
// // TODO: implement
806-
// },
807-
808-
// syncThreeArrayToModel: function(propName) {
809-
// // TODO: implement
810-
// },
811-
812-
// syncThreeDictToModel: function(propName) {
813-
// // TODO: implement
814-
// },
815-
816-
// syncScalarToModel: function(propName) {
817-
// this.set(propName, this.obj[propName]);
818-
// },
819-
820-
// syncEnumToModel: function(propName) {
821-
// var enumType = this.enum_property_types[propName];
822-
// var enumValues = Enums[enumType];
823-
// var enumValueName = enumValues[this.obj[propName]];
824-
// this.set(propName, enumValueName);
825-
// },
826-
827-
// syncColorToModel: function(propName) {
828-
// this.set(propName, this.obj[propName].getHexString())
829-
// },
830-
831-
// syncArrayToModel: function(propName) {
832-
// this.set(propName, this.obj[propName]);
833-
// },
834-
835-
// syncDictToModel: function(propName) {
836-
// this.set(propName, this.obj[propName]);
837-
// },
838-
839-
// syncFunctionToModel: function(propName) {
840-
// this.set(propName, this.obj[propName].toString());
841-
// },
842-
843-
// syncVectorToModel: function(propName) {
844-
// this.set(propName, this.obj[propName].toArray());
845-
// },
846-
847674
//
848675
// Conversions
849676
//

0 commit comments

Comments
 (0)