UNPKG

@itwin/core-backend

Version:
54 lines 2.97 kB
/** @packageDocumentation * @module Elements */ import { TextAnnotation, TextAnnotation2dProps, TextAnnotation3dProps } from "@itwin/core-common"; import { IModelDb } from "./IModelDb"; import { AnnotationElement2d, GraphicalElement3d } from "./Element"; import { Id64String } from "@itwin/core-bentley"; /** An element that displays textual content within a 2d model. * The text is stored as a [TextAnnotation]($common) from which the element's [geometry]($docs/learning/common/GeometryStream.md) and [Placement]($common) are computed. * @see [[setAnnotation]] to change the textual content. * @public @preview */ export declare class TextAnnotation2d extends AnnotationElement2d { /** @internal */ static get className(): string; protected constructor(props: TextAnnotation2dProps, iModel: IModelDb); static fromJSON(props: TextAnnotation2dProps, iModel: IModelDb): TextAnnotation2d; toJSON(): TextAnnotation2dProps; /** Extract the textual content, if present. * @see [[setAnnotation]] to change it. */ getAnnotation(): TextAnnotation | undefined; /** Change the textual content, updating the element's geometry and placement accordingly. * @see [[getAnnotation]] to extract the current annotation. * @param annotation The new annotation * @param subCategory If specified, the subcategory on which to define the geometry; otherwise, the default subcategory of the element's category is used. * @returns true if the annotation was successfully updated. */ setAnnotation(annotation: TextAnnotation, subCategory?: Id64String): boolean; } /** An element that displays textual content within a 3d model. * The text is stored as a [TextAnnotation]($common) from which the element's [geometry]($docs/learning/common/GeometryStream.md) and [Placement]($common) are computed. * @see [[setAnnotation]] to change the textual content. * @public @preview */ export declare class TextAnnotation3d extends GraphicalElement3d { /** @internal */ static get className(): string; protected constructor(props: TextAnnotation3dProps, iModel: IModelDb); static fromJSON(props: TextAnnotation3dProps, iModel: IModelDb): TextAnnotation3d; toJSON(): TextAnnotation3dProps; /** Extract the textual content, if present. * @see [[setAnnotation]] to change it. */ getAnnotation(): TextAnnotation | undefined; /** Change the textual content, updating the element's geometry and placement accordingly. * @see [[getAnnotation]] to extract the current annotation. * @param annotation The new annotation * @param subCategory If specified, the subcategory on which to define the geometry; otherwise, the default subcategory of the element's category is used. * @returns true if the annotation was successfully updated. */ setAnnotation(annotation: TextAnnotation, subCategory?: Id64String): boolean; } //# sourceMappingURL=TextAnnotationElement.d.ts.map