import { Matrix4, Cartesian3, CustomDataSource, ScreenSpaceEventHandler, Viewer, EntityCollection, Entity, LabelGraphics, PointGraphics, PolylineGraphics, PolygonGraphics, Property, PositionProperty, JulianDate, PolygonHierarchy, Event, Cartographic, Geometry } from "cesium"; /** * Add height to a cartesian coordinate * @param position Cartesian position * @param height Height to increase */ declare function increaseHeight(position: Cartesian3, height?: number): Cartesian3; /** * Add height to a cartesian coordinate * @param position Cartesian position * @param height Height to set */ declare function setHeight(position: Cartesian3, height: number): Cartesian3; /** * Get local positions with east-north-up coordinate system. * @param origin Origin point position. * @param cartesians Other positions. */ declare function getEastNorthUpPositions(origin: Cartesian3, ...cartesians: Cartesian3[]): [ Cartesian3[], Matrix4, Matrix4 ]; /** * Get regular polygon positions. * @param center Position of center. * @param radius Radius of polygon. * @param sides Number of sides, must be greater than 3. * @returns */ declare function getRegularPolygonPositions(center: Cartesian3, radius: number, sides: number): any[]; /** * Get heading degree. * @param p1 The first position. * @param p2 Another position. * @returns Heading degree. */ declare function getHeadingDegree(p1: Cartesian3, p2: Cartesian3): number; /** * Get pitch degree. * @param p1 The first position. * @param p2 Another position. * @returns Pitch degree. */ declare function getPitchDegree(p1: Cartesian3, p2: Cartesian3): number; /** * The interface for all properties, which represent a value that can optionally vary over time. * This type defines an interface and cannot be instantiated directly. */ interface IProperty { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets the value of the property at the provided time. * @param time - The time for which to retrieve the value. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time: JulianDate, result?: any): T; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } interface PointEntity extends Entity { point: PointGraphics; position: PositionProperty; } interface LabelEntity extends Entity { label: LabelGraphics; position: PositionProperty; } interface PolylineEntity extends Entity { polyline: Omit & { positions: IProperty; }; } interface PolygonEntity extends Entity { polygon: Omit & { hierarchy: IProperty; }; } type DrawerConstructorOptions = { viewer: Viewer; dataSourceName?: string; }; type LabelOptions = Omit & { text?: string | ((position: Cartesian3, index: number, positions: Cartesian3[]) => string); height?: number | ((drawer: Drawer) => number); }; type DrawPolylineOptions = { point?: PointGraphics.ConstructorOptions | boolean; label?: LabelOptions | boolean; polyline?: Omit; showGuidance?: boolean; stopAfterFinish?: boolean; isFinished?: (drawer: Drawer) => boolean; onFinished?: (drawer: Drawer) => any; }; type DrawPolygonOptions = DrawPolylineOptions & { polygon?: Omit; }; type DataSet = { point?: PointEntity; label?: LabelEntity; position: Cartesian3; }; type PositionData = { position: Cartesian3; index: number; positions: Cartesian3[]; }; type PolylineDataSet = { polyline: PolylineEntity; dataSets: DataSet[]; }; type PolygonDataSet = PolylineDataSet & { polygon: PolygonEntity; }; declare class Drawer { /** Gets the Viewer instance */ viewer: Viewer; /** Gets the DataSource instance to be visualized */ dataSource: CustomDataSource; /** Gets the collection of Entity instances */ entities: EntityCollection; /** Gets the set of Entity instances contain PolygonGraphic and its dataset */ polylines: PolylineDataSet[]; /** Gets the set of Entity instances contain PolygonGraphic and its dataset */ polygons: PolygonDataSet[]; /** Gets the set of Entity instances that are being painted */ drawingEntities: Entity[]; /** Gets the screen space event handler */ handler: ScreenSpaceEventHandler | undefined; constructor(options: DrawerConstructorOptions); /** * Create point entity * @param position A Cartesian3 that specify the position of point * @param options Object that specify properties of PointGraphic */ createPoint(position: Cartesian3, options?: PointGraphics.ConstructorOptions): PointEntity; /** * Create label entity * @param data Object that contains positions data of PointGraphic * @param options Object that specify properties of PointGraphic */ createLabel(data: PositionData, options?: LabelOptions): LabelEntity; /** * Draw polyline graphic * @param options Object that specify options of drawing */ drawPolyline(options?: DrawPolylineOptions): void; /** * Draw polygon graphic * @param options Object that specify options of drawing */ drawPolygon(options?: DrawPolygonOptions): void; /** * Cancel drawing */ cancel(): void; /** * Remove drawing entities */ removeDrawingEntities(): void; /** * Remove all entities */ removeAll(): void; /** * Destory drawer * @param keepEntities Should keep entities after destory. */ destory(keepEntities?: boolean): void; } type onSampleSucceeded = (err: null, result: Cartographic[]) => any; type onSampleFailed = (err: any) => any; type Options = { onSample?: onSampleSucceeded & onSampleFailed; }; declare function terrainSamplerMixin(viewer: Viewer, options?: Options): void; interface ContinuousWallGeometryOptions { positions: Cartesian3[]; minimumHeights?: number[]; maximumHeights?: number[]; } /** * Create wall geometry with st that calculated by distance between positions. * @param options Options to create a wall geometry. */ declare function createContinuousWallGeometry(options?: ContinuousWallGeometryOptions): Geometry; export { increaseHeight, setHeight, getEastNorthUpPositions, getRegularPolygonPositions, getHeadingDegree, getPitchDegree, DrawerConstructorOptions, LabelOptions, DrawPolylineOptions, DrawPolygonOptions, DataSet, PositionData, PolylineDataSet, PolygonDataSet, Drawer, terrainSamplerMixin, IProperty, PointEntity, LabelEntity, PolylineEntity, PolygonEntity, createContinuousWallGeometry };