File size: 1,297 Bytes
71174bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Originally, I repurposed the 3dmol.js parser for when plugins need to access
// information about atoms. But I came to realize that this is overkill. I'm now
// going to create a minimal parser for PDB and MOL2 files instead, since these
// are the formats that molmoda uses internally for protein and compound files,
// respectively. It doens't need to have a lot of functionality. It just needs
// to be light on memory.

import { EasyParserParent } from "./EasyParserParent";
import { IAtom } from "@/UI/Navigation/TreeView/TreeInterfaces";

// This is here for backwards compatibility (in case loading old molmoda file).

/**
 * A parser for GLModel.
 */
export class EasyParserIAtomList extends EasyParserParent {
    /**
     * Load the source.
     *
     * @param {IAtom[]} src  The source to parse.
     */
    _load(src: IAtom[]): void {
        this._atoms = src as IAtom[];
    }

    /**
     * Parse an atom.
     *
     * @param {string} atomStr The string to parse.
     * @param {number} [atomParserIndex] Optional: The 0-based index of this atom in the parser's internal list.
     * @returns {IAtom | undefined} The parsed atom.
     */
    _parseAtomStr(
        atomStr: string,
        atomParserIndex?: number
    ): IAtom | undefined {
        return undefined;
    }
}