UNPKG

@webviz/subsurface-viewer

Version:

3D visualization component for subsurface reservoir data

65 lines (64 loc) 2.5 kB
import type React from "react"; import type { UpdateParameters } from "@deck.gl/core"; import { CompositeLayer } from "@deck.gl/core"; import type { Material } from "../gpglLayers/typeDefs"; import type { ExtendedLayerProps, ReportBoundingBoxAction } from "../utils/layerTools"; import type { RGBColor } from "../../utils"; import PrivateTriangleLayer from "./privateTriangleLayer"; export type Params = { vertexArray: Float32Array; indexArray: Uint32Array; smoothShading: boolean; displayNormals: boolean; }; export interface TriangleLayerProps extends ExtendedLayerProps { /** Triangle vertexes. * Either an URL or an array of numbers. */ pointsData: string | number[] | Float32Array; triangleData: string | number[] | Uint32Array; color: RGBColor; /** Contourlines reference point and interval. */ contours: [number, number]; /** Enable lines around triangles. * default: false. */ gridLines: boolean; /** Surface material properties. * material: true = default material, coloring depends on surface orientation and lighting. * false = no material, coloring is independent on surface orientation and lighting. * or full spec: * material: { * ambient: 0.35, * diffuse: 0.6, * shininess: 32, * specularColor: [38, 38, 38], * } * Default value: true. */ material: Material; /** Will calculate normals for each vertex and enable phong shading. * If not set the shader will calculate constant normal for each triangle. * Only has effect if "material" is not set to false. */ smoothShading: boolean; /** Enable/disable depth testing when rendering layer. Default true. */ depthTest: boolean; /** If true means that input z values are interpreted as depths. * For example depth of z = 1000 corresponds to -1000 on the z axis. Default true. */ ZIncreasingDownwards: boolean; /** If true will display normals on all vertex's */ debug: boolean; reportBoundingBox?: React.Dispatch<ReportBoundingBoxAction>; } export default class TriangleLayer extends CompositeLayer<TriangleLayerProps> { get isLoaded(): boolean; rebuildData(reportBoundingBox: boolean): void; initializeState(): void; updateState({ props, oldProps }: UpdateParameters<TriangleLayer>): void; renderLayers(): [PrivateTriangleLayer?]; }