@itwin/measure-tools-react
Version:
Frontend framework and tools for measurements
53 lines • 2.48 kB
TypeScript
import type { DecorateContext, GraphicBuilder, HitDetail, IModelConnection, ScreenViewport } from "@itwin/core-frontend";
import { Point3d } from "@itwin/core-geometry";
import { Transform } from "@itwin/core-geometry";
import { Point2d } from "@itwin/core-geometry";
import type { DrawingMetadata } from "./Measurement.js";
export declare namespace SheetMeasurementsHelper {
/** This maps directly to the viewType field found in the schema on BisCore.viewAttachment */
enum DrawingType {
CrossSection = 3,
Profile = 5,
Plan = 6
}
/**
* Used as parameter for measurement transform operation which is a 3 step process
*/
interface SheetTransformParams {
masterOrigin: Point3d;
sheetTov8Drawing: Transform;
v8DrawingToDesign: Transform;
}
interface DrawingTypeData {
origin: Point2d;
extents: Point2d;
type: DrawingType;
}
/**
* @param imodel
* @param id SheetViewDefinition ID
* @param mousePos position of the mouse click
* @returns Drawing metadata
*/
function getDrawingId(imodel: IModelConnection, id: string, mousePos: Point3d): Promise<DrawingMetadata | undefined>;
function checkIfInDrawing(point: Point3d, drawingOrigin: Point2d, drawingExtents: Point2d): boolean;
function getDrawingContourGraphic(context: DecorateContext, origin: Point2d, extents: Point2d): GraphicBuilder;
/**
* Uses drawing metaData to transform a point from sheet coordinates to 3d world coordinates
* @param point In sheet coordinates
* @param transform
* @returns Point in world coordinates
*/
function measurementTransform(point: Point3d, transform: SheetTransformParams): Point3d;
function getSheetTypes(imodel: IModelConnection, id: string): Promise<DrawingTypeData[]>;
/**
* Checks if the drawing pointed by the event is allowed according to the provided drawing types
* Will return true if no drawing detected
* @param ev
* @param allowedDrawingTypes
* @returns
*/
function checkIfAllowedDrawingType(viewport: ScreenViewport | undefined, point: Point3d, allowedDrawingTypes: DrawingType[]): boolean;
function getSheetToolTipText(hit: HitDetail, allowedDrawingTypesList: SheetMeasurementsHelper.DrawingType[], defaultToolTip: (hit: HitDetail) => Promise<HTMLElement | string>): Promise<string | HTMLElement>;
}
//# sourceMappingURL=SheetMeasurementHelper.d.ts.map