UNPKG

@itwin/measure-tools-react

Version:
81 lines 3.8 kB
import type { Id64String } from "@itwin/core-bentley"; import type { XYZProps } from "@itwin/core-geometry"; import { Arc3d, 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"; export interface RadiusMeasurementProps extends MeasurementProps { startPoint?: XYZProps; midPoint?: XYZProps; endPoint?: XYZProps; } export declare class RadiusMeasurementSerializer extends MeasurementSerializer { static readonly radiusMeasurementName = "radiusMeasurement"; get measurementName(): string; isValidType(measurement: Measurement): boolean; protected parseSingle(data: MeasurementProps): Measurement | undefined; } export declare class RadiusMeasurement extends Measurement { static readonly serializer: MeasurementSerializer | undefined; private _arc; private _startPoint; private _midPoint; private _endPoint; private _textMarker?; private _isDynamic; get isDynamic(): boolean; set isDynamic(v: boolean); constructor(props?: RadiusMeasurementProps); get startPointRef(): Point3d | undefined; get midPointRef(): Point3d | undefined; get endPointRef(): Point3d | undefined; get arcRef(): Arc3d | undefined; get radius(): number | undefined; /** Create an arc from midpoint, start and end */ private _createArcFrom; private _updateArc; readFromJSON(props: RadiusMeasurementProps): void; /** * Serializes properties to a JSON object. * @param json JSON object to append data to. */ protected writeToJSON(json: MeasurementProps): 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; setStartPoint(point: Point3d): void; setMidPoint(point: Point3d): void; setEndPoint(point: Point3d): void; testDecorationHit(pickContext: MeasurementPickContext): boolean; getDecorationToolTip(_pickContext: MeasurementPickContext): Promise<HTMLElement | string>; getDecorationGeometry(_pickContext: MeasurementPickContext): GeometryStreamProps | undefined; private _getSnapId; protected onTransientIdChanged(_prevId: Id64String): void; private _createInViewArc; decorate(context: DecorateContext): void; protected getDataForMeasurementWidgetInternal(): Promise<MeasurementWidgetData>; /** Make sure the text is still on screen even if parts of the graphics are outside. * Returned point is in WORLD coordinates. */ private calculateTextLocation; private createTextMarker; private updateMarkerStyle; protected onStyleChanged(_isLock: boolean, _prevStyle: string): void; protected onLockToggled(): void; onDisplayUnitsChanged(): void; private _handleTextMarkerButtonEvent; static fromJSON(data: RadiusMeasurementProps): RadiusMeasurement; static create(startPoint: Point3d, midPoint?: Point3d, endPoint?: Point3d, viewType?: string): RadiusMeasurement; } //# sourceMappingURL=RadiusMeasurement.d.ts.map