import { Box3, Object3D } from "three"; import { IInfo, IModel } from "@inweb/viewer-core"; import { IHighlighter, IHighlightStyle } from "./Highlighter.types"; /** * Basic model implementation. */ export interface IModelImpl extends IModel { scene: Object3D; highlighter?: IHighlighter; initialize(): void; getUnits(): string; getUnitScale(): number; getUnitString(): string; getPrecision(): number; getInfo(): IInfo; getExtents(target: Box3): Box3; getObjects(): Object3D[]; getVisibleObjects(): Object3D[]; getObjectsByHandles(handles: string[]): Object3D[]; getHandles(): string[]; getHandlesByObjects(objects: Object3D[]): string[]; /** * Highlights the specified objects. * * An object is highlighted in one style: highlighting it again replaces its style, and * {@link unhighlight} removes it. The viewer selection highlights objects in the default style. * * @param handles - The list of object handles. * @param style - Name of a highlight style added by {@link setHighlightStyle}. Omitted, the objects are * highlighted in the default style, set by the highlight options of the viewer. Objects are not * highlighted in an unknown style. Models that do not support highlight styles ignore the style. */ highlight(handles: string[], style?: string): this; /** * Adds a named highlight style, or changes it. The objects highlighted in this style are redrawn with * the new settings. * * A model holds up to 8 highlight styles, the default one included; a new style beyond that is * ignored. Styles cannot be removed, so set the same names again to change them. The default style is * named `default` and is changed by the highlight options of the viewer. Models that do not support * highlight styles ignore this method. * * @param name - Style name. * @param style - Style settings. Unset settings take their default values, not the values set before. */ setHighlightStyle(name: string, style: IHighlightStyle): this; }