import { type ThinEngine } from "@onerjs/core/Engines/thinEngine.js"; import { type Nullable } from "@onerjs/core/types.js"; import { type SmartFilterRuntime, InternalSmartFilterRuntime } from "./runtime/smartFilterRuntime.js"; import { type BaseBlock } from "./blockFoundation/baseBlock.js"; import { type ConnectionPointType } from "./connection/connectionPointType.js"; import { type ConnectionPoint } from "./connection/connectionPoint.js"; import { OutputBlock } from "./blockFoundation/outputBlock.js"; import { RenderTargetGenerator } from "./runtime/renderTargetGenerator.js"; import { type IEditorData } from "@onerjs/shared-ui-components/nodeGraphSystem/interfaces/nodeLocationInfo.js"; import { type IDisposable } from "./IDisposable.js"; /** * Data passed to the initialize function of the blocks. */ export type InitializationData = { /** * The current smart filter runtime the block is being initialized for. */ readonly runtime: InternalSmartFilterRuntime; /** * The output block of the smart filter. * This is used to determine if a block is linked to the output block so that we can prevent an * extra render pass. */ readonly outputBlock: OutputBlock; /** * The list of promises to wait for during the initialization step. */ readonly initializationPromises: Promise[]; /** * Resources that need to be disposed when the runtime is disposed. */ readonly disposableResources: IDisposable[]; }; /** * The smart filter class is the main class of the smart filter module. * * It is responsible for managing a graph of smart filter blocks. * * It is also responsible for creating the runtime associated to the current state of the filter. */ export declare class SmartFilter { /** * The friendly name of the smart filter. */ readonly name: string; /** * The namespace of the smart filter. */ readonly namespace: Nullable; /** * The smart filter output (input connection point of the output block...). * * This is where the smart filter final block should be connected to in order to be visible on screen. */ readonly output: ConnectionPoint; /** * The output block of the smart filter. */ readonly outputBlock: OutputBlock; /** * User defined comments to describe the current smart filter. */ comments: Nullable; /** * Data used by the smart filter editor. */ editorData: Nullable; private readonly _attachedBlocks; /** * Creates a new instance of a @see SmartFilter. * @param name - The friendly name of the smart filter * @param namespace - The namespace of the smart filter */ constructor(name: string, namespace?: Nullable); /** * @returns the list of blocks attached to the smart filter. */ get attachedBlocks(): ReadonlyArray; /** * @returns The current class name of the smart filter. */ getClassName(): string; /** * Registers a block to be part of this smart filter. * @param block - The block to register on the smart filter * @throws if the block is already registered on another smart filter * @remarks This function will not register the block if it is already registered on the smart filter. */ registerBlock(block: BaseBlock): void; /** * Removes the block from the smart filter. * @param block - The block to remove from the smart filter * @remarks This function will disconnect the block on removal. * This Output block cannot be removed. */ removeBlock(block: BaseBlock): void; private _generateCommandsAndGatherInitPromises; /** * Create a new runtime for the current state of the smart filter. * @param engine - The Babylon.js engine to use for the runtime * @param renderTargetGenerator - The render target generator to use to generate the RTTs for the shader blocks. If not provided, a default one will be created. * @returns the runtime that can be used to render the smart filter */ createRuntimeAsync(engine: ThinEngine, renderTargetGenerator?: RenderTargetGenerator): Promise; /** * Resizes any intermediate textures according to the new size of the render target * @param engine - The engine used to render the smart filter */ resize(engine: ThinEngine): void; /** * @internal * Merges all aggregate blocks into the smart filter graph, executes the passed-in work, then restores the aggregate blocks. * @param work - The work to execute with the aggregate blocks merged */ _workWithAggregateFreeGraph(work: () => void): void; } //# sourceMappingURL=smartFilter.d.ts.map