import type { DecorateContext, GraphicBuilder, HitDetail, ScreenViewport } from "@itwin/core-frontend"; import { type IModelConnection, InputSource } from "@itwin/core-frontend"; import type { TransformProps, XYProps, XYZProps } from "@itwin/core-geometry"; import { Point3d, Range2d } 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 SheetMeasurementHelper { enum DrawingTypeEnum { ProfileOrElevation = 5, Section = 3, Detail = 4, Plan = 6 } type DrawingType = DrawingTypeEnum | SheetMeasurementsHelper.DrawingType; interface SheetToWorldTransformProps { SVDOrigin?: XYZProps; SVDExtents?: XYZProps; SVDYaw?: number; SVDPitch?: number; SVDRoll?: number; sheetScale?: number; DVDOrigin?: XYProps; transformParams?: CivilSheetTransformParams; /** Raw sheet-to-profile transform as authored on the drawing, present only on profile/elevation drawings. */ sheetToProfileTransformProps?: TransformProps; } interface DrawingTypeData { id: string; type?: DrawingType; origin: { x: number; y: number; }; bBoxLow: { x: number; y: number; }; bBoxHigh: { x: number; y: number; }; } /** Controls how the drawing under a point is resolved. */ interface ResolveDrawingOptions { /** When supplied, the drawing owning the element under the cursor is preferred over the containing rectangle. * View attachment rectangles overlap, so the geometry actually picked is a stronger signal than the rectangles. */ viewport?: ScreenViewport; /** Input source used for the pick. Defaults to `InputSource.Mouse`. */ inputSource?: InputSource; } /** Information needed to use the old Civil transform but will eventually be removed @deprecated */ interface CivilSheetTransformParams { masterOrigin: Point3d; sheetTov8Drawing: Transform; v8DrawingToDesign: Transform; } /** * Maps out the drawing types of every drawing in the imodel * @param imodel * @returns */ function getDrawingsTypes(imodel: IModelConnection): Promise>; /** * Position and general information for every drawing in the given sheet * @param imodel * @param sheetId * @returns */ function getDrawingInfo(imodel: IModelConnection, sheetId: string): Promise; function checkIfInDrawing(point: Point3d, drawingOrigin: Point2d, drawingExtents: Point2d): boolean; /** * Sheet-space rectangle covered by a view attachment. * The placement bounding box is relative to the placement origin, so bBoxLow cannot be assumed to be zero. */ function getDrawingRange(drawing: DrawingTypeData): Range2d; /** * Drawings whose rectangle contains the point. * View attachment rectangles overlap, so more than one result means resolving from the point alone has to guess * between them. Callers that cannot pick an element may want to surface that to the user. */ function getDrawingsAtPoint(imodel: IModelConnection, sheetViewId: string, mousePos: Point3d): Promise; /** * 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 getCivilTransform(sheetToWorldTransform?: SheetToWorldTransformProps): Transform; /** * Main transform for drawings, takes a sheet point and transforms it to world coordinates * @param viewAttachmentOrigin * @param sheetToWorldTransform * @returns */ function getTransform(viewAttachmentOrigin?: XYProps, sheetToWorldTransformProps?: SheetToWorldTransformProps): Transform; /** * Gets the spatial info needed to create the transform, it will first check if it can do the generic transform but if not * every relation needed is present in the model, it'll try to fall back to the old civil method * @param imodel * @param drawing * @returns */ function getSpatialInfo(imodel: IModelConnection, drawing: DrawingTypeData): Promise; /** * Gives all the data needed for transforming points from 2d to 3d and what's needed to draw drawing contour * @param imodel * @param id * @param mousePos */ function getDrawingData(imodel: IModelConnection, id: string, mousePos: Point3d, options?: ResolveDrawingOptions): Promise<{ sheetToWorldTransform: Transform; sheetToProfileTransform?: Transform; viewAttachmentOrigin: { x: number; y: number; }; viewAttachmentExtent: { x: number; y: number; }; transformProps: SheetToWorldTransformProps; drawingId: string; drawingType?: DrawingType; } | undefined>; function getSheetToolTipText(hit: HitDetail, allowedDrawingTypesList: SheetMeasurementHelper.DrawingType[], defaultToolTip: (hit: HitDetail) => Promise): Promise; function getDrawingContourGraphic(context: DecorateContext, origin: Point2d, extents: Point2d): GraphicBuilder; /** * 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; /** * Resolves the drawing under the point along with everything needed to measure in it. * @param options pass a viewport to resolve from the element under the cursor rather than the containing rectangle */ function getDrawingMetadata(imodel: IModelConnection, id: string, mousePos: Point3d, options?: ResolveDrawingOptions): Promise; } /** * @deprecated Use SheetMeasurementHelper instead */ export declare namespace SheetMeasurementsHelper { /** This maps directly to the viewType field found in the schema on BisCore.viewAttachment * @deprecated Use SheetMeasurementHelper.DrawingType instead */ enum DrawingType { CrossSection = 3, Profile = 5, Plan = 6 } /** * Used as parameter for measurement transform operation which is a 3 step process * @deprecated use SheetMeasurementHelper.SheetTransformParams instead */ interface SheetTransformParams { masterOrigin: Point3d; sheetTov8Drawing: Transform; v8DrawingToDesign: Transform; } /** * @deprecated use SheetMeasurementHelper.DrawingTypeData instead */ interface DrawingTypeData { origin: Point2d; extents: Point2d; type: DrawingType; } /** * @deprecated Use SheetMeasurementHelper's functions instead * @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; /** * @deprecated use SheetMeasurementHelper.checkIfInDrawing instead * @param point * @param drawingOrigin * @param drawingExtents * @returns */ function checkIfInDrawing(point: Point3d, drawingOrigin: Point2d, drawingExtents: Point2d): boolean; /** * @deprecated use SheetMeasurementHelper.getDrawingContourGraphic instead * @param context * @param origin * @param extents * @returns */ function getDrawingContourGraphic(context: DecorateContext, origin: Point2d, extents: Point2d): GraphicBuilder; /** * Uses drawing metaData to transform a point from sheet coordinates to 3d world coordinates * @deprecated use SheetMeasurementHelper's functions instead * @param point In sheet coordinates * @param transform * @returns Point in world coordinates */ function measurementTransform(point: Point3d, transform: SheetTransformParams): Point3d; /** * @deprecated use SheetMeasurementHelper's functions instead */ function getSheetTypes(imodel: IModelConnection, id: string): Promise; /** * @deprecated use SheetMeasurementHelper.checkIfAllowedDrawingType instead * 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; /** * @deprecated use SheetMeasurementHelper.getSheetToolTipText instead * @param hit * @param allowedDrawingTypesList * @param defaultToolTip * @returns */ function getSheetToolTipText(hit: HitDetail, allowedDrawingTypesList: SheetMeasurementsHelper.DrawingType[], defaultToolTip: (hit: HitDetail) => Promise): Promise; } //# sourceMappingURL=SheetMeasurementHelper.d.ts.map