import type { SParentElementImpl } from "sprotty"; import type { CanvasLike } from "./canvasLike.js"; import { SCanvasContent } from "./sCanvasContent.js"; import type { SMarker } from "./sMarker.js"; /** * Manages a lookup for visible points * Keeps track of which points are currently selected, and evaluates which points must be visible based on this */ export declare class PointVisibilityManager { /** * Currently visible CanvasContents */ private visibleContents; /** * Dependants lookup */ private dependents; /** * Dependencies lookup */ private dependencies; /** * Dependencies lookup for dependencies which should be made visible as dependend * ONLY if the element is directly visible (not transitive) */ private peerDependencies; /** * Creates a new PointVisiblilityManager * * @param canvas the canvas which contains the points */ constructor(canvas: CanvasLike & SParentElementImpl); /** * Registers a new element in the visibility manager * Initializes the (peer) dependencies and dependants * * @param element the element to register */ private registerElement; /** * Helper to access a list in dependants * Creates new list if required * * @param id the id of the element * @returns the found list or the new created one */ private getDependantsList; /** * Helper to access a list in dependencies * Creates new list if required * * @param id the id of the element * @returns the found list or the new created one */ private getDependenciesList; /** * Helper to access a list in peerDependencies * Creates new list if required * * @param id the id of the element * @returns the found list or the new created one */ private getPeerDependenciesList; /** * Checks if a point with a specific id is visible * * @param id the id of the point to check * @returns true if the point should be visible */ isVisible(id: string): boolean; /** * Updates the selection state of a specific element * * @param element the element to update the state of * @param isSelected the new selection state */ setSelectionState(element: SCanvasContent | SMarker, isSelected: boolean): void; /** * Updates the selection state of a specific element to selected * * @param element the now selected element */ private setSelected; /** * Updates the selection state of a specific element to unselected * * @param element the now unselected element */ private setUnselected; /** * Makes dependencies recursively visible * Updates recursively. * * @param id the id of the point or element of which to make the dependencies visible */ private makeDependenciesVisible; /** * Makes the dependency recursively visible * Updates recursively. * Helper for makeDependenciesVisible and makePeerDependenciesVisible * * @param id the id of the point or element of which to make the dependencies visible * @param dependency the id of the dependency to update */ private makeDependencyVisible; /** * Makes dependencies recursively visible of peer dependencies * * @param id the id of the point or element of which to make the dependencies visible */ private makePeerDependenciesVisible; /** * Makes dependents recursively visible * Updates recursively. * * @param id the id of the point of which to make the dependents visible */ private makeDependentsVisible; /** * Gets or creates a VisibilityReason for a point and therefore marks it as visible * * @param id the id of the point * @returns the found or created VisibilityReason */ private getOrCreateVisibilityReason; /** * Recursively removes visible dependants if necessary * * @param id the id of the visible point to remove */ private updateDependants; /** * Recursively removes visible dependencies if necessary * * @param id the id of the visible point / element to remove */ private updateDependencies; /** * Recursively removes visible dependencies if necessary * Helper for updateDependencies and updatePeerDependencies * * @param id the id of the visible point / element to remove * @param dependency the id of the dependency to update */ private updateDependency; /** * Recursively removes visible peer dependencies if necessary * * @param id the id of the visible point / element to remove */ private updatePeerDependencies; } //# sourceMappingURL=pointVisibilityManager.d.ts.map