import PlannerElementData from '../../../model/Planner/PlannerElementData';
import { BoxPlannerCellsPerElement, GridSetupParams } from '../../../model/Planner/BoxPlannerData';
import { Vector3 } from '../../../model/Planner/wcVectors';
import { PlannerDeletionType } from '../../../interface/FunctionTypes';
import { PlannerInteractionInformation, GeneralPlanningState, PlannedElement } from '../../../model/Planner/PlannerInteractionData';
import PlannerDataType from '@crystaldesign/web-planner-logic/interface/Planner/PlannerDataType';
export default class BoxPlannerGrid {
    private plannerElements;
    private generalPlanningState;
    private hasActiveBackside;
    private getValueOfOptionOfArticle;
    private gridSetupParams;
    constructor(gridSetupParams: GridSetupParams, getValueOfOptionOfArticle: (elementId: number, optionCodex: string) => string | undefined);
    /**
     * This function creates the new cells that are needed when copying an element
     * @param newElement
     * @param startColIndex
     * @param startRowIndex
     * @returns
     */
    private createNewCells;
    private createEmptyCells;
    /**
     * This function returns the amount of cols and rows an element occupies inside the grid
     * @param element
     * @returns
     */
    private getCellCount;
    /** this function returns all not Empty cells in the grid */
    private getAllUsedCellsInGrid;
    private getGridColumnWidth;
    /**
     * Gibt die Höhe einer Spalte zurück
     * @param columnIdex
     * @returns
     */
    private getGridColumnHeight;
    private deleteElementByIdFromGrid;
    /**
     * CHECK OK
     * This function returns the ElementID of the element at a specific GridPosition.
     * If there is no element at this position, the function returns undefined
     * @param curXPos
     * @param curYPos
     */
    getPlannerElementAtGridPos(curXPos: number, curYPos: number, fromBackmodul: boolean): PlannerElementData | undefined;
    /**
     *
     * This function returns the index of an element by elementId in the grid.
     * It returns the column and row position in the grid and if it is in the front or backgrid
     * With onlin it is possible, that one element occupies more than one grid cell. All occupied grid cells are returned in an array
     * @param elementId
     */
    getCellsInGridByElementId(elementId: number): BoxPlannerCellsPerElement;
    set GridSetupParams(gridSetupParams: GridSetupParams);
    /**
     * This function returns all elementIds that are inside the grid
     */
    getAllElementIdsInGrid(): number[];
    private _getAllElementsInGrid;
    getAllElementsInFrontGrid(): PlannerElementData[];
    getAllElementsInBackGrid(): PlannerElementData[];
    getAllElementsInBacksideModuleGrid(): number[];
    /**
     * This function returns all elements In grid - from frontside and from backside
     */
    getAllElementsInGridSortedbyElementId(): PlannerElementData[];
    getAllElementsInGridSortedbyGridPos(): PlannerElementData[];
    getElementById(elementId: number): PlannerElementData | undefined;
    /**
     * Returns true if the element by ElementId is in the bottomLeft corner of the grid
     * @param elementId
     */
    getElementIsFirstInGrid(elementId: number): boolean;
    /**
     * Returns true if the element by ElementId is in the bottomLeft corner of the grid
     * @param elementId
     */
    getElementIsInLastCol(elementId: number, fromBackmodul: boolean): boolean;
    /**
     * returns true if the element has another element on top
     * @param elementId
     */
    getElementHasTopElement(elementId: number): boolean;
    /**
     * returns the elements on the top of the current element
     * @param elementId
     */
    getTopElements(elementId: number, onlyDirectNeighbor?: boolean): PlannerElementData[];
    /**
     * returns the element on the top right of the current element
     * @param elementId
     */
    getTopRightElement(elementId: number): PlannerElementData | undefined;
    /**
     * returns the element on the top left of the current element
     * @param elementId
     */
    getTopLeftElement(elementId: number): PlannerElementData | undefined;
    /**
     * returns true if the element has another element on the bottom
     * @param elementId
     */
    getElementHasBottomElement(elementId: number): boolean;
    /**
     * returns all elements on the bottom of the current element from left to right
     * now following construction of elements is possible. When you want to return the bottom elements of a it returns b,c,d
     * aaaaaa
     * bbccdd
     *
     * @param elementId
     */
    getBottomElements(elementId: number, onlyDirectNeighbor?: boolean): PlannerElementData[];
    /**
     * returns true if the element has another element on its right side
     * @param elementId
     */
    getElementHasRightElement(elementId: number): boolean;
    /**
     * returns all elements right  of the current element from bottom to up
     * now following construction of elements is possible. When getting right Elements of Element a it returns b and c
     * aabb
     * aabb
     * aacc
     * @param elementId
     */
    getRightElements(elementId: number, onlyDirectNeighbor?: boolean): PlannerElementData[];
    /**
     * returns true if the element has another element on its left side
     * @param elementId
     */
    getElementHasLeftElement(elementId: number): boolean;
    /**
     * returns all elements left of the current element from bottom to up
     * now following construction of elements is possible. When getting left Elements of Element a it returns b and c
     * bbaa
     * bbaa
     * ccaa
     * @param elementId
     */
    getLeftElements(elementId: number, onlyDirectNeighbor?: boolean): PlannerElementData[];
    getAllElementsInColumn(index: number, fromBackmodul: boolean, orderBottomDown?: boolean): PlannerElementData[];
    /**
     * This function returns the count of columns in the grid
     */
    getColumnCount(): number;
    /**
     * This function returns the count of rows in a columns
     * @param colIndex
     */
    getRowCount(colIndex: number, fromBackmodul: boolean): number;
    getAllElementsInRow(index: number, fromBackmodul: boolean): PlannerElementData[];
    /**
     * CHECK OK
     * This function returns the size of the highes row element over all columns
     */
    getSizeOfHighesRow(fromBackmodul: boolean): number;
    /**
     * This function returns the neighbor elements in the grid. Now it can be more than one element.
     * If for example the element has several grid cells in one colum, the function checks all grid cells on the right side. It returns then one or more Elements, depending on the construction
     * Example:
     * AAB
     * AAB
     * AAC
     * The right elements of A are B and C
     * @param curXPos
     * @param curYPos
     * @param dir
     */
    getNeighborElements(elementId: number, dir: 'TOP' | 'DOWN' | 'LEFT' | 'RIGHT' | 'BACK', clean?: boolean): PlannerElementData[];
    /**
     * Returns the opposide element in the grid. This function only looks at the element that is placed at the same grid pos as the start Col und start Row Index of the element.
     * It always returns only one element or none
     * @param elementId
     * @returns
     */
    getOppositeElement(elementId: number): PlannerElementData | undefined;
    /**
     * Returns the opposide elements in the grid given an array of element ids. This function only looks at the element that is placed at the same grid pos as the start Col und start Row Index of the element.
     * It always returns only one element or none
     * @param elementId
     * @returns
     */
    getOppositeElements(elementIds: number[]): PlannerElementData[];
    /**
     * this function returns the size Information of the set.
     * Because of the fact that the backside is always opposite of the front side - only the front side is used for calculation
     */
    getSizeOfWholeSet(correctSizeSystem4: boolean): Vector3;
    getHighestElementsPerSeries(onBottom?: boolean): PlannedElement[][];
    /**
     * Returns all other elements in the grid that are in the same row as the elementId from the parameter. It only returns the elements on along the startRowIndex
     * Excample:
     * AAC
     * AAB
     * AABD
     * EEED
     * The elements that are in the same row as A are B and D
     * @param elementId
     */
    getAllElementsInSameRowByElementId(elementId: number): {
        elementIds: number[];
        plannerElements: PlannerElementData[];
        backside: boolean;
    };
    /**
     * Get all the Elements need  to fill up for the copy of Element x fxe:
     *
     * [4]   ->
     * [3]
     * [2]
     * [0][1]
     *
     * returns element 4, 3 and 2 because those are needed to copy in order
     * for the copy of element 4 to not float
     */
    getAllElementsToFillUp(elementId: number, dir: 'LEFT' | 'RIGHT'): {
        elements: number[];
        backside: boolean;
    };
    /**
     * Returns all Elements that are under the specified element
     * AAAE
     * BBCE
     * DDDD
     * DDDD
     * The Elements that are under A are B, C and D
     */
    getAllElementsDown(elementId: number): {
        elements: number[];
        backside: boolean;
    };
    /**
     * Returns all other elements in the grid that are in the same col as the elementId from the parameter. It only returns the elements on along the startRowIndex
     * Excample:
     * HHHH
     * FAAC
     * FAAB
     * FAABD
     * FEEED
     * GGGGG
     * The elements that are in the same col  as A are E, G and H
     * @param elementId
     */
    getAllElementsInSameCol(elementId: number): {
        elements: number[];
        backside: boolean;
    };
    prepareGridForColCopy(elementId: number, relativeCopyIndex: {
        x: number;
        y: number;
        z: number;
    }): void;
    prepareGridForBackSideCopy(): void;
    /**
     * This function adds an element to the grid. It gives the start col and row and calculates how many grid cells are used by the element
     * @param newElement
     * @param col
     * @param row
     * @param fromBackmodul
     */
    addElementAtGridPos(newElement: PlannerElementData, col: number, row: number, fromBackmodul: boolean): void;
    /**
     *  move element
     * @param elementIDToMove
     * @param copyInfo
     */
    moveElementAsCopy(elementId: number, absoluteIndex: {
        x: number;
        y: number;
    }): void;
    /**
     * Assume that the grid is already prepared and there is enough empty space for the new element.
     * @param elementIDToCopy
     * @param newElement
     * @param copyInfo
     */
    addElementAsCopy(copiedElementId: number, newElement: PlannerElementData, copyIndex: {
        x: number;
        y: number;
        z: number;
    }): void;
    /**
     * This function deletes an Element from the grid.ShaderMaterial
     * If backsideModule is active, than the oppsite Element is deleted as well
     * If the boxPlanner_backside switch deletion type is set, do not delete the opposite element
     * If the last element in col was deleted, do delete whole col.
     * @param elementId
     */
    deleteElement(elementId: number, deletionType?: PlannerDeletionType): void;
    updateGridElementDimensions(elementId: number, elementData: PlannerDataType | undefined): boolean;
    /**
     * This function updates the world position of all Elements in the grid.
     * First the world position of the front grid is computed. If the backside is active, it also computes the posNr of the elements on the backside.
     */
    updateWorldPosOfElements(): void;
    /**
     * This function destroys the box Planner and its grid. It also destroys all plannerElements inside.
     * If the backside Module is active, also the backside module has to be updated
     */
    destroyBoxPlannerGrid(): void;
    /**
     * Destroys the backside module Grid
     */
    destroyBacksideModuleGrid(): void;
    getPlannerHasActiveBackside(): boolean;
    getForceSingleCellPerElement(): boolean;
    getBoundingBox(): {
        width: number;
        depth: number;
        height: number;
    };
    /**
     * This function returns all free cell locations to move a specific element
     * @param elementId
     * @returns
     */
    private getFreeMoveLocation;
    /**
     * This function returns free locations for an element when trying to copy it in LEFT TOP or RIGHT direction
     * @param elementId
     * @param direction
     * @returns
     */
    private getFreePlanningLocation;
    private createLocationInformation;
    getPlannerInteractionInformation(): PlannerInteractionInformation;
    getGeneralPlanningState(movables?: boolean, selectedElementId?: number): GeneralPlanningState;
    private getRowSizes;
    private getColumnSizes;
    private addFreeCellsToMatrix;
}
//# sourceMappingURL=BoxPlannerGrid.d.ts.map