UNPKG

@itwin/measure-tools-react

Version:
85 lines 3.85 kB
import type { Id64String } from "@itwin/core-bentley"; import type { XYZProps } from "@itwin/core-geometry"; import { Point3d } from "@itwin/core-geometry"; import type { GeometryStreamProps } from "@itwin/core-common"; import type { DecorateContext } from "@itwin/core-frontend"; import type { MeasurementEqualityOptions, MeasurementWidgetData } from "../api/Measurement.js"; import { Measurement, MeasurementPickContext, MeasurementSerializer } from "../api/Measurement.js"; import type { MeasurementProps } from "../api/MeasurementProps.js"; import { Polygon } from "../api/Polygon.js"; /** * Props for serializing a [[AreaMeasurement]]. */ export interface AreaMeasurementProps extends MeasurementProps { polygonPoints: XYZProps[]; } /** Serializer for a [[AreaMeasurement]]. */ export declare class AreaMeasurementSerializer extends MeasurementSerializer { static readonly areaMeasurementName = "areaMeasurement"; get measurementName(): string; isValidType(measurement: Measurement): boolean; isValidJSON(json: any): boolean; protected parseSingle(data: MeasurementProps): Measurement | undefined; } /** * Area measurement. A polygon with formatted area in a "text pill" at the center. */ export declare class AreaMeasurement extends Measurement { static readonly serializer: MeasurementSerializer | undefined; private _polygon; private _isDynamic; private _dynamicEdge?; private _cachedGraphic?; get isDynamic(): boolean; set isDynamic(isDynamic: boolean); get polygon(): Polygon; get polygonPoints(): Point3d[]; get isValidPolygon(): boolean; constructor(props?: AreaMeasurementProps); private handleTextMarkerButtonEvent; addPointToDynamicPolygon(point: Point3d): boolean; updateDynamicPolygon(point: Point3d): void; closeDynamicPolygon(): boolean; testDecorationHit(pickContext: MeasurementPickContext): boolean; getDecorationGeometry(_pickContext: MeasurementPickContext): GeometryStreamProps | undefined; getDecorationToolTip(_pickContext: MeasurementPickContext): Promise<HTMLElement | string>; private getSnapId; protected clearCachedGraphics(): void; onCleanup(): void; protected onTransientIdChanged(_prevId: Id64String): void; private addDynamicSnapGraphic; onDrawingMetadataChanged(): void; decorate(context: DecorateContext): void; private drawDynamicArea; private drawDynamicPolygonShape; protected getDataForMeasurementWidgetInternal(): Promise<MeasurementWidgetData>; protected onStyleChanged(isLock: boolean, _prevStyle: string): void; protected onDisplayLabelsToggled(): void; protected onLockToggled(): void; onDisplayUnitsChanged(): void; /** * Tests equality with another measurement. * @param other Measurement to test equality for. * @param opts Options for equality testing. * @returns true if the other measurement is equal, false if some property is not the same or if the measurement is not of the same type. */ equals(other: Measurement, opts?: MeasurementEqualityOptions): boolean; /** * Copies data from the other measurement into this instance. * @param other Measurement to copy property values from. */ protected copyFrom(other: Measurement): void; /** * Deserializes properties (if they exist) from the JSON object. * @param json JSON object to read data from. */ protected readFromJSON(json: MeasurementProps): void; /** * Serializes properties to a JSON object. * @param json JSON object to append data to. */ protected writeToJSON(json: MeasurementProps): void; static create(pts: Point3d[], viewType?: string): AreaMeasurement; static fromJSON(data: AreaMeasurementProps): AreaMeasurement; } //# sourceMappingURL=AreaMeasurement.d.ts.map