/**************************************************************************** * Copyright 2021 EPAM Systems * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ import { Atom } from './atom'; import type { EditorSelection } from "../../application/editor"; import { Bond } from './bond'; import { Fragment } from './fragment'; import { FunctionalGroup } from './functionalGroup'; import { HalfBond } from './halfBond'; import { Loop } from './loop'; import { Pile } from './pile'; import { Pool } from './pool'; import { RGroup } from './rgroup'; import { RxnArrow } from './rxnArrow'; import { RxnPlus } from './rxnPlus'; import { SGroup } from './sgroup'; import { SGroupForest } from './sgroupForest'; import { SimpleObject } from './simpleObject'; import { Text } from './text'; import { Vec2 } from './vec2'; import { Highlight } from './highlight'; import { RGroupAttachmentPoint } from './rgroupAttachmentPoint'; import { Image } from './image'; import { MultitailArrow } from './multitailArrow'; export declare type Neighbor = { aid: number; bid: number; }; export declare type StructProperty = { key: string; value: string; }; export declare class Struct { atoms: Pool; bonds: Pool; sgroups: Pool; halfBonds: Pool; loops: Pool; isReaction: boolean; rxnArrows: Pool; rxnPluses: Pool; frags: Pool; rgroups: Pool; rgroupAttachmentPoints: Pool; name: string; abbreviation?: string; sGroupForest: SGroupForest; simpleObjects: Pool; texts: Pool; functionalGroups: Pool; highlights: Pool; images: Pool; multitailArrows: Pool; constructor(); hasRxnProps(): boolean; hasRxnArrow(): boolean; hasMultitailArrow(): boolean; hasRxnPluses(): boolean; isRxn(): boolean; isBlank(): boolean; isSingleGroup(): boolean; clone(atomSet?: Pile | null, bondSet?: Pile | null, dropRxnSymbols?: boolean, aidMap?: Map | null, simpleObjectsSet?: Pile | null, textsSet?: Pile | null, rgroupAttachmentPointSet?: Pile | null, imagesSet?: Pile | null, multitailArrowsSet?: Pile | null, bidMap?: Map | null, needCloneAttachmentPoints?: boolean): Struct; getScaffold(): Struct; getFragmentIds(_fid: number | number[]): Pile; getFragment(fid: number | number[], copyNonFragmentObjects?: boolean, aidMap?: Map): Struct; mergeInto(cp: Struct, atomSet?: Pile | null, bondSet?: Pile | null, dropRxnSymbols?: boolean, keepAllRGroups?: boolean, aidMap?: Map | null, simpleObjectsSet?: Pile | null, textsSet?: Pile | null, rgroupAttachmentPointSet?: Pile | null, imagesSet?: Pile | null, multitailArrowsSet?: Pile | null, bidMapEntity?: Map | null, needCloneAttachmentPoints?: boolean): Struct; prepareLoopStructure(): void; atomAddToSGroup(sgid: any, aid: any): void; calcConn(atom: any, includeAtomsInCollapsedSgroups?: boolean): any[]; findBondId(begin: number, end: number): number | null; initNeighbors(): void; bondInitHalfBonds(bid: any, bond?: Bond): void; halfBondUpdate(halfBondId: number): void; initHalfBonds(): void; setHbNext(hbid: any, next: any): void; halfBondSetAngle(hbid: any, left: any): void; atomAddNeighbor(hbid: any): void; atomSortNeighbors(aid: any): void; sortNeighbors(list: any): void; atomUpdateHalfBonds(atomId: number): void; updateHalfBonds(list: any): void; sGroupsRecalcCrossBonds(): void; sGroupDelete(sgid: number): void; atomSetPos(id: number, pp: Vec2): void; rxnPlusSetPos(id: number, pp: Vec2): void; rxnArrowSetPos(id: number, pos: Array): void; simpleObjectSetPos(id: number, pos: Array): void; textSetPosition(id: number, position: Vec2): void; getCoordBoundingBox(atomSet?: Pile): any; getCoordBoundingBoxObj(): any; getBondLengthData(): { cnt: number; totalLength: number; }; getAvgBondLength(): number; getAvgClosestAtomDistance(): number; checkBondExists(begin: number, end: number): boolean; findConnectedComponent(firstaid: number): Pile; findConnectedComponents(discardExistingFragments?: boolean): any[]; markFragment(idSet: Pile, properties: [StructProperty]): void; clearFragments(): void; markFragments(properties?: any): void; scale(scale: number): void; rescale(): void; loopHasSelfIntersections(hbs: Array): boolean; partitionLoop(loop: any): any[]; halfBondAngle(hbid1: number, hbid2: number): number; loopIsConvex(loop: Array): boolean; loopIsInner(loop: Array): boolean; findLoops(): { newLoops: any[]; bondsToMark: number[]; }; calcImplicitHydrogen(aid: number, includeAtomsInCollapsedSgroups?: boolean): void; setImplicitHydrogen(list?: Array, includeAtomsInCollapsedSgroups?: boolean): void; setStereoLabelsToAtoms(): void; atomGetNeighbors(aid: number): Array | undefined; getComponents(): { reactants: any[]; products: any[]; }; defineRxnFragmentTypeForAtomset(atomset: Pile, arrowpos: number): 1 | 2; getBondFragment(bid: number): number | undefined; bindSGroupsToFunctionalGroups(): void; getGroupIdFromAtomId(atomId: number, searchBySgroups?: boolean): number | null; getGroupFromAtomId(atomId: number | undefined, searchBySgroups?: boolean): SGroup | undefined; getGroupIdFromBondId(bondId: number): number | null; getGroupFromBondId(atomId: number): SGroup | undefined; getGroupsIdsFromBondId(bondId: number): number[]; getBondIdByHalfBond(halfBondId: number): number | undefined; /** * @returns visibleAtoms = selected atoms * - atoms in contracted functional groups * + functional groups's attachment atoms */ getSelectedVisibleAtoms(selection: EditorSelection | null): number[]; getRGroupAttachmentPointsByAtomId(atomId: number): number[]; isAtomFromMacromolecule(atomId: number): boolean; isBondFromMacromolecule(bondOrBondId: Bond | number): boolean; isFunctionalGroupFromMacromolecule(functionalGroupId: number): boolean; isTargetFromMacromolecule(target?: { id: number; map: string; } | null): boolean | null | undefined; disableInitiallySelected(): void; enableInitiallySelected(): void; applyMonomersTransformations(): void; applyStereoBondsToExpandedMonomers(): void; private flipBondAndSetStereo; }