import { Rendering, ArticleInfoType, PlannerElementData, IDivaViewVisualizedNotPlannedElement, ViewPlannerConfig, Vector3, DockingPoint, TabGroupTypes, PlannerMode, ViewConfigData, PlannerPaletteViewDataType, BboxInfo2D, ParamPlanPlannerElementInfo, ViewChangedCause } from '@crystaldesign/web-planner-logic';
import { BBoxType } from '@crystaldesign/diva-core';
import PlannerUI from './UI/PlannerUI';
import { CubeControlApi } from 'react-3d-cube-interaction';
import ProductState from '../States/UIState/Product';
import SettingsState from '../States/UIState/Settings';
import AIState from '../States/UIState/AI';
export default class ViewPlannerHandler {
    private planner3DImageHandler;
    private planner2DGridHandler;
    plannerUIHandler: PlannerUI;
    private curPlannerMode;
    private initPlannerMode;
    private initOrbitCube;
    private selectedElementsDict;
    private selectableElementsDict;
    private setAllElementsSelectable;
    private selectedDockingPoint;
    private allPlannedElementsDict;
    private allVisualizedNotPlannedElements;
    private informViewElemSelectionChanged;
    private deletePlannerElement;
    private copyPlannerElement;
    private getConfiguratorState;
    private getOrbitInteractionAPI;
    private planner_view_config;
    getPosNrByBasketId: (basketId: string) => number;
    private updatePlannerView;
    private forceViewToEnterPlannerMode;
    productState: ProductState;
    private aiState;
    private _lastSetIdUpdated?;
    private updateExternalPlannerState;
    private setBBox?;
    constructor(onElemSelectionChanged: (plannerElements: PlannerElementData[], dp?: DockingPoint) => void, getConfiguratorState: () => TabGroupTypes, productState: ProductState, aiState: AIState, forceViewToEnterPlannerMode: (doShowInfo: boolean) => void, getOrbitInteractionAPI: () => CubeControlApi | null | undefined, getPosNrByBasketId: (basketId: string) => number, updateExternalPlannerState: () => void);
    initFunctions(deletePlannerElement: (setId: string, elementId: number) => Promise<void>, copyPlannerElement: (setId: string, elementId: number, copyInfo: ParamPlanPlannerElementInfo) => Promise<void>, setBBox: (bbox: BBoxType) => void): void;
    /**
     * This function is called to initialize everything in the 3D image handler and the 2D Grid
     * @param updatePlannerTrans
     * @param useBoxPlanner True if the current planner is a Box Planner.
     */
    initPlannerView(viewConfig: ViewConfigData, productState: ProductState, aiState: AIState, settingsState: SettingsState, updatePlannerTrans: (setId: string, plannerElementID: number, deltaMove: Vector3, deltaAngleDeg: number, rotCorrection: number, transState: 'START' | 'UPDATE' | 'END', autoDockingDistance: number) => void, updatePlannerView: (callingFrom: ViewChangedCause) => void, plannerPaletteViewInfo: PlannerPaletteViewDataType | undefined): Promise<void>;
    private getPlannerElementByElemId;
    private getAllPlannedElements;
    /**
     * This function calls the update UI function in the currently displaying planner mode.
     */
    private updateUI;
    /**
     * This function is called to clear the view - the 3D image is cleared and the 3D Grid is disabld. as well as the 2D Canvas is cleard
     */
    clearView: () => void;
    /**
     * This function returns the current plannerViewConfig. This configuration file is saved for each client
     */
    getPlannerViewConfig: () => ViewPlannerConfig;
    /**
     * Returns true if the 3D Grid is enabled
     */
    getPlanner3DGridEnabled: () => boolean | undefined;
    getPlanner3DGridIsInTransformMode: () => boolean | undefined;
    /**
     * This function is called when an element is deleted
     * @param setId
     * @param elementId
     */
    onElementDeleted: (setId: string, elementId: number) => void;
    /**
     * This function is called when the user selects manually a new element in the planner.
     * The UI is updated and the configurator is informed
     * @param elementId
     */
    onElementSelected: (setId: string, elementId: number, dp?: DockingPoint, notEffects?: boolean) => void;
    onElementRotationClockwise: (setId: string, elementId: number) => void;
    onElementRotationCounterClockwise: (setId: string, elementId: number) => void;
    /**
     * This function should be called if no element is selected
     */
    onClearElementSelection: () => void;
    /**
     * This function is called when the user interacts with the dockingPoints in the scene.
     * When a AVL or AVR is selected then the Article list is filtered and an element is docked only to this DP.
     * When the AVL or AVR was already selected, the selection is cleared.
     * When a AVO/AVU/AVC is selected that was not docked - the list is filtered and the selected element is docked only to this DP.
     * When a AVO/AVU/AVC is selected that is docked - delete Ref element
     * @param elementId     The elementId of the planner element the user is interacting with
     * @param dpId          The id of the docking Point the user is interacting with
     */
    onDockingPointInteraction: (setId: string, elementId: number, dpId: string, dpIsSelected: boolean, onDockingElementId: number | undefined) => void;
    /**
     * This function is called to copy an Element.
     * If a direction is specified it is copied to the left or right side. If Standard is set then it is placed depending on other rules
     * @param setId
     * @param elementId
     * @param plannerType Box or Standard Planner
     * @param copyDir
     */
    onElementCopy: (setId: string, elementId: number, copyIndex: {
        x: number;
        y: number;
        z: number;
    }) => Promise<void>;
    /**
     * This function is called when the user clicks on the planner view.
     * It evaluates if elements are selected or if the element selection should be cleared
     * @param e the event
     */
    handleUIInteraction(e: MouseEvent, tabGroupType: any): void;
    /**
     * This function is called when the 3D Grid should be displayed/Disabled.
     * If forceClose is set - the grid is closed! it is called every time the planner step is exited
     * @param forceClose
     */
    handlePlanner3DGridChanged(forceClose?: boolean, forceActive?: boolean): void;
    /**
     * This function is called every time the configurator enters the planner mode
     * It updates the element selection - in the planner mode, only one element can be selected at a time.
     */
    enterPlannerMode: (firstTime?: boolean) => void;
    /**
     * This function returns all selected elements by their elementID
     */
    getSelectedElements: () => Map<string, PlannerElementData[]>;
    getElementById: (id: number) => PlannerElementData | undefined;
    getSelectedElementsArr: (forceSingleElement?: boolean) => PlannerElementData[];
    /**
     * This function returns the currently selected DP. If none is selected the result is null.
     */
    getSelectedDockingPoint: () => DockingPoint | undefined;
    /**
     * This function is called when a new rendering is loaded
     * @param rendering the rendering that should be displayed in the view
     * @alternateRenderingsExist is true, if the catalog has alternate renderings. False if no alternate renderings exist
     */
    updatePlanner3DImage: (rendering: Rendering, onlyUpdateState?: boolean) => void;
    setRotationOfOrbitCube: (forceOrbitTo: boolean, rotHorizontal: number, rotVertical: number) => void;
    getOrbitCubeInitParams: () => {
        rotHorizontal: number;
        rotVertical: number;
    };
    updateOrbitCubeInitParams: (rotHorizontal: number, rotVertical: number) => void;
    /**
     * This function is called when the user wants to save the current 2D Planning in a JPG file
     */
    get2DPlanning2DAsJPG: () => string;
    /**
     * This function is called when the view should update the 2D View
     */
    updatePlanner2DGrid: (boundingBox: BboxInfo2D) => void;
    updatePlannerElements: (elements: Map<string, PlannerElementData[]>, visualizedNotPlannedElements: Map<string, IDivaViewVisualizedNotPlannedElement[]>, setId?: string, elementId?: number, notEffects?: boolean) => void;
    /**
     * This function is called when the articles (selected and selectable) are changed. This is done when the configurator has changed
     * If we work with the box planner - in one set only one BoxPlanner can be selected. If multiple should be selected - select the latest one
     * @param articleInfos
     */
    updateElementSelectionConfig: (articleInfos: {
        [posNum: number]: ArticleInfoType;
    }, allSelectable?: boolean) => void;
    private getElementCountInDict;
    /**
     * This function is called from the logic when the logic decides a new element has to be selected.
     * @param selectedElementSetIds The setIds of the corresponsting elements ids. [0] of set ids corresponds to [0] in element id
     * @param selectedElements  The elements that are now selected
     * @param setOthersSelectable   If true - all not selected elements are selectable
     */
    updateElementSelectionPlanner: (selectedElementSetIds: string[], selectedElementIds: number[], setOthersSelectable: boolean, somethingChanged?: boolean) => void;
    /**
     * Returns the planner view mode that is currectly used for visualization.
     * No means - no planner view is shown at all
     */
    getCurPlannerViewMode: () => PlannerMode;
    isAny3DVisualization: () => boolean;
    getInitPlannerViewMode: () => PlannerMode;
    initPlannerViewMode(mode: PlannerMode): void;
    setCurPlannerViewMode(mode: PlannerMode): void;
    get PlannerUIHandler(): PlannerUI;
    get astSetIdUpdated(): string | undefined;
    get SelectedElementsPosNrs(): string[];
}
//# sourceMappingURL=ViewPlannerHandler.d.ts.map