import * as Core from "@intelligentgraphics/ig.gfx.core";
import { IDetailedHitInfo, MathTypes } from "@intelligentgraphics/ig.gfx.core";
import { IScreenWorldConverter } from "../ScreenWorldConverter";
import { ComponentState } from "../Types";
import { StrongChildMatch, SnapMatch, StrongNeighborMatch, ScreenBasedChildMatch, WallMatch } from "./SnapMatches";
/** Class for calculating snap matches */
export default class SnapCalculator {
    static useCache: boolean;
    /** If set to false, also return invalid matches (e.g. for initial positioning) */
    onlyValidMatches: boolean;
    /** The first component id */
    private first;
    /** The snap points of the first component */
    private firstPoints;
    /** The second component id */
    private second;
    /** The snap points of the second component */
    private secondPoints;
    /** Is it possible to snap to direct neighbors? */
    private snapToAll;
    /** Filter out matches that have no ghost representation */
    onlyGhostRepresentationMatches: boolean;
    /** Filter out matches that collide with other components */
    removeCollidingMatches: boolean;
    /** Return first match that is not colliding */
    onlyTakeFirstNonCollidingMatch: boolean;
    /** Filter out matches that are redundant */
    removeRedundantMatches: boolean;
    /**
     * The constructor of the Snap Calculator. It calculates the snap points
     * @param state the state of the first component
     * @param snapToAll whether it is possible to snap to neighbor elements (for GhostMode)
     */
    constructor(state: ComponentState, snapToAll?: boolean);
    getScreenBasedChildMatches(state: ComponentState, converter: IScreenWorldConverter, hitInfoScreenBased: Core.IDetailedHitInfo): ScreenBasedChildMatch[];
    private updateSecond;
    private getSecondPoints;
    getStrongParentMatches(state: ComponentState): StrongChildMatch[];
    getStrongChildMatches(state: ComponentState): StrongChildMatch[];
    getStrongNeighborMatches(state: ComponentState): StrongNeighborMatch[];
    getWeakWallMatches(state: ComponentState, desiredComponentTransformation?: MathTypes.Transformation): WallMatch[];
    getWeakMatches(state: ComponentState): SnapMatch[];
    private _makeStrongNeighborMatchesLambda;
    /**
     * Calculates all possible strong matches
     * @returns {SnapMatch[]}
     */
    private makeStrongNeighborMatches;
    private makeScreenBasedChildMatches;
    private _makeStrongParentMatchesLambda;
    /**
     * Calculates all strong parent matches, i.e. the strong child matches with the order reversed.
     * @returns {SnapMatch[]}
     */
    private makeStrongParentMatches;
    private _makeStrongChildMatchesLambda;
    /**
     * Calculates all possible weak matches
     * @returns {SnapMatch[]}
     */
    private makeStrongChildMatches;
    private _makeWeakMatchesLambda;
    /**
     * Calculates all possible weak matches
     * @returns {SnapMatch[]}
     */
    private makeWeakMatches;
    /**
     * Abstract match making algorithm.
     * @param firstPoints the points to consider for the first component
     * @param secondPoints the points to consider for the second component
     * @param matchGenerator a function that generates SnapMatch objects from the two points.
     * @returns {SnapMatch[]} All valid snap matches
     */
    private makeMatches;
    /**
     * Sorting function for matches.
     * @param a the first match
     * @param b the second match
     * @returns {number}
     */
    private sortMatchesLambda;
    private _makeWeakWallMatchesLambda;
    private makeWeakWallMatches;
    /**
     *
     * @param componentId
     * @param componentConfiguration
     * @param rootsToExamine
     */
    getViableMatches(componentId: string, trafo: MathTypes.Transformation, componentConfiguration: object, rootsToExamine: string[], converter?: IScreenWorldConverter, hitInfos?: IDetailedHitInfo[], sortFunction?: (unsorted: SnapMatch[]) => SnapMatch[]): SnapMatch[];
    /**
     * Check if it is viable to create a ghost at the given position / rotation.
     * A ghost is viable if it does not intersect another object or room.
     * @param componentId  //e.g. tablar
     * @param match
     * @returns {boolean}
     */
    private isViableForInsertedId;
}
