UNPKG

primitive-primitives

Version:

A small library providing simple yet fast implemintations of primitives for CesiumJS

121 lines (114 loc) 5.25 kB
// Generated by dts-bundle v0.7.2 declare module 'primitive-primitives' { export * from "primitive-primitives/index"; } declare module 'primitive-primitives/index' { export { EllipsePrimitive } from "primitive-primitives/EllipsePrimitive"; } declare module 'primitive-primitives/EllipsePrimitive' { import { UpdateablePrimitive } from 'primitive-primitives/UpdateablePrimitive'; import { Primitive } from 'primitive-primitives/Primitive'; /** * EllipsePrimitive is implemented to be as minimal as possible. * Both border and fill are ON by default and you will need to disable them. * Both color and border color are just an array of 4 floats from 0 to 1 in the RGBA format, currently we do not support materials. */ export class EllipsePrimitive extends Primitive implements UpdateablePrimitive { /** * The ellipse constructor requires an ellipse center point a semiMinor and semiMajor, these are used to calculate the ellipses position and thus mandatory. * @param options The ellipses options. * @param options.center The ellipses center point in 3D space. * @param options.semiMajorAxis The ellipses big radius. * @param options.semiMinorAxis The ellipses small radius. * @param options.rotation The ellipses rotation, defaults to 0. * @param options.border an Object containing show:a boolean and style: a string that indicates the border style(solid/dashed) default: {show:true, style:solid} * @param options.fill Defines whether we should render the fill, defaults to true. * @param options.show Defines whether we should render the ellipse, defaults to true. * @param options.granularity The angular distance between points on the ellipse in radians, smaller values for smooter ellipses, bigger values for better performence, defaults to 0.3. */ constructor(options: { center: any; semiMajorAxis: number; semiMinorAxis: number; rotation?: number; border?: { show: boolean; style: string; }; fill?: boolean; show?: boolean; color?: number[]; borderColor?: number[]; granularity?: number; }); /** * @param value a Cesium.Cartesian3 value. */ center: any; semiMajor: number; semiMinor: number; rotation: number; color: number[]; borderColor: number[]; show: boolean; border: { show: boolean; style: string; }; showFill: boolean; /** * This will update the location of the ellipse for the next render, If any parameter is not defined in the data param it will default to the allready defined value. * * @param data */ updateLocationData(data: { center?; semiMajorAxis?: number; semiMinorAxis?: number; rotation?: number; }): void; /** * This is a Cesium only function it is called once each tick of the render engine, do NOT call it! * @param frameState */ update(frameState: any): void; /** * This is a cesium only function, cesium calles it when the user removes the primitive from a primitive collection. */ destroy(): void; protected shouldRender(): boolean; } } declare module 'primitive-primitives/UpdateablePrimitive' { export interface UpdateablePrimitive { updateLocationData(data: any): any; } } declare module 'primitive-primitives/Primitive' { /** * This is the default implementation of a primitive, all primitives extend this class. */ export abstract class Primitive { protected _show: boolean; protected _modelMatrix: any; protected _renderState: any; protected _drawCommand: any; protected _points: any; protected _indicesArray: number[]; protected _boundingVolume: any; protected _dirty: boolean; protected _lastMode: any; protected _color: number[]; protected _vertexArray: any; protected _shaderProgram: any; constructor(options: { show?: boolean; color?: number[]; }); color: number[]; show: boolean; isTranslucent(): boolean; protected shouldRender(): boolean; protected setupDrawCommand(drawCommand: any, vertexArray: any, primitiveType: any, translucent?: boolean, debugShowBoundingVolume?: boolean): void; } }