From 2c74d83cd768f443241e61f5a330f57ba91ea1a6 Mon Sep 17 00:00:00 2001 From: Adithya Krishna Date: Tue, 22 Aug 2023 13:49:31 +0000 Subject: [PATCH] Removed Unused Variables Signed-off-by: Adithya Krishna --- src/GLShape.ts | 4 +--- src/Label.ts | 5 ++--- src/WebGL/Camera.ts | 1 - src/WebGL/Renderer.ts | 4 ++++ src/WebGL/core/Geometry.ts | 2 +- src/colors.ts | 2 +- src/parsers/MMTF.ts | 7 +++++-- src/parsers/utils/getSinglePDB.ts | 2 ++ tsconfig.json | 2 +- 9 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/GLShape.ts b/src/GLShape.ts index 2add06545..3154932ec 100644 --- a/src/GLShape.ts +++ b/src/GLShape.ts @@ -10,9 +10,7 @@ import { MeshDoubleLambertMaterial, MeshLambertMaterial, Object3D, Coloring, Mes import { CAP, GLDraw } from "./GLDraw" import { subdivide_spline } from "./glcartoon"; import { adjustVolumeStyle, extend, Func, makeFunction } from "./utilities"; -import { Gradient, GradientType } from "./Gradient"; -import { LineStyleSpec } from "GLModel"; -import { VolumetricRendererSpec } from "VolumetricRender"; +import { GradientType } from "./Gradient"; /** diff --git a/src/Label.ts b/src/Label.ts index 19e58bef9..9194115af 100644 --- a/src/Label.ts +++ b/src/Label.ts @@ -3,18 +3,17 @@ import { Texture, SpriteMaterial, Sprite, - Vector3, Vector2, } from "./WebGL"; import { Gradient } from "./Gradient"; import { Color, CC, ColorSpec } from "./colors"; import {XYZ} from "./WebGL/math" -//Adapted from the text sprite example from http://stemkoski.github.io/Three.js/index.html +// Adapted from the text sprite example from http://stemkoski.github.io/Three.js/index.html export let LabelCount = 0; -// function for drawing rounded rectangles - for Label drawing +// Function for drawing rounded rectangles - for Label drawing function roundRect(ctx, x, y, w, h, r, drawBorder) { ctx.beginPath(); ctx.moveTo(x + r, y); diff --git a/src/WebGL/Camera.ts b/src/WebGL/Camera.ts index 6e0cd4dc2..aa8e9b207 100644 --- a/src/WebGL/Camera.ts +++ b/src/WebGL/Camera.ts @@ -1,4 +1,3 @@ -import type { Quaternion } from "./math"; import { Object3D } from "./core"; import { Matrix4, Vector3 } from "./math"; /* diff --git a/src/WebGL/Renderer.ts b/src/WebGL/Renderer.ts index 7eecef78e..01bf64d67 100644 --- a/src/WebGL/Renderer.ts +++ b/src/WebGL/Renderer.ts @@ -69,6 +69,7 @@ export class Renderer { // GL state cache private _oldDoubleSided = -1 as number | boolean; private _oldFlipSided = -1 as number | boolean; + // @ts-ignore private _oldBlending = -1; private _oldDepthTest = -1; private _oldDepthWrite = -1; @@ -1508,6 +1509,7 @@ export class Renderer { // Objects adding private addObject(object, scene) { + // @ts-ignore var g, gl, geometry, material, geometryGroup; if (!object.__webglInit) { @@ -1797,10 +1799,12 @@ export class Renderer { b = 0, color, intensity, + // @ts-ignore distance, zlights = this._lights, dirColors = zlights.directional.colors, dirPositions = zlights.directional.positions, + // @ts-ignore dirCount = 0, dirLength = 0, dirOffset = 0; diff --git a/src/WebGL/core/Geometry.ts b/src/WebGL/core/Geometry.ts index fc41a8002..e345597ae 100644 --- a/src/WebGL/core/Geometry.ts +++ b/src/WebGL/core/Geometry.ts @@ -2,7 +2,7 @@ import type { Material } from './../materials/Material'; import { LineBasicMaterial } from '../materials/LineBasicMaterial'; import { EventDispatcher } from "./EventDispatcher"; import { Vector3 } from "../math"; -import { CC, Color, Colored } from "../../colors"; +import { CC, Color } from "../../colors"; const BUFFERSIZE = 65535; //limited to 16bit indices export class GeometryGroup { id: number; diff --git a/src/colors.ts b/src/colors.ts index 217734680..712f1ebcd 100644 --- a/src/colors.ts +++ b/src/colors.ts @@ -1,4 +1,4 @@ -import { Gradient, GradientType } from "./Gradient"; +import { GradientType } from "./Gradient"; /* @interface * diff --git a/src/parsers/MMTF.ts b/src/parsers/MMTF.ts index 74ff227e5..c8b657725 100644 --- a/src/parsers/MMTF.ts +++ b/src/parsers/MMTF.ts @@ -71,6 +71,7 @@ export function MMTFparser(bindata: any, options: ParserOptionsSpec) { var modelData: any[] = atoms.modelData = []; // setup index counters + // @ts-ignore var modelIndex = 0; var chainIndex = 0; var groupIndex = 0; @@ -158,10 +159,12 @@ export function MMTFparser(bindata: any, options: ParserOptionsSpec) { secStructEnd = true; } } + // @ts-ignore var insCode = null as string | null; if (mmtfData.insCodeList) { insCode = String.fromCharCode(insCodeList[groupIndex]); } + // @ts-ignore var sequenceIndex = null; if (sequenceIndexList) { sequenceIndex = sequenceIndexList[groupIndex]; @@ -171,8 +174,8 @@ export function MMTFparser(bindata: any, options: ParserOptionsSpec) { var groupName = groupData.groupName; let groupType = groupData.chemCompType; var startAtom = atomIndex; - //note the following is not identical to respecting HETATM records - //this information isn't available in MMTF. + // Note the following is not identical to respecting HETATM records + // this information isn't available in MMTF. let isHETATM = mmtfHETATMtypes.has(groupType) || !chainIsPolymer[chainIndex]; for (k = 0; k < groupAtomCount; ++k) { diff --git a/src/parsers/utils/getSinglePDB.ts b/src/parsers/utils/getSinglePDB.ts index fa52674df..25c1154b4 100644 --- a/src/parsers/utils/getSinglePDB.ts +++ b/src/parsers/utils/getSinglePDB.ts @@ -22,6 +22,7 @@ export function getSinglePDB(lines: string[], options: ParserOptionsSpec, sslook var atom: any; var remainingLines = []; + // @ts-ignore var hasStruct = false; var serialToIndex: number[] = []; // map from pdb serial to index in atoms var line: string | string[]; @@ -30,6 +31,7 @@ export function getSinglePDB(lines: string[], options: ParserOptionsSpec, sslook for (let i = 0; i < lines.length; i++) { line = lines[i].replace(/^\s*/, ""); // remove indent var recordName = line.substring(0, 6); + // @ts-ignore var startChain: string, startResi: number, endChain: any, endResi: number; if (recordName.indexOf("END") == 0) { diff --git a/tsconfig.json b/tsconfig.json index 15e33d641..383a3f3a6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,7 @@ "allowJs": true, "sourceMap": true, "declaration": true, - "noUnusedLocals": false, + "noUnusedLocals": true, "moduleResolution": "node", "lib": [ "dom",