Browse Source

removed unused code

Alexander Rose 4 years ago
parent
commit
bb8f872a13

+ 0 - 47
src/mol-plugin-state/transforms/model.ts

@@ -434,53 +434,6 @@ const StructureFromModel = PluginStateTransform.BuiltIn({
 
 const _translation = Vec3(), _m = Mat4(), _n = Mat4();
 
-// type StructureCoordinateSystem = typeof StructureCoordinateSystem
-// const StructureCoordinateSystem = PluginStateTransform.BuiltIn({
-//     name: 'structure-coordinate-system',
-//     display: { name: 'Coordinate System' },
-//     isDecorator: true,
-//     from: SO.Molecule.Structure,
-//     to: SO.Molecule.Structure,
-//     params: {
-//         transform: PD.MappedStatic('components', {
-//             components: PD.Group({
-//                 axis: PD.Vec3(Vec3.create(1, 0, 0)),
-//                 angle: PD.Numeric(0, { min: -180, max: 180, step: 0.1 }),
-//                 translation: PD.Vec3(Vec3.create(0, 0, 0)),
-//             }, { isFlat: true }),
-//             matrix: PD.Group({
-//                 data: PD.Mat4(Mat4.identity()),
-//                 transpose: PD.Boolean(false)
-//             }, { isFlat: true })
-//         }, { label: 'Kind' })
-//     }
-// })({
-//     canAutoUpdate({ newParams }) {
-//         return newParams.transform.name === 'components';
-//     },
-//     apply({ a, params }) {
-//         // TODO: optimze
-
-//         const transform = Mat4();
-
-//         if (params.transform.name === 'components') {
-//             const { axis, angle, translation } = params.transform.params;
-//             const center = a.data.boundary.sphere.center;
-//             Mat4.fromTranslation(_m, Vec3.negate(_translation, center));
-//             Mat4.fromTranslation(_n, Vec3.add(_translation, center, translation));
-//             const rot = Mat4.fromRotation(Mat4(), Math.PI / 180 * angle, Vec3.normalize(Vec3(), axis));
-//             Mat4.mul3(transform, _n, rot, _m);
-//         } else if (params.transform.name === 'matrix') {
-//             Mat4.copy(transform, params.transform.params.data);
-//             if (params.transform.params.transpose) Mat4.transpose(transform, transform);
-//         }
-
-//         // TODO: compose with parent's coordinate system
-//         a.data.coordinateSystem = SymmetryOperator.create('CS', transform);
-//         return new SO.Molecule.Structure(a.data, { label: a.label, description: `${a.description} [Transformed]` });
-//     }
-// });
-
 type TransformStructureConformation = typeof TransformStructureConformation
 const TransformStructureConformation = PluginStateTransform.BuiltIn({
     name: 'transform-structure-conformation',

+ 0 - 11
src/mol-plugin-state/transforms/representation.ts

@@ -132,12 +132,6 @@ const StructureRepresentation3D = PluginStateTransform.BuiltIn({
             await Theme.ensureDependencies(propertyCtx, plugin.representation.structure.themes, { structure: a.data }, params);
             repr.setTheme(Theme.create(plugin.representation.structure.themes, { structure: a.data }, params));
 
-            // // TODO: build this into representation?
-            // if (!a.data.coordinateSystem.isIdentity) {
-            //     (cache as any)['transform'] = a.data.coordinateSystem;
-            //     repr.setState({ transform: a.data.coordinateSystem.matrix });
-            // }
-
             // TODO set initial state, repr.setState({})
             await repr.createOrUpdate(props, a.data).runInContext(ctx);
             return new SO.Molecule.Structure.Representation3D({ repr, source: a }, { label: provider.label });
@@ -159,11 +153,6 @@ const StructureRepresentation3D = PluginStateTransform.BuiltIn({
             await Theme.ensureDependencies(propertyCtx, plugin.representation.structure.themes, { structure: a.data }, newParams);
             b.data.repr.setTheme(Theme.create(plugin.representation.structure.themes, { structure: a.data }, newParams));
 
-            // // TODO: build this into representation?
-            // if ((cache as any)['transform'] !== a.data.coordinateSystem) {
-            //     (cache as any)['transform'] = a.data.coordinateSystem;
-            //     b.data.repr.setState({ transform: a.data.coordinateSystem.matrix });
-            // }
 
             await b.data.repr.createOrUpdate(props, a.data).runInContext(ctx);
             b.data.source = a;