UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

43 lines (42 loc) 2.78 kB
import { CoreGraph } from '../../../../core/graph/CoreGraph'; import { ShaderNameByContextMap } from './ShaderName'; import { TypedNode } from '../../_Base'; import { NodeContext, BaseNodeByContextMap } from '../../../poly/NodeContext'; import { CoreGraphNodeId } from '../../../../core/graph/CoreGraph'; type BooleanByCoreGraphNodeId = Map<CoreGraphNodeId, boolean>; type BooleanByStringByShaderName<NC extends NodeContext> = Map<ShaderNameByContextMap[NC], BooleanByCoreGraphNodeId>; type InputNamesByShaderNameMethod<NC extends NodeContext> = (root_node: BaseNodeByContextMap[NC], shader_name: ShaderNameByContextMap[NC]) => string[]; interface NodeTraverserOptions { traverseChildren?: boolean; } export declare class TypedNodeTraverser<NC extends NodeContext> { private _parent_node; private _shader_names; private _inputNamesForShaderNameMethod; private _options?; protected _leaves_graph_id: BooleanByStringByShaderName<NC>; protected _graph_ids_by_shader_name: BooleanByStringByShaderName<NC>; private _outputs_by_graph_id; private _depth_by_graph_id; private _graph_id_by_depth; protected _graph: CoreGraph; protected _shaderName: ShaderNameByContextMap[NC]; constructor(_parent_node: TypedNode<NC, any>, _shader_names: ShaderNameByContextMap[NC][], _inputNamesForShaderNameMethod: InputNamesByShaderNameMethod<NC>, _options?: NodeTraverserOptions | undefined); private _traverseChildren; private reset; shaderNames(): ShaderNameByContextMap[NC][]; inputNamesForShaderName(root_node: BaseNodeByContextMap[NC], shader_name: ShaderNameByContextMap[NC]): string[]; traverse(rootNodes: BaseNodeByContextMap[NC][]): void; nodesForShaderName(shaderName: ShaderNameByContextMap[NC]): BaseNodeByContextMap[NC][]; sortedNodes(): BaseNodeByContextMap[NC][]; private _addNodesWithChildren; private _findLeavesFromRootNode; private _blockedInputNames; setBlockedInputNames(nodeType: string, inputNames: string[]): void; protected _findLeaves(node: BaseNodeByContextMap[NC]): void; getNodeInputs(node: BaseNodeByContextMap[NC]): (import("../../obj/_Base").BaseObjNodeType | import("../../sop/_Base").BaseSopNodeType | import("../../anim/_Base").BaseAnimNodeType | import("../../audio/_Base").BaseAudioNodeType | import("../../cop/_Base").BaseCopNodeType | import("../../event/_Base").BaseEventNodeType | import("../../gl/_Base").BaseGlNodeType | import("../../js/_Base").BaseJsNodeType | import("../../manager/_Base").BaseManagerNodeType | import("../../mat/_Base").BaseMatNodeType | import("../../post/_Base").BasePostProcessNodeType | import("../../rop/_Base").BaseRopNodeType | null)[]; private _findInputs; private _setNodesDepth; private _setNodeDepth; } export {};