UNPKG

@metacell/geppetto-meta-ui

Version:

React components from geppetto-meta to create neuroscience applications and visualize data.

127 lines (126 loc) 4.95 kB
export default class MeshFactory { constructor(scene: any, linesThreshold: number, renderingThreshold: number, depthWrite: boolean, linePrecisionMinRadius: number, minAllowedLinePrecision: number, particleTexture: any, dracoDecoderPath: any, THREE: any); scene: any; depthWrite: boolean; meshes: {}; splitMeshes: {}; visualModelMap: {}; connectionLines: {}; complexity: number; sceneMaxRadius: number; linePrecisionMinRadius: number; minAllowedLinePrecision: number; linesThreshold: number; renderingThreshold: number; particleTexture: any; dracoDecoderPath: any; THREE: any; instancesMap: Map<any, any>; setupLoaders(): void; loaders: { [x: number]: OBJLoader | DRACOLoader | GLTFLoader | ColladaLoader; TextureLoader: any; }; start(instancesMap: any): Promise<void>; getMeshes(): {}; traverseInstances(instances: any): Promise<void>; buildVisualInstance(instance: any): Promise<void>; generate3DObjects(instance: any): Promise<any[]>; getMeshPhongMaterial(color: any): any; getLineMaterial(color: any): any; setThreeColor(threeColor: any, color: any): void; walkVisTreeGen3DObjs(instance: any, materials: any): Promise<any[]>; walkVisTreeGen3DObjsVisualType(visualType: any, instance: any, materials: any): Promise<any[]>; create3DObjectFromInstance(instance: any, node: any, id: any, materials: any): Promise<any>; getDefaultGeometryType(): "lines" | "cylinders"; createParticles(node: any): any; create3DLineFromNode(node: any, material: any): any; create3DSphereFromNode(sphereNode: any, material: any): any; create3DCylinderFromNode(cylNode: any, material: any): any; loadColladaModelFromNode(node: any): any; loadThreeOBJModelFromNode(node: any): void | import("three").Group<import("three").Object3DEventMap> | import("three/examples/jsm/loaders/ColladaLoader").Collada; loadThreeGLTFModelFromNode(node: any): Promise<any>; loadThreeDRCModelFromNode(node: any): Promise<any>; parseBase64(str: any): any; modelLoader(loader: any, url: any): Promise<any>; modelParser(loader: any, data: any): Promise<any>; init3DObject(meshes: any, instance: any): void; merge3DObjects(objArray: any, materials: any): any; /** * Split merged mesh into individual meshes * * instance - original instance * groups - The groups that we need to split mesh into * @param instance * @param groupElements */ splitGroups(instance: any, groupElements: any): void; /** * Add mesh to geometry groups * * instancePath - Path of aspect, corresponds to original merged mesh * id - local path to the group * groups - The groups that we need to split mesh into * m - current mesh * @param instance * @param id * @param geometryGroups * @param m */ addMeshToGeometryGroup(instance: any, id: any, geometryGroups: any, m: any): boolean; /** * Create group meshes for given groups, retrieves from map if already present * @param instancePath * @param geometryGroups * @param groups */ createGroupMeshes(instancePath: any, geometryGroups: any, groups: any): void; /** * Changes the color of a given instance * * @param instancePath * @param color */ setColor(instancePath: any, color: any): void; /** * Get Meshes associated to an instance * * instancePath - Path of the instance * @param instancePath */ getRealMeshesForInstancePath(instancePath: any): any[]; /** * Checks if instance has a mesh * * @param instance */ hasMesh(instance: any): boolean; /** * Traverse through THREE object to calculate that complexity (ammount of 3d objects) * with this and calculateSceneMaxRadius, we can estimate how dense the scene is to implement any wanted optimization behavior * @param object */ calculateSceneComplexity(object: any): void; /** * Traverse through THREE object to calculate that maximun radius based * on bounding sphere of visible objects * @param object */ calculateSceneMaxRadius(object: any): void; /** * Calculates linePrecision used by raycaster when picking objects. */ getLinePrecision(): any; rayCasterLinePrecision: any; cleanWith3DObject(instance: any): void; clean(): void; setParticleTexture(particleTexture: any): void; /** * Sets linesThreshold */ setLinesThreshold(linesThreshold: any): void; } import { OBJLoader } from "./OBJLoader"; import { DRACOLoader } from "three/examples/jsm/loaders/DRACOLoader"; import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader"; import { ColladaLoader } from "three/examples/jsm/loaders/ColladaLoader";