import { ISceneChildProps, ISceneChildSettings, IStreamArguments, IBufferIndex, IPropArguments, IShapeBounding } from './types'; import { Scene } from './Scene'; /** * The element to be added into a scene. * Preserve props, drawing order, generate and return buffers. * The only implementations of this class are Group and ShapeBase * * @abstract * @category Scene * @order 2 * @class SceneChild */ declare abstract class SceneChild = ISceneChildProps> { /** * Reference of the scene to which it is attached * * @type {Scene} */ scene?: Scene; /** * The unique id * * @type {number | string} */ id: number | string; /** * The human readable name * * @type {string} */ name: string; /** * The human readable type label * * @type {string} */ type: string; /** * The number that refers to the drawinf order * * @type {number} */ order?: number; /** * The basic properties * * @protected * @type {Props} */ protected props: Props; /** * Custom client data * * @type {*} */ data: any; /** * Shape generation id * used for prevent buffer calculation * * @internal * @ignore */ generateId: number; /** * Creates an instance of SceneChild. * Base values will be assigned in case they are not passed * * @param {ISceneChildSettings} settings */ constructor(settings: ISceneChildSettings); /** * With this method it is possible to check if the buffer will be generated at each update * * @abstract * @returns {boolean} */ abstract isStatic(): boolean; /** * With this method you can check if the streaming buffer will be generated at each update * * @abstract * @returns {boolean} */ abstract isStaticIndexed(): boolean; /** * Find this or form or children. * Overridden by classes that extend it * * @param {string | number} idOrName * @returns {(SceneChild | null)} */ find(idOrName: string | number): SceneChild | null; /** * Return the sceneChild properties * * @returns {Props} */ getProps(): Props; /** * Return a sceneChild prop or default value * * @param {keyof Props} key * @param {PropArguments} [propArguments] * @param {*} [defaultValue] * @returns {*} */ getProp(key: keyof Props, propArguments?: PropArguments, defaultValue?: any): any; /** * Check SceneChild has prop * * @param {keyof Props} key * @returns */ hasProp(key: keyof Props): boolean; /** * Set a single or multiple props and clear buffer if shape vertex depends from prop * * @abstract * @template Props * @param {(Props | Partial)} key * @param {ISceneChildProps[Props]} [value] * @param {boolean} [bClearIndexed] */ abstract setProp(key: T | Partial, value?: Props[T], bClearIndexed?: boolean): void; /** * Set a single or multiple props * * @param {(keyof ISceneChildProps | ISceneChildProps)} key * @param {*} [value] */ setPropUnsafe(key: keyof ISceneChildProps | ISceneChildProps, value?: any): void; /** * Generate shape. * Best explained in ShapeBase * * @abstract * @param {number} generateId * @param {boolean} bDirectSceneChild * @param {PropArguments} parentPropArguments */ abstract generate(generateId: number, bDirectSceneChild: boolean, parentPropArguments?: IPropArguments): void; /** * Check if the shape is generated on id `generateId` * * @abstract * @param {number} generateId * @return {*} {boolean} */ abstract isGenerated(generateId: number): boolean; /** * Get buffer bounding * * @abstract * @returns {IShapeBounding } */ abstract getBounding(): IShapeBounding; /** * Stream shape * Best explained in ShapeBase * * @abstract * @param {(streamArguments: IStreamArguments) => void} callback */ abstract stream(callback: (streamArguments: IStreamArguments) => void): void; /** * Return buffer of vertext if is generated * * @returns {(Float32Array | undefined)} */ abstract getBuffer(): Float32Array | undefined; /** * Return indexed buffer * * @returns {(Array | undefined)} */ abstract getIndexedBuffer(): Array | undefined; /** * Get length of buffer * * @abstract * @param {IPropArguments | undefined} [propArguments] * @returns {number} */ abstract getBufferLength(propArguments?: PropArguments): number; /** * Clear buffer * * @abstract * @param {boolean} [bClearIndexed] * @param {boolean} [bPropagateToParents] */ abstract clearBuffer(bClearIndexed: boolean, bPropagateToParents: boolean): void; } export { SceneChild }; //# sourceMappingURL=SceneChild.d.ts.map