@webviz/subsurface-viewer
Version:
3D visualization component for subsurface reservoir data
59 lines (58 loc) • 2.27 kB
TypeScript
import type { PickingInfo, UpdateParameters } from "@deck.gl/core";
import { CompositeLayer } from "@deck.gl/core";
import type { ExtendedLayerProps, LayerPickInfo, ReportBoundingBoxAction } from "../utils/layerTools";
import type { RGBAColor, RGBColor } from "../../utils";
import { PrivatePolylinesLayer } from "./privatePolylinesLayer";
export interface PolylinesLayerProps extends ExtendedLayerProps {
/**
* Polyline vertices as [x, y, z, x, y, z....].
*/
polylinePoints: number[] | Float32Array;
/**
Start indices of the polylines counted in vertex indices.
For example, if there are 3 polylines of 2, 3, and 4 vertices each, startIndices should be [0, 2, 5].
*/
startIndices: number[] | Uint32Array;
/** Array of boolean flags or a single value indicating whether the polylines are closed.
* The polylines are considered to be open if not set.
*/
polylinesClosed?: boolean | boolean[];
/**
* Line color defined as RGB or RGBA array. Each component is in 0-255 range.
*/
color: RGBColor | RGBAColor;
/**
* The units of the line width, one of `'meters'`, `'common'`, and `'pixels'`.
*/
widthUnits: "meters" | "common" | "pixels";
/**
* Line width defined in width units.
*/
linesWidth: number;
/** 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;
reportBoundingBox?: React.Dispatch<ReportBoundingBoxAction>;
}
export default class PolylinesLayer extends CompositeLayer<PolylinesLayerProps> {
renderLayers(): [PrivatePolylinesLayer?];
initializeState(): void;
updateState({ props, oldProps }: UpdateParameters<PolylinesLayer>): void;
private rebuildDataAttributes;
getPickingInfo({ info }: {
info: PickingInfo;
}): LayerPickInfo;
private loadData;
private toArray;
private closePolylines;
private normalizeStartIndices;
private copyPolyline;
private closePolyline;
private getPolylinePoint;
private createIsClosedFunc;
}